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

Re: [PATCH 1/2] x86/cpuid: Infrastructure for leaves 7:1{ecx,edx}


  • To: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Wed, 4 Jan 2023 15:35:28 +0100
  • 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=KSdnEC4H8uuzngem4U0xCx9Q9CnYDPx8Fuv7+TTrdUE=; b=gbJsV5NDu+XPYCZG8w2NKcgxS3JaRlLkB+d2AM7oDcSNxIt7lUaffGiPDA4bMumdHGrfAN/bY0ULkHINBQWo9p8BcnJqRNeTQvBmWormc+QreoyxFYga8a30dt0do6Oo80M8OCsgpRuWWKk4qZDNnFWbd0924QfzgtBn5xIXTbmp4/DdNoq0VIDGlAxz+Q8fixme8eb9m3BcXiDmzys6XdaP03A0cnnzOcq30GKI1mzxKWYqSbfApjShO88ii0QJq4biBC/c7yG3EzAJkjyvuz3VCOsos1M6bT13dj8Nc/gNfJLiJMoMZ8bFSDIsSimdLcN3cnpy0FzwZrQUACCS0w==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=RWhIRKcMsrRSFxT20nxy5pJ+TmXM6ob/S50ssBFPkAnzP+UsmWPoLXIZD9/aTimxf6ZtMqRGF1+JBPr4JJLVQTrtGQv7fIrTngqTXVV3oOtbAfCwFx8hn1RM1VQnNyFkQlIl1zl4BoBiioZO1U3Ea6hqUeDTYyCP4F+dgKqt+PpSJ0FadW2A+MshxzwxpNYAjcEhoheyEbDmhSdMkE07Ar0MBkrWALrtN+xgiPrhnC0zlBm67g7YpGI7LPNlSsI/SDFx6gvHS99K6JmJeGqZN6vLjQDV8egwIFWSVJEgkAtTsER5pGODn7OxFRkcCEC8xavzRvIqQtpqrjuipdILPA==
  • 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>, Xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • Delivery-date: Wed, 04 Jan 2023 14:35:50 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 04.01.2023 12:11, Andrew Cooper wrote:
> We don't actually need ecx yet, but adding it in now will reduce the amount to
> which leaf 7 is out of order in a featureset.
> 
> cpufeatureset.h remains in leaf architectrual order for the sanity of anyone
> trying to locate where to insert new rows.
> 
> Signed-off-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>

Reviewed-by: Jan Beulich <jbeulich@xxxxxxxx>
albeit ...

> --- a/xen/include/public/arch-x86/cpufeatureset.h
> +++ b/xen/include/public/arch-x86/cpufeatureset.h
> @@ -288,6 +288,9 @@ XEN_CPUFEATURE(NSCB,               11*32+ 6) /*A  Null 
> Selector Clears Base (and
>  /* Intel-defined CPU features, CPUID level 0x00000007:1.ebx, word 12 */
>  XEN_CPUFEATURE(INTEL_PPIN,         12*32+ 0) /*   Protected Processor 
> Inventory Number */
>  
> +/* Intel-defined CPU features, CPUID level 0x00000007:1.ecx, word 14 */
> +/* Intel-defined CPU features, CPUID level 0x00000007:1.edx, word 15 */
> +

... I'm not convinced getting these ordered by other than their word indexes
is quite reasonable. We can't really predict in what order elements / leaves
get populated, as can best be seen from ...

>  /* Intel-defined CPU features, CPUID level 0x00000007:2.edx, word 13 */
>  XEN_CPUFEATURE(INTEL_PSFD,         13*32+ 0) /*A  MSR_SPEC_CTRL.PSFD */
>  XEN_CPUFEATURE(IPRED_CTRL,         13*32+ 1) /*   MSR_SPEC_CTRL.IPRED_DIS_* 
> */

... subleaf 2 already having one entry, and that one not being eax, ebx,
nor ecx, but edx. AMD (extended) leaves would also always be sprinkled into
the middle of any such sequence. To me it ends up more confusing (perhaps
not right away, but in a couple of years time) if one needs to go hunt for
what the next free index value would be. Similarly the need to re-base stuff
using non-upstream index values (like is the case for the KeyLocker leaves
that I have pending locally) is easier to notice when new sets are put at
the end of the existing list.

In any event, what I'd like to ask for as a minimum is that you insert a
blank line between the two new comments.

Jan



 


Rackspace

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