[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: Roger Pau Monné <roger.pau@xxxxxxxxxx>
  • From: Alejandro Vallejo <alejandro.garciavallejo@xxxxxxx>
  • Date: Tue, 10 Feb 2026 11:11:25 +0100
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=citrix.com 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=LfIaAL9d2E0xKt3C1F/0Z4M4a1D2voeXJKTaSPKkyVc=; b=MWg4IPmulIbXm0zSCy8LX/h9nJmsMAxnTi5PwiKksQHtPCcBFM2d7khZQNMyNGmRWkacoK1YlG2UWZeKhkjS9ajsky+4g1raxkIkxvNtQ/fuCXYva8KDrfayTjr7KNd+UypJ6gOkaYlg3TczdWyCp8rYcUggJhS8l8HDVRN+sonEnenCCnADbWfWPv113kGIsNFaliNhbasoVJGMeawluCFt3gswhOO3LJA8Hr25mwU36xiwXh57pWLriuoTU4TfkmyzRiJJzmguTe8MfrhSVq0CfasyM19R47+1IvTj8tl9UwoozSNBgY5fzY9rDkj0sZNhupwYlLFhduY/rQDOeg==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=TWxfiUqzB+0lbe+PX5K9pDlBSK6ZOEE+Lplp1FtfxaAJWTp+nFrl6bmYxwfi1YuB3rUXMaPeG1xLxQ3GH8w7ra1CLkVxAAPFIEhaUb7Moc4LL/g8pSm5ox0dalgpsNqBZJKkhzfeOFQoqLjLigESlwAFMTgfhe/y2J0Jw2W74d4hecJRndEIgBHDeFqIsGmcQPK/hQiC12CXQkewtZxCL2GTNU1nyqvUXoK+oE7kAibS3at0lsMIZ2rXybFRdvPujAS69whm8yoc3kecraGhc7+l8m6GPHTjGV2lpZQPOtqfuu2qYHKe2bAFPxVPZIqBf1zvOO1EqAlPvJ811ledQw==
  • Cc: <xen-devel@xxxxxxxxxxxxxxxxxxxx>, Jan Beulich <jbeulich@xxxxxxxx>, "Andrew Cooper" <andrew.cooper3@xxxxxxxxxx>, Jason Andryuk <jason.andryuk@xxxxxxx>
  • Delivery-date: Tue, 10 Feb 2026 10:11:56 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On Tue Feb 10, 2026 at 9:19 AM CET, Roger Pau Monné wrote:
> 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.

I didn't consider it. I guess I could. What I'm thinking also is that this
vendor check should probably check the encoded vendor (ebcx/ecx/edx) rather
than the decoded one.

Cheers,
Alejandro



 


Rackspace

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