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

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


  • To: Alejandro Vallejo <alejandro.garciavallejo@xxxxxxx>
  • From: Roger Pau Monné <roger.pau@xxxxxxxxxx>
  • Date: Tue, 10 Feb 2026 09:19:24 +0100
  • 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=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=U6d7WkdiOukGoroYEDRoKFdd3u/gbnbCvVbVXG9ZfRg=; b=q0b1X34paX0X2PQcs/zAiKA+y2Q4J4b0EXah32+8yHrNVtKQeHj/Vdboh50o5nKgGmGgPvAYj9U3EAMMUYA7F7mKM8knbs+C5AY4WFIp4v4QivscPj/X9zVXTT3Jtc46qufnKqVBlTfEPGnHDxJtjQ1qotfAXQbaYLgKQlA0ECSodDfDEXMzO4lBQO5CQ6ZuNJPg9dxSC1qPcvIQDwanqMKV5aBP1T+xsFyrwAvS+xWmn2stul8R/90+TazFLRebPMzNtbpVNhjvuw0sEwesvqj2QJEBSmHRtsLx8gB3ITgcz/90LrGFHBDMYNNUOEDHVgLQ/++xj1JHGOXpgJjRlQ==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=boXfZKtd2H6gf7c9PtV723ZqzjMvNamei7eWWuuNzQckMm0fjeIPJPA+ePYHDcGBvBjKBwCkgrmTpfo52nsOudwNxSysTSnjmq33aG7JAHm3qmDUlOE2U4wtZPjF/EBzVs3UR+fY2BcbQZ51J+1cCoXmIsIsGbTJ6xOn7MjD+QAsfM73q70LluxJ5p4qEywcn/tUVv177a3i9xx3gTEzsVbpEZ/m7Ve+qy/AimWVWhDM3zp988mCJStycsO5qTXvuefei2GLsTwcxt75n5d5GYazjKo4yigCgaRN0qUjICehmZwPiag0e0BafXHO/wakfQ0Q1/SpQq8V0Zvailmhqg==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=citrix.com;
  • Cc: xen-devel@xxxxxxxxxxxxxxxxxxxx, Jan Beulich <jbeulich@xxxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Jason Andryuk <jason.andryuk@xxxxxxx>
  • Delivery-date: Tue, 10 Feb 2026 08:19:44 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On Fri, Feb 06, 2026 at 05:15:23PM +0100, Alejandro Vallejo wrote:
> 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) )

You possibly want to expand test-cpu-policy.c to add a small test to
ensure this works as expected?  Not that it shouldn't, but it's
trivial to expand test_is_compatible_{success,failure}() to add a
small test for the vendor checking.

Thanks, Roger.



 


Rackspace

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