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

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


  • To: Penny Zheng <Penny.Zheng@xxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxxx
  • From: Grygorii Strashko <grygorii_strashko@xxxxxxxx>
  • Date: Wed, 26 Nov 2025 23:44:32 +0200
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=epam.com; dmarc=pass action=none header.from=epam.com; dkim=pass header.d=epam.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=xaCpp4+7ZvJmSjmH+1MOhVwWuVQ1DaInOI89e3IvGAI=; b=bkbfY+frx1/f01mIyg82DhKnBenN24/heBK9gxGotUrhciTBw75TMAdI1fJLWVjeqzBTMd0se0GYZEENQGfp0PTqlmBxPXCX3EQQpj4XpOwWkln8J9v/Cz9asYNG4PTz6Y2RbhWZtYhwp+pGuZyPBzzoBA1CqXXadJOpfLzprfICKejaunc/aIPUDgEH8WelExG6TzWatknAk/ax+d23kt4eCbjYAaLzSBbRY7fPHSiyZouZ7b/0pxWdyihXMSIzidpvCMOgrwPGEi0ob5qNGD31PC1LNMGD4Yp3TNAXHkelZjWFE2eESvYQjo6NcaqfpZFGpzPjT8s0CWtC5Mb5AA==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=gLjNIukgz4ZTzv4wdWU5yx0Hd7lSx/SZjUJ7JFvDjoyfQrl+sNwVEpMs3rHAPtDCbgy6QtsWqBbvA4p9ntpeZcIP/FcNPXkXNUsuB2nRpO0co+2GDMm/wU4fzCLXoy+GoskLyOEfCZ5VQBTSZ0AldW50wBhUOx6c2SNAE6HdMjlNg5vINvmQr84XHEwF7hiK6fqauNBqVLWF9IN5emZIiPuahkdOamp75U4AeNURVrt8gQ6Xg7j2lHW1/2p1ANSIunHiPhO8v0MtRHy1UpgNJDdHQuH6ocIWM+Dza3Vc/iefx9xk4KXsY1pr2y7duMP4fVRNXCikCgKG/aqJxNwY3w==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=epam.com;
  • Cc: 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: Wed, 26 Nov 2025 21:45:01 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>



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.

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®.