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

[PATCH 01/12] x86: Reject CPU policies with vendors other than the host's


  • To: <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Alejandro Vallejo <alejandro.garciavallejo@xxxxxxx>
  • Date: Fri, 6 Feb 2026 17:15:23 +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=8U/tOhuQz4IEnvv5g6K+uE3NzPZT0JPx1VIr+jwU6TU=; b=PL1zkJmmtoAe/siY60mi+hMZFKXySSwUcBjnhH5lLBjN+U0jHvvC7A7QI/YBQg+aoEcSEzbbUPYRDxuGOiHiEl9w/WDvV7b7NhWOdzy3+fNBvILTx6LFd6lDT1c6yFTFGJrCHvYJnyz78cd2hqykn6i/j1ru+m9Xw09dZnnGwYnJj1BXzqFu40+AyESI2n7o+E3eVGvzY+06lNw6uTFb5iaKRqGifay2KZushy/0vrTZocHAtpdhsFMbUkXQCUay9HOKFdk+IvdRcCLV/1abLF5AcimOOETU9gEkC/kttJKB2LK6UthRrfDD6UQ/nHo2dieB6WSKNbezVbOk8yOcxQ==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=degnmZ/NmJiJxxx5uBAmiFH7zkk8AO2+jWtHJaRbyToKkGnUvct0d3KDz/XmSq+kb5XpCUOjOMmvilsbS09DEXcdp337XQutA7pU9WcG0Q/gIs2g9kMtrwU+JC85hu7u83amXwmN1zGw3pXefSmE4j3ASwfpr33xIzUIwygEZvGZ0tFmPM4QCD+ZN1hkyd7vMn85WNZu6Gs3o0gv7jar3bK5ZX3wLhI/Ah34ULLUa/BQRyL7xdpOzODcXgbWY4Jhrw9PBLovsZlpZvyayEuiRtLMdzDku0vyzSC4cazmA8qNiMRxxZrvwNJB2s/I4yefDHE1NFvv0pSN+yce3gURQg==
  • Cc: Alejandro Vallejo <alejandro.garciavallejo@xxxxxxx>, Jan Beulich <jbeulich@xxxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>, Jason Andryuk <jason.andryuk@xxxxxxx>
  • Delivery-date: Fri, 06 Feb 2026 16:16:14 +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. Not doing so enables certain
optimisations with regards to vendor checks in later patches.

Signed-off-by: Alejandro Vallejo <alejandro.garciavallejo@xxxxxxx>
---
Patch 1 from the cross-vendor series. Do not merge here. It's simply for
consistency.
---
 xen/lib/x86/policy.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

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