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

RE: [PATCH v4 02/24] xen: consolidate cpuid library


  • To: Grygorii Strashko <grygorii_strashko@xxxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: "Penny, Zheng" <penny.zheng@xxxxxxx>
  • Date: Mon, 1 Dec 2025 06:34:02 +0000
  • Accept-language: en-US
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=amd.com; dmarc=pass action=none header.from=amd.com; dkim=pass header.d=amd.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=WIco463z03e4uitzfOUqQNtuIB11b1jc2qeI/q9jzpo=; b=SrtJ8nGdQHw0rqjmgq5hJrFw0wU8iV9cG6RwPbT5oUiX7srJNgpaiLF0ziYKkzyag7ohHKpzUYNr5E3I4/QWM760h6Q8j+KARXYrN3eJY8o5tnlLrhEa+nXC388CRNI3JO77NrN+QLrvUB+QQE02hFVTp3trHs9U8EFszQWJk2w9TMXy2dLeSLMnY0W4BU/lG3Zb3Xj7vdAFcv6riZYFJAkC+1OmB7f/A2wpYE7aAQwGUkJddJ8yGpuTZNxGUEHY2c2v3F8TexjhkcPsgflLu9FVAlG8Ji1LjZVPzCPv0UYUUv43ZhFSJ0K6xb5wWwrvx0cjD//kkAsU0lQhup1ckg==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=KbKHfDLd8+DuE6Ty5JaLG9SWpQMhURF3UheC9tRyJuU762tb5kmmgYHHylG7biQELOjjkOR64lA2Ep60eDuipCJFqkH0YH+EaiNJCpr1zysuT/jlhQfgAW97Kxe+rjTXb0YK67X5lxr/ftL4LZAgptLkW/qeNH5i7Pv2TRX1u7YuAwdt7hfMz3F8M5OrKqG2SMgTNb+CUqwezms2piQDMD4t7jyNMYrwublcLjakEuCPD5HSDJmNHFB/0ViFhV/JfQoxnudzRLs9ayQ03GqIGbCrBbZ5QIIOlYbs57xcu/rn+5RUW7821q58giNg93UFEULDQNS22Mf2jt2qjEKOiQ==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=amd.com;
  • Cc: "Huang, Ray" <Ray.Huang@xxxxxxx>, Jan Beulich <jbeulich@xxxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>, Anthony PERARD <anthony.perard@xxxxxxxxxx>, Juergen Gross <jgross@xxxxxxxx>
  • Delivery-date: Mon, 01 Dec 2025 06:34:14 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Msip_labels: MSIP_Label_f265efc6-e181-49d6-80f4-fae95cf838a0_Enabled=True;MSIP_Label_f265efc6-e181-49d6-80f4-fae95cf838a0_SiteId=3dd8961f-e488-4e60-8e11-a82d994e183d;MSIP_Label_f265efc6-e181-49d6-80f4-fae95cf838a0_SetDate=2025-12-01T06:33:54.0000000Z;MSIP_Label_f265efc6-e181-49d6-80f4-fae95cf838a0_Name=Open Source;MSIP_Label_f265efc6-e181-49d6-80f4-fae95cf838a0_ContentBits=3;MSIP_Label_f265efc6-e181-49d6-80f4-fae95cf838a0_Method=Privileged
  • Thread-index: AQHcWtXJjf66LsUGrE2uxhJqk+lJcbUFhgcAgAbbbtA=
  • Thread-topic: [PATCH v4 02/24] xen: consolidate cpuid library

[Public]

> -----Original Message-----
> From: Grygorii Strashko <grygorii_strashko@xxxxxxxx>
> Sent: Thursday, November 27, 2025 5:45 AM
> To: Penny, Zheng <penny.zheng@xxxxxxx>; xen-devel@xxxxxxxxxxxxxxxxxxxx
> Cc: Huang, Ray <Ray.Huang@xxxxxxx>; Jan Beulich <jbeulich@xxxxxxxx>;
> Andrew Cooper <andrew.cooper3@xxxxxxxxxx>; Roger Pau Monné
> <roger.pau@xxxxxxxxxx>; Anthony PERARD <anthony.perard@xxxxxxxxxx>; Juergen
> Gross <jgross@xxxxxxxx>
> Subject: Re: [PATCH v4 02/24] xen: consolidate cpuid library
>
>
>
> On 21.11.25 12:57, Penny Zheng wrote:
> > There are some cpuid library functions only referenced in
> > XEN_DOMCTL_get{,set}_cpu_policy-case, and shall be wrapped with
> > CONFIG_MGMT_HYPERCALLS later, otherwise they will become unreachable
> > when MGMT_HYPERCALLS=n, and hence violate Misra 2.1
> > - x86_cpu_policy_clear_out_of_range_leaves
> >    - zero_leaves
> > - x86_cpuid_copy_to_buffer
> >    - copy_leaf_to_buffer
> > - x86_cpuid_copy_from_buffer
> > We seperate these functions by moving other functions to a new file
> > named cpuid-generic.c, and modify related Makefile-s to retain same 
> > behavior.
> >
> > Signed-off-by: Penny Zheng <Penny.Zheng@xxxxxxx>
> > ---
> > v3 -> v4:
> > - new commit
> > ---
> >   tools/fuzz/cpu-policy/Makefile               |   2 +-
> >   tools/fuzz/x86_instruction_emulator/Makefile |  10 +-
> >   tools/libs/guest/Makefile.common             |   2 +-
> >   tools/tests/cpu-policy/Makefile              |   2 +-
> >   tools/tests/x86_emulator/Makefile            |   2 +-
> >   xen/lib/x86/Makefile                         |   1 +
> >   xen/lib/x86/cpuid-generic.c                  | 273 +++++++++++++++++++
> >   xen/lib/x86/cpuid.c                          | 260 ------------------
> >   8 files changed, 283 insertions(+), 269 deletions(-)
> >   create mode 100644 xen/lib/x86/cpuid-generic.c
>
> It seems this patch is not required prerequisite, at least definitely not for 
> Patch 3.
>

It is the pre-requisite for commit " xen/x86: wrap x86-specific domctl-op with 
CONFIG_MGMT_HYPERCALLS ", We want to guard new cpuid.o with MGMT_HYPERCALLS 
there. Without the split, fwis, I could not think a better way to avoid 
functions like x86_cpuid_copy_to{,from}_buffer becoming unreachable when 
MGMT_HYPERCALLS=n.

> In general, i think it can be removed from this series and sent as follow up 
> patch.
>
> --
> Best regards,
> -grygorii


 


Rackspace

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