[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 08:59:28 +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=+lWY4fn9XkISJ5SD1K0i8GPSX23z5iFJTd7AaHj66C0=; b=DEkyZIPOqF4VVKEX8Ib6zCAmLi7UD+/dgokOxwZx0EYMr6bR4s2AcurdSTijakItEknthrTnDGw3KXoHIYD0NmN2PIdgIBRHaVO2JgsAa25WII47Ms+dmTor7a1jNRlW8lp5PZmpaj2XnwdlwKaaT7Fvw0mlbR2kN5is30UjzAW9LIEbZkF3FyrS1Ib0mlA4sBdKBEz5QFSwaQYSiEQeue2RyIY9Nj1tVXtq8Yst55tcrCg3sOV8rkBOA18G63/qnLP2X8LGXm0bCFQA5/eVaUeMigtsG8ZWORs/+5Wp6RVnDSKEsRRHrBuYQebxGKPBDczeNe+Uydi6O+El9wEb/A==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=LraRoAvs/dQDK9qQIgiEgE1F72ZIQ/hWLhUKM0GZCNyyFPOkExoMV/ectFvNyCzfqFMEhLtUNXk3vik4G3hXVMspKJ6QLaiD+dG5sxhucmI012r18IbxWZKsh0gZqMVcBgfMyaUmKXIGNUX2cXjEg3HBakY7fONm+2lTB6tqqrrWEGDkkFPklJvzCuKARLXhXCrx/8LgkY0Q5W5sxv05H1pF8KHpBcKIP1ysB/+/BJ6vDrXPzj81oUtDRwLtYpGhrxS1c0pxYFR1vkG8bGZoeBXWJ56XZ+JRMf3y4u/JhkxBuGqdSc6rstjTziEwKQtAKq6+lFDuqqMdjOEMAd5OMg==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
  • Cc: Roger Pau Monné <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 06:59:44 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

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?

> --- a/xen/tools/gen-cpuid.py
> +++ b/xen/tools/gen-cpuid.py
> @@ -297,6 +297,19 @@ def crunch_numbers(state):
>          RTM: [TSXLDTRK],
>      }
>  
> +    #
> +    # Pseudo feature names.  These don't map to a feature bit, but are
> +    # inserted into the values dictionary so they can be parsed and handled
> +    # specially
> +    #
> +    pseduo_names = (
> +    )
> +
> +    for n in pseduo_names:
> +        if n in state.values:
> +            raise Fail("Pseduo feature name %s aliases real feature" % (n, ))
> +        state.values[n] = 0xffffffff

Throughout this hunk: s/pseduo/pseudo/g.

Jan



 


Rackspace

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