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

[PATCH v2 3/4] x86/hvm: Remove cross-vendor checks from MSR handlers.


  • To: <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Alejandro Vallejo <alejandro.garciavallejo@xxxxxxx>
  • Date: Thu, 5 Feb 2026 18:09:21 +0100
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=lists.xenproject.org smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none (0)
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=jBpFBQTDjfYGESALWpvq1K9sdPU23kKe6+u6O2nDSkc=; b=FmFMNqcUbC4PAbMtyhi2XzJB3SOIETY6/aimC2utr7GonogxnMXUHnxQGaeG76I83n7kTnx7dMnuOaY/la0Wavr1NwM6ne4/Eq4ERSsgYvIO6hFBMDCzr7OF0crTQJ/5Xa959IAD9KwvICAWTjVqtKR06FfbvzxhQ9ewCluuJ2y+B3y8vx5K48ejjyRfIX6k1xF//4U8S6KO2KdnhsTL/m7YfSxy3ppTIFpx4QVdMlipOofMZrSKRV5IGg2T2cutZNHWVZlSikQctVAY63NCCjXP2eonnAa7oVIf/qLV12MK3xjXy45Bt6xT0cbfog3dN8VfDqQ9VS7uEaXPTaLl0Q==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=XKBUMpcXB882L+w4U6c/m0A68oxUKJgyABnfS3tYhhrbRC8QVIthHeNgfb3CdVKNFuyXgcGmaqVQWTEhfdSWbNe2cxhcim1c5DBxxYzlSdazKrEsGBrSWzkJ2n6FAbxmFh7GLbsRxD/TZXUia+okFOAXBslmNyjFQFGxww1JjYHaOn0wWp2M8LEy5DzkoHd5Dj4qLSNdI9GhQmuqOYFbabaJf/AVp4KEtNjX8mcasmLMonSoFwz2pMZelw6KST0RweUre41jPI1YJgdcs/27HlxRr8yBfGZhvyDc6PmY31syq8363/WPRqufb0fD1H1SIhUNvJBkWJZKooTvaEUV6Q==
  • Cc: Alejandro Vallejo <alejandro.garciavallejo@xxxxxxx>, Jan Beulich <jbeulich@xxxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>, Teddy Astie <teddy.astie@xxxxxxxxxx>
  • Delivery-date: Thu, 05 Feb 2026 17:10:10 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

Not a functional change now that cross-vendor guests are not launchable.

Signed-off-by: Alejandro Vallejo <alejandro.garciavallejo@xxxxxxx>
Reviewed-by: Teddy Astie <teddy.astie@xxxxxxxxxx>
---
v2:
  * Use boot_cpu_data rather than policy vendor.
---
 xen/arch/x86/msr.c | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/xen/arch/x86/msr.c b/xen/arch/x86/msr.c
index ad75a2e108..d10891dcfc 100644
--- a/xen/arch/x86/msr.c
+++ b/xen/arch/x86/msr.c
@@ -169,9 +169,9 @@ int guest_rdmsr(struct vcpu *v, uint32_t msr, uint64_t *val)
         break;
 
     case MSR_IA32_PLATFORM_ID:
-        if ( !(cp->x86_vendor & X86_VENDOR_INTEL) ||
-             !(boot_cpu_data.x86_vendor & X86_VENDOR_INTEL) )
+        if ( boot_cpu_data.vendor != X86_VENDOR_INTEL )
             goto gp_fault;
+
         rdmsrl(MSR_IA32_PLATFORM_ID, *val);
         break;
 
@@ -189,9 +189,7 @@ int guest_rdmsr(struct vcpu *v, uint32_t msr, uint64_t *val)
          * from Xen's last microcode load, which can be forwarded straight to
          * the guest.
          */
-        if ( !(cp->x86_vendor & (X86_VENDOR_INTEL | X86_VENDOR_AMD)) ||
-             !(boot_cpu_data.x86_vendor &
-               (X86_VENDOR_INTEL | X86_VENDOR_AMD)) ||
+        if ( !(boot_cpu_data.vendor & (X86_VENDOR_INTEL | X86_VENDOR_AMD)) ||
              rdmsr_safe(MSR_AMD_PATCHLEVEL, val) )
             goto gp_fault;
         break;
-- 
2.43.0




 


Rackspace

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