[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: Fri, 3 Mar 2023 08:23:51 +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=J0UzuyRR8sdtDrQN2G11WCXyguBqD/LRcpMATfRQDbU=; b=DX1cRdPfq1NgLHsNeXZ1a5+yBjaEIRs4JaOpi+sMdztPL2KRZkCxaFJznyCaPurpj4TlLroO+phg/Awjh9S/nIsOO2giHmuKkYpSCs3ZuBlpTp0KIFy/foQnJtl1BjrqFqYS7TfF8lzdh09x6r2x/0O0myw0ef7eXcSxf17Tye86avYO8OWGeAtBRfN6481oYu2MyNvHzrWAVnCIkLJowZ/9oY63vwS0LEHZUOpqkjMtMUGcxr+jQfxdmJHDThrN4uQmlyaCaddqfz28l532DW41XOHCcSc8dtYBI1qBe8QhgcHcNpZRkJd2hWaL0X2OpUgQZ/DQPCsMDOf07TxjSQ==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=SCMrQ/VYUZfOjSLVk5nYSZNfbrmp3NdioUVT7y1zYk5/ct9hTEIIABsQ0uICLcglP2zpktISRrt/bZA3DOTPhqUk05TqdUCPc+KKsdR5WHwVXQAYt6/XXnLYPnTVCejitOkinOE5zi28jcHmyWyvvaxx/iiW1sQUDzrLOrEJKaHvMuObzI7SfNAPhGjO4YM4aVqTHDsFZqdSlE/bJZRVKOJjJP/jwXWkb56njZaGv+xpZT4dtTLRiFFi+rZsauQDAgPkPkJlq5UxG4ZWU+BexgUKE0Kr8HXhYqWK9QzLwZamsftVdpfRTO7Xo8MQhw08M3LSux+Tk9qKQ8pXWZfTEw==
  • 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: Fri, 03 Mar 2023 07:24:05 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 04.01.2023 12:11, Andrew Cooper wrote:
> --- 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 */

While committing the backports of this (where I normally test-build
every commit individually) I came to notice that this introduces a
transient (until the next commit) build breakage: FEATURESET_NR_ENTRIES
is calculated from the highest entry found; the comments here don't
matter at all. Therefore ...

> @@ -343,6 +352,8 @@ static inline void cpuid_policy_to_featureset(
>      fs[FEATURESET_e21a] = p->extd.e21a;
>      fs[FEATURESET_7b1] = p->feat._7b1;
>      fs[FEATURESET_7d2] = p->feat._7d2;
> +    fs[FEATURESET_7c1] = p->feat._7c1;
> +    fs[FEATURESET_7d1] = p->feat._7d1;
>  }
>  
>  /* Fill in a CPUID policy from a featureset bitmap. */
> @@ -363,6 +374,8 @@ static inline void cpuid_featureset_to_policy(
>      p->extd.e21a  = fs[FEATURESET_e21a];
>      p->feat._7b1  = fs[FEATURESET_7b1];
>      p->feat._7d2  = fs[FEATURESET_7d2];
> +    p->feat._7c1  = fs[FEATURESET_7c1];
> +    p->feat._7d1  = fs[FEATURESET_7d1];
>  }

... the compiler legitimately complains about out-of-bounds array
accesses here. This is just fyi for the future (to arrange patch
splitting differently); I've left the backports as they were.

Jan



 


Rackspace

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