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

Re: [PATCH 1/2] x86/cpuid: Infrastructure to support pseudo feature identifiers


  • To: Andrew Cooper <Andrew.Cooper3@xxxxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Wed, 5 Oct 2022 15:11:10 +0200
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.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=9S3L1ME6oQ7xAf2QeMd4hnxdZC/PG4RsY/PeNf2WK8A=; b=nd3VLgGlcEq631XqDruGJAwNFZnTqSfoYGK1yLvWhCbQ/PjQ36znMzbrogqHXWHXzby3AFO/aOvAPOMFlWDbs7nXJ72ULh1QQYGam+bA2Dah5J1WtIXcgxJrPEhV7MAfpT+1tbhny6rXpOIBdULnW16du7gP2dg0UeEa0RiN3p1ytQhHApr4RvE8+6ml9fK3TE0IGx4UBBYYIOM5XLlugPY9fF1dJkOdMY/1p8J4N7tzz0WHIGyj80XP+72ce5Sw6QkSAPmz8gfVsqiroKtaN+zr2yDaVyDiamLNlJssgJxuydYWuJY1kDL5Gh6RFbtYN0Jn0Xpj0G9cP7QDLkrTXQ==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=aUpW5/boUP9FgkrlT8fuQMcrTLqpEtorOCMjMXK7UiZBfEZwkOTOjD/KoHhRqP70y9iF+AP1oBh1eZPjCvfwNKAfpFYEl+8tDwTDUolTmlTjQjgLD7ZegDEkOD64QDuUrJunpKgvCk8YZWiRCyw4U5lqcp5HoVULZZa/Jf9Nw2CYspcxFq1ivHQqcJj208Y6tOTURfEfKbA8zmd9+ysaKOYFDfPKMASMLr4GWt563UqK2XvWSmkgmDXAWzPx1jiw5GHIQU6gMZ/Mjus9WGimOzIJYpRQs321R6oL61hDzJoosU1MYM7pXOK7glYAu0pwbvDcCZnTB/3osWN5PGmU7g==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
  • Cc: Roger Pau Monne <roger.pau@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, Henry Wang <Henry.Wang@xxxxxxx>, Marek Marczykowski-Górecki <marmarek@xxxxxxxxxxxxxxxxxxxxxx>, Demi Marie Obenour <demi@xxxxxxxxxxxxxxxxxxxxxx>, Xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • Delivery-date: Wed, 05 Oct 2022 13:11:22 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 05.10.2022 14:58, Andrew Cooper wrote:
> On 05/10/2022 07:59, Jan Beulich wrote:
>> On 04.10.2022 18:08, Andrew Cooper wrote:
>>> A future change will want a cpuid-like identifier which doesn't have a 
>>> mapping
>>> to a feature bit.
>>>
>>>  * Pass the feature name into the parse callback.
>>>  * Exclude a feature value of ~0u from falling into the general set/clear 
>>> bit
>>>    paths.
>>>  * In gen-cpuid.py, insert a placeholder to collect all the pseudo feature
>>>    names.
>> Hmm, I was envisioning this to be fitted into the existing model in a
>> less adhoc way: (parts of) MSRs holding feature bits aren't very different
>> from individual (pairs of) registers of CPUID output (in the case of
>> ARCH_CAPS there would be a perhaps just abstract mask limiting things to
>> the subset of bits which actually act as feature indicators). Hence I'd
>> have expected them to gain proper entries in the public interface
>> (cpufeatureset.h) and then be represented / processed the same way in
>> featuresets and policies. All that would be left out at this point would
>> be the exposing of the bit to guests (in patch 2, assuming the split into
>> two patches is then actually still warranted), integration into
>> guest_rdmsr(), and at least some of the tool stack side (xen-cpuid, for
>> example, could easily learn of such right away).
>>
>> However, since I'm pretty sure you've considered such an approach, I guess
>> I might be overlooking some caveat?
> 
> I have on multiple occasions considered putting MSR_ARCH_CAPS into the
> existing X86_FEATURE_* infrastructure.  In the future, it's likely the
> right course of action to take.
> 
> However, doing so now will break speculation safety for guests in some

Considering further text - s/speculation/migration/, I guess?

> cases.  The featureset API intended to be safe to treat as a regular
> bitmap, and this is how it is used in practice.
> 
> Honestly, I didn't imagine that we'd get bits like RSBA and RRSBA that
> need to be treated with opposite polarity to be levelled safely.
> 
> Even if we do end up putting MSR_ARCH_CAPS in X86_FEATURE_*, we still
> need to remove the featureset api (replaced by the cpu policy
> infrastructure and libx86) to retain migration safety.

Well, I didn't mean to suggest to put all of the feature-like bits there
right away. Just the one bit we're after would do for now. Afaict that
wouldn't affect migration safety, while it would allow doing things in
Xen in a more "natural" way.

Jan



 


Rackspace

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