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

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


  • To: <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Alejandro Vallejo <alejandro.garciavallejo@xxxxxxx>
  • Date: Fri, 13 Feb 2026 12:42:29 +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=VBqdjJJWfXtoJEzYSSAEqpJRKMsq/TtKBIgS2SAY1Gc=; b=CDE4QIowNieUhDIhAdH7bpJrcPOk8bZZkQMKUtfmAenDpw3R5B0WJFtjOKzZY+weaUG8XPm6YiKmNT8DyAh6RE+vkWA8B/07rhexGT7mqybdJJMEcYMzfsDe2aKHyDtYVCgzf+O7zZV23PNwzS+vcY+pGgmh1Lqh50m6ie46PWnegAMydgqJkL9ckAKmZ8+qmcoiS60oQls2x0PZMtrOLQSXFU8hpGV2yfLNIYGjxGkfGO7mjwaD2qXVg6lVyvkHefMIZ9ayFQenZ0pqjvhw9/6iLX5hUXue4Mo3XULCA01jy7xvDWDQGn0XsL2PLZAlO1om8A2e6CxvW7LnPpEjdw==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=OMDXjPvVkSKAPuMAZ9QFjCqur+LCwW497svVndSf0hv8AZQu9DntVz3zUdgNk8F/hNsGS0LnKg0I9J6IYkXDIvInKomNQBaqfNJH1mk8dDYPAbLompSp9kDtU2HXt6EDTGAPqIYYa6KiNbJwBKXM47u4P7msFhSfJykuOm2zFmS8Qw5czN5B2YW+RyUGAvikUBvAfHagq8QjPNvQxaTWJvnL08CREQkDx0K3M/Yej4t2zHpXcnKHW79qUwCGdFw2WkfmaXCGWBs99ITeJ3rTpScSeSZQE0SaBamtZPIAb2go3QOWBEHzjI+HFehGlPqO8E8ogR8dqgSl/3h01dNNKg==
  • 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: Fri, 13 Feb 2026 11:43:02 +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>
---
v3:
 * No changes

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®.