[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH] x86/msr: don't inject #GP when trying to read FEATURE_CONTROL


  • To: <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Roger Pau Monne <roger.pau@xxxxxxxxxx>
  • Date: Fri, 27 Nov 2020 11:46:14 +0100
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com; dkim=pass header.d=citrix.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=kMM+/x5/EdEJOyjUC+X75zlJ9+hyk+7CvKHWojtzWqE=; b=d1V8P/PHkVyWrG/F5hSYb9m+D7vZuA4MZ6G335V6+1wpvsuHfp6KgPF9/CbqtkTY58TFDfk0MrGOZ0LJ6qDipo7J2WKnRCm9mztAnTLtm98xre7RkiUvG3w3ZJXm2fMXS9KSx28nuysMU8Ct9pInmYfKbAe6mKb49Hzcmc9Qt63+Hm1LBv13jm78SpwJkR04PtvxQRv0chk+WAlQnX3zAxnFKGPHoSdTW1BGBa3R8NjbWM2JKYFTa6qWfwY74n43kVXO38P6YXe0/H8WYUlx68DQzAxF3T0v/xhL2Aaenix35Np8ydtSzixSoG54oVZiqAAyasWtby9+B+a1qjpmFA==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=k+AWDEwllZrtql9NDcXH5jT9gIbhrXFGvgqw7pUsqKPGiP7/mWcx7a1viBWGlWyRbwbOqqO9Hu/fC4txJhCUhFHp6afExNrKxfQYa5HRPwWjzgyHuudo8AzixVU/S7W6HwlgfnH4YsDEC5lxixyAcD+M/jddLDNAwF8JlZQqHip9CTAbrMyju/j7GLQHUp1zZDH5JCI2sHk6MmmAgxI7loagkGQTyUZl8tjEe5YbtSjtt2ydwj9JciFQFuQyQUp15ZYCto9vmpEGyHJ3CePoX0dMA+TcDHGs0GtBnoXkSWAkbprvCYWic/6E2vMXA2PZqZE2XsjPOJ0KvjRUbJfUxA==
  • Authentication-results: esa3.hc3370-68.iphmx.com; dkim=pass (signature verified) header.i=@citrix.onmicrosoft.com
  • Cc: Roger Pau Monne <roger.pau@xxxxxxxxxx>, Jan Beulich <jbeulich@xxxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>
  • Delivery-date: Fri, 27 Nov 2020 10:46:53 +0000
  • Ironport-sdr: /skHKc2GgQjSi6QkDRPaIMDu9NqM/V3a/uRqgVDXxOWfLsWfWQWYH61nrI2gPb+3Q0QNgy9vqd uzNm1P5DLoQGgeLuHPmflOTDnc6wd+qLBBWsVtDdTkyox6RrrAZ86QQ+L9XUvbxkYMpP+o4Rew IXYS4bef4SrBZhUuYx6pjn7l1QFKOHfhOog0muPLLe/sad9p9rSwJjGiIbrZlRXPOGpPv7l8+9 2+coyUkLZg5iJHB4BAHSKEUrYBlqqNE+B1Z2MDi1oyECXlJeyRS9EBSe2UKZEqIJqsO8/0eGra xW0=
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

Windows 10 will triple fault if #GP is injected when attempting to
read the FEATURE_CONTROL MSR on Intel or compatible hardware. Fix this
by injecting a #GP only when the vendor doesn't support the MSR, even
if there are no features to expose.

Fixes: 39ab598c50a2 ('x86/pv: allow reading FEATURE_CONTROL MSR')
Signed-off-by: Roger Pau Monné <roger.pau@xxxxxxxxxx>
---
 xen/arch/x86/msr.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/arch/x86/msr.c b/xen/arch/x86/msr.c
index be8e363862..38b0a046e1 100644
--- a/xen/arch/x86/msr.c
+++ b/xen/arch/x86/msr.c
@@ -176,7 +176,7 @@ int guest_rdmsr(struct vcpu *v, uint32_t msr, uint64_t *val)
     switch ( msr )
     {
     case MSR_IA32_FEATURE_CONTROL:
-        if ( !cp->basic.vmx && !vmce_has_lmce(v) )
+        if ( !(cp->x86_vendor & (X86_VENDOR_INTEL | X86_VENDOR_CENTAUR)) )
             goto gp_fault;
 
         *val = IA32_FEATURE_CONTROL_LOCK;
-- 
2.29.2




 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.