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

[PATCH v2 1/4] x86: Reject CPU policies with vendors other than the host's


  • To: <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Alejandro Vallejo <alejandro.garciavallejo@xxxxxxx>
  • Date: Thu, 5 Feb 2026 18:09:19 +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=mflu5yg/x6sFMgT8nkXWde/8IdOHVsgphCYV4lo/bCM=; b=R8ZvBlsLB3J9mZqqVtatqGfpe2b+0f+aihjJhTOrsAVtfkiMTj5/6ei5diEgYI25jmWrrhqc6aMTkIgdSaoA4dJMXU08a0a/X5seG3PUw7GkdSGTew7Ukr0PA1dkfHMa72sFuuRComKCE2C0EF35mfljdsHZ9ddnMjFGTonII8H7Tym1uamInTSD8SBUgXtFbb8AXTvtTR/raDKS8YbVJDAnw4nVL2sqFiG2yDliONsyYTTH4h9gLZcZdZf4djD0vvZ9Lr7EYW6VXrmoeiKm6EX59h7MDuTDYnbpAfylw7cDcsEK7Neps3H+VlZTAPTSBf2vyGZMAk8xSOZrGfCx8Q==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=iOjw3ddZ57njugMK2f9y1tn4zVqtQoaRIEsfBEnOj7r5ztDnqOkO6MRAQ6+MFLUWg5qyYOqz9qomPZEHcwSWQYY+r1/WLyoZQPBIABjGjQEPqGJ7RL1kJpGXgji6Vhbr6E8IWQ3bfP4Hd9Y0pp1ELQybUX3zIaWEzQcxOd2sC8F085VW/o08iP9Wvho+wNvcLpScyuYCgfvu0yuE+polczTWn5HAdIofxvjmOb/wZxX3fj1kOGg6mJ25QrJSYrhCt7ZQLU5I+cSHcpneusIQmQ281c/wpVCl0BrVlJMgi2Ej0HAKWm16lfvrw/tAi4WahgiuRbiBiAH8Sg+GvRU1rA==
  • Cc: Alejandro Vallejo <alejandro.garciavallejo@xxxxxxx>, Oleksii Kurochko <oleksii.kurochko@xxxxxxxxx>, Community Manager <community.manager@xxxxxxxxxxxxxx>, Jan Beulich <jbeulich@xxxxxxxx>, "Andrew Cooper" <andrew.cooper3@xxxxxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>
  • Delivery-date: Thu, 05 Feb 2026 17:10:11 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

While in principle it's possible to have a vendor virtualising another,
this is fairly tricky in practice and comes with the world's supply of
security issues.

Reject any CPU policy with vendors not matching the host's.

Signed-off-by: Alejandro Vallejo <alejandro.garciavallejo@xxxxxxx>
---
v2:
  * Reversed polarity of leaf0 check in policy compatibility helper.
  * Reworded changelog entry in terms of LM + save/restore.
---
 CHANGELOG.md         | 5 +++++
 xen/lib/x86/policy.c | 3 ++-
 2 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/CHANGELOG.md b/CHANGELOG.md
index 18f3d10f20..426c0bce67 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -22,6 +22,11 @@ The format is based on [Keep a 
Changelog](https://keepachangelog.com/en/1.0.0/)
    - Xenoprofile support.  Oprofile themselves removed support for Xen in 2014
      prior to the version 1.0 release, and there has been no development since
      before then in Xen.
+   - Domains can no longer run on a CPU vendor if they were initially launched
+     on a different CPU vendor. This affects live migrations and save/restore
+     workflows accross mixed-vendor hosts. Cross-vendor emulation has always
+     been unreliable, but since 2017 with the advent of speculation security it
+     became unsustainably so.
 
  - Removed xenpm tool on non-x86 platforms as it doesn't actually provide
    anything useful outside of x86.
diff --git a/xen/lib/x86/policy.c b/xen/lib/x86/policy.c
index f033d22785..079c42a29b 100644
--- a/xen/lib/x86/policy.c
+++ b/xen/lib/x86/policy.c
@@ -15,7 +15,8 @@ int x86_cpu_policies_are_compatible(const struct cpu_policy 
*host,
 #define FAIL_MSR(m) \
     do { e.msr = (m); goto out; } while ( 0 )
 
-    if ( guest->basic.max_leaf > host->basic.max_leaf )
+    if ( (guest->x86_vendor     != host->x86_vendor) ||
+         (guest->basic.max_leaf >  host->basic.max_leaf) )
         FAIL_CPUID(0, NA);
 
     if ( guest->feat.max_subleaf > host->feat.max_subleaf )
-- 
2.43.0




 


Rackspace

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