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

[PATCH] x86: don't include processor.h from system.h


  • To: "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Thu, 16 Mar 2023 11:09:46 +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=F61rJ1VJqnbVyOmO0Vewtq+N4fnWO8vW7lTHIHqvJKk=; b=DVPgBaA11qD6Nh3dJV1Aduavx6oNCDg7velrE4ENZ5MFPrfGnrdtitBkCFIWAvDWueaY5ORqqv/pS88pAQbvAzGEob5jLC5g+fiHeuUBVyoApk9tjHhcTd0j7mLGSV6C60nGsphwdxi0spRkF1+cK3qZ/SypbE0x2Uw9DDcX7sO/d1G3ca17NIxAMQPiLnCXn2su/yROrj6hkIqlwUVEci8CxC5PfCWScLupj4wck4QTEM1X5Oc7yioyaYkWikEBFV2/XvlxtLlBImzticNxlfymqL5I71GC6Ud0p+kgoa2EDpyi7QavKslH5Kj1hvl64jS7NCTuSfhQ/NCwvUay/A==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=g3YezusTQ8bOl3QZd233UH7J2KKpJpKXTaTj1B0rvm/vSwhwI6AEpnxmrgn9bwLVbDFyIyz/SOdcmJVOfTx/dVLfjpv3/+L+4hAC4MZ2QqsEcgLVSmPvC1TUA6m+6Tx5AiPGrbvd+zDCvLrDb2SD9fBWasD488/he8cdUe5ITocCrfQD87Hk3l84dbEYvlM2iUhSynoBPWIpp8ePJgVX22UFpz54ftXVBZHOSNMPxv2kGNX+U9YHvP90emUjvJSBfbv6gUwxcdvN6veW1NJ4p96XL+QbqZOkeBA/AdMoa1kIGrLIlUn663Tj6w5aFcFPrDMwI+lH81uU4jKTsbCrFQ==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
  • Cc: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>, Oleksii Kurochko <oleksii.kurochko@xxxxxxxxx>
  • Delivery-date: Thu, 16 Mar 2023 10:10:02 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

processor.h in particular pulls in xen/smp.h, which is overly heavy for
a supposedly pretty fundamental header like system.h. To keep things
building, move the declarations of struct cpuinfo_x86 and boot_cpu_data
to asm/cpufeature.h (which arguably also is where they belong). In the
course of the move switch away from using fixed-width types and convert
plain "int" to "unsigned int" for the two x86_cache_* fields.

Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>

--- a/xen/arch/x86/include/asm/cpufeature.h
+++ b/xen/arch/x86/include/asm/cpufeature.h
@@ -19,6 +19,30 @@
 #ifndef __ASSEMBLY__
 #include <xen/bitops.h>
 
+struct cpuinfo_x86 {
+    unsigned char x86;                 /* CPU family */
+    unsigned char x86_vendor;          /* CPU vendor */
+    unsigned char x86_model;
+    unsigned char x86_mask;
+    int cpuid_level;                   /* Maximum supported CPUID level, -1=no 
CPUID */
+    unsigned int extended_cpuid_level; /* Maximum supported CPUID extended 
level */
+    unsigned int x86_capability[NCAPINTS];
+    char x86_vendor_id[16];
+    char x86_model_id[64];
+    unsigned int x86_cache_size;       /* in KB - valid only when supported */
+    unsigned int x86_cache_alignment;  /* In bytes */
+    unsigned int x86_max_cores;        /* cpuid returned max cores value */
+    unsigned int booted_cores;         /* number of cores as seen by OS */
+    unsigned int x86_num_siblings;     /* cpuid logical cpus per chip value */
+    unsigned int apicid;
+    unsigned int phys_proc_id;         /* package ID of each logical CPU */
+    unsigned int cpu_core_id;          /* core ID of each logical CPU */
+    unsigned int compute_unit_id;      /* AMD compute unit ID of each logical 
CPU */
+    unsigned short x86_clflush_size;
+} __cacheline_aligned;
+
+extern struct cpuinfo_x86 boot_cpu_data;
+
 #define cpu_has(c, bit)                test_bit(bit, (c)->x86_capability)
 #define boot_cpu_has(bit)      test_bit(bit, boot_cpu_data.x86_capability)
 
--- a/xen/arch/x86/include/asm/processor.h
+++ b/xen/arch/x86/include/asm/processor.h
@@ -118,34 +118,6 @@ struct x86_cpu_id {
     const void *driver_data;
 };
 
-struct cpuinfo_x86 {
-    uint8_t x86;            /* CPU family */
-    uint8_t x86_vendor;     /* CPU vendor */
-    uint8_t x86_model;
-    uint8_t x86_mask;
-    int  cpuid_level;    /* Maximum supported CPUID level, -1=no CPUID */
-    uint32_t extended_cpuid_level; /* Maximum supported CPUID extended level */
-    unsigned int x86_capability[NCAPINTS];
-    char x86_vendor_id[16];
-    char x86_model_id[64];
-    int  x86_cache_size; /* in KB - valid for CPUS which support this call  */
-    int  x86_cache_alignment;    /* In bytes */
-    uint32_t x86_max_cores;   /* cpuid returned max cores value */
-    uint32_t booted_cores;    /* number of cores as seen by OS */
-    uint32_t x86_num_siblings; /* cpuid logical cpus per chip value */
-    uint32_t apicid;
-    uint32_t phys_proc_id;    /* package ID of each logical CPU */
-    uint32_t cpu_core_id;     /* core ID of each logical CPU */
-    uint32_t compute_unit_id; /* AMD compute unit ID of each logical CPU */
-    unsigned short x86_clflush_size;
-} __cacheline_aligned;
-
-/*
- * capabilities of CPUs
- */
-
-extern struct cpuinfo_x86 boot_cpu_data;
-
 extern struct cpuinfo_x86 cpu_data[];
 #define current_cpu_data cpu_data[smp_processor_id()]
 
--- a/xen/arch/x86/include/asm/system.h
+++ b/xen/arch/x86/include/asm/system.h
@@ -3,7 +3,8 @@
 
 #include <xen/lib.h>
 #include <xen/bitops.h>
-#include <asm/processor.h>
+#include <asm/cpufeature.h>
+#include <asm/x86-defns.h>
 
 static inline void wbinvd(void)
 {



 


Rackspace

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