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

Re: [PATCH 6/6] x86/boot: Expose MSR_ARCH_CAPS data in guest max policies


  • To: Jan Beulich <jbeulich@xxxxxxxx>
  • From: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
  • Date: Fri, 19 May 2023 16:52:21 +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=arcselector9901; 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=VAr9VLcnWtdBGK+4BN5I3SbbD6F0ngyViRpoJsSvtRo=; b=j6yh6g3gqZjk+aE59jGXNULYpWuoU/eQi3/vpq9IvJtUcZMAfcs1HzvvaMEgjCHKCzzr2WuG7aEs/YRqfDbKFwEkEXqD49bA68NdsbEAQSM28k0ZNKV9IQJvVO8hIs6xkmWSVxFIyAJcqlXSe+xeKXksl1lgb33Uw06Yo+bqzA/x8PWAe5/02o9JZdtVrc1WsIZLm1J2aklVHlzkUHpVUH0ecxlPCLVNiyTHJofFtFisH0tMs0yO0EhyLsY5RrqtF5HI83Y3iL+VPWHJg7A+F75EpJNuTQFmgaPisFWVf1mFxzZpR0U5VCIMi53FCWvbs4dq9ovAzMhyuv0JBqCSSQ==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=A2XyawxI21XHEVcyV/TXjV5eONn45q8OXkpB7RLQiM3Gvr9DlpsRGB/wyPWPnF/792OjuDiF+VAzrCwaBnMmaHpeAWI4YQkcnWZR/axz+ClTmFHvAmrbQtINnTKfbx8AuuEkw2HC/X0UzbzzeADQfDZ41bwUEk9D6pTziUReWolorWEOyKTBSpe4/8Qo7ouwL/HznIb5nbLZAqBqUoCZtCMfIHxeKHXtPrbu5Cty+GZecE20g5NsmhAyq1UQn12zkAe1Cpx0KrSJzwIvrH/eEkIFay6wSURmLAaYPzd7cQ2FU+m+FZJ19gkSqtjQB9xg5XMd5ftkl/MzmuhccYU8Mg==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=citrix.com;
  • Cc: Roger Pau Monné <roger.pau@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, Xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • Delivery-date: Fri, 19 May 2023 15:52:36 +0000
  • Ironport-data: A9a23:KdiiAqraSbIZqZhbSQqpztuf+FFeBmI6ZBIvgKrLsJaIsI4StFCzt garIBnXbP+CZ2fyftEiO4+wp0xXusXRn9dqGwVvpCkxESlDoJuZCYyVIHmrMnLJJKUvbq7FA +Y2MYCccZ9uHhcwgj/3b9ANeFEljfngqoLUUbKCYWYpA1c/Ek/NsDo788YhmIlknNOlNA2Ev NL2sqX3NUSsnjV5KQr40YrawP9UlKq04GtwUmAWP6gR5weDzihNVvrzGInqR5fGatgMdgKFb 76rIIGRpgvx4xorA9W5pbf3GmVirmn6ZFXmZtJ+AsBOszAazsAA+v9T2Mk0MC+7vw6hjdFpo OihgLTrIesf0g8gr8xGO/VQO3kW0aSrY9YrK1Dn2SCY5xWun3cBX5yCpaz5VGEV0r8fPI1Ay RAXAGwiNxykhcum+5a6EdAvu+cmLdLrLIxK7xmMzRmBZRonabbqZv2WoPV+jHI3jM0IGuvCb c0EbzYpdA7HfxBEJlYQDtQ5gfusgX78NTZfrTp5p4JuuzSVkFM3j+SrbIC9lt+iHK25mm6xo G7c8nu/KRYdLNGFkhKO8262h/+JliT+MG4XPOTgp6A72wXLngT/DjVVdWmkm8a0zXKUUtV7A AsspQMph6w9oRnDot7VGkfQTGS/lhwWVsdUEuY6wBqQ0aeS6AGcbkAbShZRZdpgs9U5LRQ62 1nMk973CDhHtLyOVWnb5rqStSm1OyUeMSkFfyBscOcey9zqoYV2hBSfSN9mSPKxloetRWu2x C2Wpi8jgblVldQMy6iw4VHAhXSru4TNSQk2oA7QWwpJ8z9EWWJsXKTwgXCz0BqKBN/xooWp1 JTcp/Wj0Q==
  • Ironport-hdrordr: A9a23:ARFCX6Ned3oXbsBcTgWjsMiBIKoaSvp037BK7S1MoH1uA6mlfq WV9sjzuiWatN98Yh8dcLO7Scu9qBHnlaKdiLN5VduftWHd01dAR7sSjrcKrQeAJ8X/nNQtr5 uJccJFeaDN5Y4Rt7eH3OG6eexQv+Vu6MqT9IPjJ+8Gd3ATV0lnhT0JbTqzIwlNayRtI4E2L5 aY7tovnUvaRZxGBv7LYEXsRoL41qT2qK4=
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 16/05/2023 3:58 pm, Jan Beulich wrote:
> On 15.05.2023 16:42, Andrew Cooper wrote:
>> --- a/xen/arch/x86/cpu-policy.c
>> +++ b/xen/arch/x86/cpu-policy.c
>> @@ -408,6 +408,25 @@ static void __init calculate_host_policy(void)
>>      p->platform_info.cpuid_faulting = cpu_has_cpuid_faulting;
>>  }
>>  
>> +static void __init guest_common_max_feature_adjustments(uint32_t *fs)
>> +{
>> +    if ( boot_cpu_data.x86_vendor == X86_VENDOR_INTEL )
>> +    {
>> +        /*
>> +         * MSR_ARCH_CAPS is just feature data, and we can offer it to guests
>> +         * unconditionally, although limit it to Intel systems as it is 
>> highly
>> +         * uarch-specific.
>> +         *
>> +         * In particular, the RSBA and RRSBA bits mean "you might migrate 
>> to a
>> +         * system where RSB underflow uses alternative predictors (a.k.a
>> +         * Retpoline not safe)", so these need to be visible to a guest in 
>> all
>> +         * cases, even when it's only some other server in the pool which
>> +         * suffers the identified behaviour.
>> +         */
>> +        __set_bit(X86_FEATURE_ARCH_CAPS, fs);
>> +    }
>> +}
> Wouldn't this better be accompanied by marking the bit !a in the public 
> header?

Yes, probably.

~Andrew



 


Rackspace

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