[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 5/6] x86/boot: Record MSR_ARCH_CAPS for the Raw and Host CPU policy
- To: Jan Beulich <jbeulich@xxxxxxxx>
- From: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
- Date: Tue, 16 May 2023 13:59:07 +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=Yymk88xLfET+N1rPKyG5v1fh9t/6tHL6bBLVffnZmGw=; b=Yn1j1BVYTxwtOz9KWQZ5/2sCLe3CTB1rU3a6wZGDPu36C83PTmMrcWu4vNjci/n3TxzPztI2Phw4bVtjNxX1nuQ26e7vTTIZIZD3c+fmYfVppBDho0zqyxRsZh7fds2nwqz78LzY3fdHJvUxy11SE2LmK0DKBiYA7SQX8OM1sKVwqtBoC6IDkIjdcETmiqablVHXVy6ErfORttoJtU/Pk5gIaDhWTYHC1GCElEZLBCS+UdxnrrkscaQ3o0NeRD/4bdWX5MV4UNUGk+OLSpg2rY7OORV4i9iRfAoU6HyOuiYGWhP75eSAKzGchqMS0D6wdcBhk7Xeqta2O5lIsGRB5g==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Dt7E1E4haJOBKvUBVGURg0pn0Jn1d381FvDd/xkLbLiy7AxM2o6M3LKgKuR4xA5T9QSPeCyyxbb3rqFJvNN1XiOAC6oblRbuLQheq2HQo/mpWjMmigLBumDyDWd7CEeFHVe1PaXkWyr2yDjVGWy3E2YIBkjN7GdIrvU51e4NXKAn7nUJdPFQM23F2g2jkOeDEm1b3lp721lgXz8BJFmBYZx8Mvrk1cuLKSX0hVmILNVbSEkF9mFtVfWaPwgIw/l1hX21ggYXH0AdUQF8j11RSvsiHot46jJnJNCC3wn16ruj74Ybi4Xe2J5013W6g6o9gl36exEztQEhmIEL5mUpQg==
- 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: Tue, 16 May 2023 12:59:32 +0000
- Ironport-data: A9a23:W/GVDK22p0Aq9FqMU/bD5f5wkn2cJEfYwER7XKvMYLTBsI5bpzECm mAfDGqPa/qPMDDyLthwaYi2pxhQsZeAzNFkTQdkpC1hF35El5HIVI+TRqvS04F+DeWYFR46s J9OAjXkBJppJpMJjk71atANlVEliefTAOK6ULWeUsxIbVcMYD87jh5+kPIOjIdtgNyoayuAo tq3qMDEULOf82cc3lk8tuTS+XuDgNyo4GlD5gFnO6gS1LPjvyJ94Kw3dPnZw0TQGuG4LsbiL 87fwbew+H/u/htFIrtJRZ6iLyXm6paLVeS/oiI+t5qK23CulQRrukoPD9IOaF8/ttm8t4sZJ OOhF3CHYVxB0qXkwIzxWvTDes10FfUuFLTveRBTvSEPpqFvnrSFL/hGVSkL0YMkFulfX2QU2 98gCHMxRQ2loeCVzriXbrN1v5F2RCXrFNt3VnBI6xj8VKxja7aTBqLA6JlfwSs6gd1IEbDGf c0FZDFzbRPGJRpSJlMQD5F4l+Ct7pX9W2QA9BTJ+uxqvi6KklwZPLvFabI5fvSjQ8lPk1nej WXB52njWTkRNcCFyCrD+XWp7gPKtXqiAdxNTObmrpaGhnWWwCsyED89U2eRpLq8pGrvfokcG XY9r39GQa8asRbDosPGdx+yrWOAvxUcc8FNCOB84waIooLL5y6JC25CSSROAPQ2uclzSTE02 1uhm9LyGScpoLCTUWia9LqfsXW1Iyd9EIMZTSoNTA9A6d+zpog210jLVow6Tv7zicDpEzbtx TzMtDI5m7gYkc8M0eO84EzDhDWv4JPOS2bZ+znqY45s1SshDKbNWmBiwQKzASpoRGpBcmS8g Q==
- Ironport-hdrordr: A9a23:afbS/68G6MF0cJ5TNm5uk+AcI+orL9Y04lQ7vn2ZKSY5TiX4rb HKoB1/73XJYVkqN03I9ervBEDiewK/yXcW2+ks1N6ZNWGLhILBFupfBODZsl7d8kPFl9K01c 1bAtJD4N+bNykGsS4tijPIb+rJw7O8gd+Vbf+19QYIcenzAZsQlzuQDGygYypLbTgDP7UVPr yG6PFKojKxEE5nFfhSVhE+Lo7+T8SgruOeXSI7
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
On 16/05/2023 1:53 pm, Jan Beulich wrote:
> On 15.05.2023 16:42, Andrew Cooper wrote:
>> Extend x86_cpu_policy_fill_native() with a read of ARCH_CAPS based on the
>> CPUID information just read, which removes the need handling it specially in
>> calculate_raw_cpu_policy().
>>
>> Extend generic_identify() to read ARCH_CAPS into x86_capability[], which is
>> fed into the Host Policy. This in turn means there's no need to special case
>> arch_caps in calculate_host_policy().
>>
>> No practical change.
>>
>> Signed-off-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
> Reviewed-by: Jan Beulich <jbeulich@xxxxxxxx>
Thanks.
>
> I have a question though, which I think would be nice if the description
> had covered:
>
>> --- a/xen/lib/x86/cpuid.c
>> +++ b/xen/lib/x86/cpuid.c
>> @@ -226,7 +226,12 @@ void x86_cpu_policy_fill_native(struct cpu_policy *p)
>> p->hv_limit = 0;
>> p->hv2_limit = 0;
>>
>> - /* TODO MSRs */
>> +#ifdef __XEN__
>> + /* TODO MSR_PLATFORM_INFO */
>> +
>> + if ( p->feat.arch_caps )
>> + rdmsrl(MSR_ARCH_CAPABILITIES, p->arch_caps.raw);
>> +#endif
> What about non-Xen environments re-using this code? In particular the
> test harnesses would be nice if they didn't run with the two fields
> all blank at all times.
Right now, I don't have an answer.
In Linux in lockdown mode, there isn't even a way to access this info
userspace, because /proc/cpu/$/msr goes away.
It's only a unit test, and this doesn't break it.
~Andrew
|