[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH] x86/msr: handle reads to MSR_P5_MC_ADDR
- To: xen-devel@xxxxxxxxxxxxxxxxxxxx
- From: Roger Pau Monne <roger.pau@xxxxxxxxxx>
- Date: Wed, 27 Apr 2022 17:47:01 +0200
- 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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=unVUOTMEiGDOnk056OLERWvD7aIsW3mOlXPAuysFbsQ=; b=h0JMvSb8ybH6GpcsKus89Askc4ALb9Vket0+x3DT7BmEh7c9YDB1L8evB7KHR4EjEX2gLLLtwpUM+j8TXDO77Jdpanx9qO0euZFxd7iOo+I1jOj8T+e1ScjLstaXpb7heV5WX4e1TIQS07c/X08uu+uhaxSlyGRpcje9FPkEIHjlNtOvZxuEJhfNeWjEG6pnG0dQBKMMfOleszqvC7IKx6bmu4z65/PsWUCHGavI4z90Zp81ealYzppsCNq3N9Bm8Jx+ilxuZ7bDwklMqoezMA2S0jcpGQTspZTsWzaHrdBs85OGOSpDwxo5W+yRTv4+TbkL6rc4mIptSpe9EgD94Q==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=GEoWjckPRwNkMhZ7Wzk5zK/H+O8jlF01g3miLpAiXOZbHJQ87dad4UuwQta7HmTAPa3jRjzHmLY6QMI+8Cwn5UdnKz5VAB7LVxChapDJddgFVxetks6Q7qzVphnn6lci8pH5oJf3L+hORCdAWXGzPQPuVRdRcMvvEXJ5RTQhGU6cm/SnHiLHuBFV1J1fYRE0WfV7RKfqmAqy7VK1Gud4U+cFCtp82SkO39LcB3QPoJqDuuQXu9z4f01jOmdM5G6c/VLGvG/P+bGSNWnSwaGVbGKlYTZOanTPno+UuQewTF3KVbcuIujhMWCXhU3iI4vlbLsZJ2mMv/bHVBXC8tsusw==
- Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=citrix.com;
- Cc: Roger Pau Monne <roger.pau@xxxxxxxxxx>, Jan Beulich <jbeulich@xxxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, Steffen Einsle <einsle@xxxxxxxxxx>
- Delivery-date: Wed, 27 Apr 2022 15:47:19 +0000
- Ironport-data: A9a23:sxMfG66FFxjfaTr040Sr1wxRtDnGchMFZxGqfqrLsTDasY5as4F+v mVOXz+DOvzcZ2Khfd91YYjk/B4D7JTVnYVjG1Nlr3g3Hi5G8cbLO4+Ufxz6V8+wwmwvb67FA +E2MISowBUcFyeEzvuVGuG96yE6j8lkf5KkYAL+EnkZqTRMFWFw0XqPp8Zj2tQy2YTjXFvU0 T/Pi5a31GGNimYc3l08s8pvmDs31BglkGpF1rCWTakjUG72zxH5PrpGTU2CByKQrr1vNvy7X 47+IISRpQs1yfuP5uSNyd4XemVSKlLb0JPnZnB+A8BOiTAazsA+PzpS2FPxpi67hh3Q9+2dx umhurSeUEArZ4P0gtgtdDJlKgNbMq5d05TYdC3XXcy7lyUqclPK6tA3VAQTAtdd/ex6R2ZT6 fYfNTYBKAiZgP67y666Te8qgdk/KM7sP8UUvXQIITPxVK56B8ycBfiXo4YAjV/chegXdRraT 9AeZjd1KgzJfjVEO0sNCYJ4l+Ct7pX6W2IA8A/I+fFqi4TV5Cpu0YDzL+HVRo2xbIJOwU+9/ kLc32usV3n2M/Tak1Jp6EmEluLJ2C/2Ro8WPLm57eJxxk2ewHQJDx8bXkf9puO24ma8Ud9CL 00f+gI1sLM/skesS7HVQBmQsHOC+BkGVLJ4Huw88wWA4rLU+xqDB3hCQjMpVTA9nMo/RDhv0 0DTmdrsXGRrqOfMESPb8aqIpzSvPyRTNXUFeSIPUQoC5Z/kvZ03iRXMCN1kFcZZk+HIJN05+ BjSxABWulnZpZRjO3mTlbwfvw+Rmw==
- Ironport-hdrordr: A9a23:yevEta/VeaWTsTCe0YJuk+E+db1zdoMgy1knxilNoENuH/Bwxv rFoB1E73TJYVYqN03IV+rwWpVoJkmsjaKdgLNhRItKOTOLhILGFvAH0WKP+V3d8k7Fh5NgPN lbAs9D4bTLZDAV7PoSiDPIaerIq+P3lZxA692urEuEGmpRGtpdBkpCe3GmO3wzYDMDKYsyFZ Ka6MYCjz28eU4PZsD+InUeReDMq/DCiZqjOHc9dlcawTjLqQntxK/xEhCe0BtbezRTwY06+W yAtwDi/K2sv9yy1xeZ/W7O6JZ9nsfn17J4dbqxo/lQDg+pphejZYxnVbHHlDcpoNu34FJvq9 XIqwdIBbUA11rhOkWO5Tf90Qjp1zgjr1X4z0WDvHflqcvlABonFston+tiA1bkwntlmOs5/L NA3mqfuZYSJwjHhj7B69/BUAwvvlaooEAljfUYgxVkIMEjgYdq3MMiFX5uYdk99HqQ0vFnLA AuNrCW2B9uSyLXU5iD1VMfgOBFXRwIb2S7qwY5y4+oOgNt7Q9EJnsjtbAid0g7hewAouF/lo L524RT5cRzp5wtHNZA7Nloe7rHNkX9BTTxDUm1HXPLUIk6BlOlke+G3Fxy3pDjRKA1
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
Windows Server 2019 Essentials will unconditionally attempt to read
P5_MC_ADDR MSR at boot and throw a BSOD if injected a #GP.
Fix this by adding dummy handling that returns 0 for reads of
P5_MC_ADDR. This seems to be enough to make Windows happy.
Reported-by: Steffen Einsle <einsle@xxxxxxxxxx>
Signed-off-by: Roger Pau Monné <roger.pau@xxxxxxxxxx>
---
I've added it for CENTAUR and SHANGHAI because the MSR is there since
Pentium, so likely to be implemented by those vendors also, but have
no way to check.
I wonder how long it will take for Windows to also start poking at
MSR_IA32_MC0_ADDR or other MCE related registers. For now this seems
to be enough.
---
xen/arch/x86/include/asm/msr-index.h | 2 ++
xen/arch/x86/msr.c | 13 +++++++++++++
2 files changed, 15 insertions(+)
diff --git a/xen/arch/x86/include/asm/msr-index.h
b/xen/arch/x86/include/asm/msr-index.h
index 3e038db618..02af9dc039 100644
--- a/xen/arch/x86/include/asm/msr-index.h
+++ b/xen/arch/x86/include/asm/msr-index.h
@@ -15,6 +15,8 @@
* abbreviated name. Exceptions will be considered on a case-by-case basis.
*/
+#define MSR_P5_MC_ADDR 0
+
#define MSR_APIC_BASE 0x0000001b
#define APIC_BASE_BSP (_AC(1, ULL) << 8)
#define APIC_BASE_EXTD (_AC(1, ULL) << 10)
diff --git a/xen/arch/x86/msr.c b/xen/arch/x86/msr.c
index a1e268eea9..e50bbf466a 100644
--- a/xen/arch/x86/msr.c
+++ b/xen/arch/x86/msr.c
@@ -216,6 +216,19 @@ int guest_rdmsr(struct vcpu *v, uint32_t msr, uint64_t
*val)
case MSR_AMD_PPIN:
goto gp_fault;
+ case MSR_P5_MC_ADDR:
+ /*
+ * Windows Server 2019 Essentials will attempt to read the MSR and
+ * throw a BSOD if a #GP is raised, so just return 0 in order to make
+ * Windows happy.
+ */
+ if ( !(cp->x86_vendor & (X86_VENDOR_INTEL | X86_VENDOR_CENTAUR |
+ X86_VENDOR_SHANGHAI)) )
+ goto gp_fault;
+
+ *val = 0;
+ break;
+
case MSR_IA32_FEATURE_CONTROL:
/*
* Architecturally, availability of this MSR is enumerated by the
--
2.35.1
|