From patchwork Tue Dec 13 14:06:14 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Beulich X-Patchwork-Id: 9472349 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id B0DC560760 for ; Tue, 13 Dec 2016 14:08:50 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 95D3B28535 for ; Tue, 13 Dec 2016 14:08:50 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 86FFC28554; Tue, 13 Dec 2016 14:08:50 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 0807D28535 for ; Tue, 13 Dec 2016 14:08:49 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cGnio-0004lZ-LW; Tue, 13 Dec 2016 14:06:22 +0000 Received: from mail6.bemta5.messagelabs.com ([195.245.231.135]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cGnio-0004lP-3p for xen-devel@lists.xenproject.org; Tue, 13 Dec 2016 14:06:22 +0000 Received: from [85.158.139.211] by server-1.bemta-5.messagelabs.com id CB/CC-16850-D5000585; Tue, 13 Dec 2016 14:06:21 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFjrGIsWRWlGSWpSXmKPExsXS6fjDSzeaISD C4FajusX3LZOZHBg9Dn+4whLAGMWamZeUX5HAmnGwbRpLwVOJigM/d7M0MB4T7mLk5BASyJP4 3/OZHcTmFbCTmHComxHElhAwlHj6/jobiM0ioCpx98tysBo2AXWJtmfbWbsYOThEBAwkzh1NA jGZBfQltq1jAakQFnCVmHT0OTNIWAho4rYV1SBhTgF7ieOtb8HCvAKCEn93gO1nBqpYcb2bcQ IjzyyEzCwkGQhbS+Lhr1ssELa2xLKFr5lnga2Vllj+jwOmfNaHg2yYSjwl5vbXL2DkWMWoUZx aVJZapGtkrJdUlJmeUZKbmJmja2hgqpebWlycmJ6ak5hUrJecn7uJERim9QwMjDsYd7T7HWKU 5GBSEuX9XO0fIcSXlJ9SmZFYnBFfVJqTWnyIUYODQ2DbrtUXGKVY8vLzUpUkeO3/A9UJFqWmp 1akZeYAIwmmVIKDR0mE99k/oDRvcUFibnFmOkTqFKOilDjvPpCEAEgiozQPrg0WvZcYZaWEeR kZGBiEeApSi3IzS1DlXzGKczAqCfNagWznycwrgZv+CmgxE9Bi0SVgi0sSEVJSDYzKB08G3+/ Zc3qZ6ecT/lqvtwc1PdVpmmHWfYsvep2X5zIDa+FTJ4w+rLv60p9l72vx74wpmh0fizTm6S9z Va/U+738oseT+UKl+aZ7fDY2ZyiLT3N/7uBU07HCKcBl+8Kovhs3TMpnP/lVmLA37ripplK/z 81s/aVfSi/vCb0Y++uD7v8tV3mUWIozEg21mIuKEwFnQfw92QIAAA== X-Env-Sender: JBeulich@suse.com X-Msg-Ref: server-16.tower-206.messagelabs.com!1481637976!59329584!1 X-Originating-IP: [137.65.248.74] X-SpamReason: No, hits=0.0 required=7.0 tests= X-StarScan-Received: X-StarScan-Version: 9.1.1; banners=-,-,- X-VirusChecked: Checked Received: (qmail 47559 invoked from network); 13 Dec 2016 14:06:18 -0000 Received: from prv-mh.provo.novell.com (HELO prv-mh.provo.novell.com) (137.65.248.74) by server-16.tower-206.messagelabs.com with DHE-RSA-AES256-GCM-SHA384 encrypted SMTP; 13 Dec 2016 14:06:18 -0000 Received: from INET-PRV-MTA by prv-mh.provo.novell.com with Novell_GroupWise; Tue, 13 Dec 2016 07:06:17 -0700 Message-Id: <58500E6602000078001289F8@prv-mh.provo.novell.com> X-Mailer: Novell GroupWise Internet Agent 14.2.1 Date: Tue, 13 Dec 2016 07:06:14 -0700 From: "Jan Beulich" To: "xen-devel" References: <58500ACA02000078001289CF@prv-mh.provo.novell.com> In-Reply-To: <58500ACA02000078001289CF@prv-mh.provo.novell.com> Mime-Version: 1.0 Cc: Andrew Cooper Subject: [Xen-devel] [PATCH 5/6] x86emul: check for SYSENTER/SYSEXIT availability X-BeenThere: xen-devel@lists.xen.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xen.org Sender: "Xen-devel" X-Virus-Scanned: ClamAV using ClamSMTP We can't exclude someone wanting to hide the instructions from guests. Signed-off-by: Jan Beulich Reviewed-by: Andrew Cooper --- Looks like I can't count - I've mistakenly omitted this patch from the overview mail, so there'll be a total of 7. x86emul: check for SYSENTER/SYSEXIT availability We can't exclude someone wanting to hide the instructions from guests. Signed-off-by: Jan Beulich --- a/xen/arch/x86/x86_emulate/x86_emulate.c +++ b/xen/arch/x86/x86_emulate/x86_emulate.c @@ -1306,6 +1306,7 @@ static bool vcpu_has( #define vcpu_has_fpu() vcpu_has( 1, EDX, 0, ctxt, ops) #define vcpu_has_cx8() vcpu_has( 1, EDX, 8, ctxt, ops) +#define vcpu_has_sep() vcpu_has( 1, EDX, 11, ctxt, ops) #define vcpu_has_cmov() vcpu_has( 1, EDX, 15, ctxt, ops) #define vcpu_has_clflush() vcpu_has( 1, EDX, 19, ctxt, ops) #define vcpu_has_mmx() vcpu_has( 1, EDX, 23, ctxt, ops) @@ -5132,6 +5133,7 @@ x86_emulate( uint64_t msr_content; int lm; + vcpu_must_have(sep); generate_exception_if(mode_ring0(), EXC_GP, 0); generate_exception_if(!in_protmode(ctxt, ops), EXC_GP, 0); @@ -5179,6 +5181,7 @@ x86_emulate( { uint64_t msr_content; + vcpu_must_have(sep); generate_exception_if(!mode_ring0(), EXC_GP, 0); generate_exception_if(!in_protmode(ctxt, ops), EXC_GP, 0); --- a/xen/arch/x86/x86_emulate/x86_emulate.c +++ b/xen/arch/x86/x86_emulate/x86_emulate.c @@ -1306,6 +1306,7 @@ static bool vcpu_has( #define vcpu_has_fpu() vcpu_has( 1, EDX, 0, ctxt, ops) #define vcpu_has_cx8() vcpu_has( 1, EDX, 8, ctxt, ops) +#define vcpu_has_sep() vcpu_has( 1, EDX, 11, ctxt, ops) #define vcpu_has_cmov() vcpu_has( 1, EDX, 15, ctxt, ops) #define vcpu_has_clflush() vcpu_has( 1, EDX, 19, ctxt, ops) #define vcpu_has_mmx() vcpu_has( 1, EDX, 23, ctxt, ops) @@ -5132,6 +5133,7 @@ x86_emulate( uint64_t msr_content; int lm; + vcpu_must_have(sep); generate_exception_if(mode_ring0(), EXC_GP, 0); generate_exception_if(!in_protmode(ctxt, ops), EXC_GP, 0); @@ -5179,6 +5181,7 @@ x86_emulate( { uint64_t msr_content; + vcpu_must_have(sep); generate_exception_if(!mode_ring0(), EXC_GP, 0); generate_exception_if(!in_protmode(ctxt, ops), EXC_GP, 0);