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

[PATCH v2 2/3] treewide: Avoid including asm/types.h


  • To: Xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
  • Date: Tue, 27 Jun 2023 08:56:17 +0100
  • Authentication-results: esa4.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none
  • Cc: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Jan Beulich <JBeulich@xxxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>, Bertrand Marquis <bertrand.marquis@xxxxxxx>, Bob Eshleman <bobbyeshleman@xxxxxxxxx>, Alistair Francis <alistair.francis@xxxxxxx>, Connor Davis <connojdavis@xxxxxxxxx>, "Oleksii Kurochko" <oleksii.kurochko@xxxxxxxxx>, Shawn Anastasio <sanastasio@xxxxxxxxxxxxxxxxxxxxx>, Timothy Pearson <tpearson@xxxxxxxxxxxxxxxxxxxxx>
  • Delivery-date: Tue, 27 Jun 2023 07:56:43 +0000
  • Ironport-data: A9a23:YpLqrqjc6qMw0z17sc7c9YAuX161YBcKZh0ujC45NGQN5FlHY01je htvWWqHbPneYDHwet52PYm2oUkG78LdnNMxTgU5qX9hQyob9cadCdqndUqhZCn6wu8v7q5Ex 55HNoSfdpBcolv0/ErF3m3J9CEkvU2wbuOgTrWCYmYpHlUMpB4J0XpLg/Q+jpNjne+3CgaMv cKai8DEMRqu1iUc3lg8sspvkzsx+qyr0N8klgZmP6sT4gWBzyB94K83fsldEVOpGuG4IcbiL wrz5OnR1n/U+R4rFuSknt7TGqHdauePVeQmoiM+t5mK2nCulARrukoIHKN0hXNsoyeIh7hMJ OBl7vRcf+uL0prkw4zxWzEAe8130DYvFLXveRBTuuTLp6HKnueF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/8jvO2z4JnIs1fNC2jRzyW5nlIeBFqAeEnWnVx+4Jk
  • Ironport-hdrordr: A9a23:GoMyK6vWN7l6iQQ81LNKJ8rN7skDYdV00zEX/kB9WHVpm6uj9/ xG/c576faQsl16ZJhOo6HjBED+ewK4yXcY2+Qs1NSZMjUO2lHYT72KhLGKqwEIcBeQygcy78 tdmqFFebnNMWQ=
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

We're about to rearrange the common and arch types.h split.  While most
users already include <xen/types.h>, a few do not and some files fail to
compile as a result.

Almost all logic is going to have types very early in the include chain.  Drop
the include entirely from C files, and swap to the common types.h in headers.

No functional change.

Signed-off-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
---
CC: Jan Beulich <JBeulich@xxxxxxxx>
CC: Roger Pau Monné <roger.pau@xxxxxxxxxx>
CC: Wei Liu <wl@xxxxxxx>
CC: Stefano Stabellini <sstabellini@xxxxxxxxxx>
CC: Julien Grall <julien@xxxxxxx>
CC: Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>
CC: Bertrand Marquis <bertrand.marquis@xxxxxxx>
CC: Bob Eshleman <bobbyeshleman@xxxxxxxxx>
CC: Alistair Francis <alistair.francis@xxxxxxx>
CC: Connor Davis <connojdavis@xxxxxxxxx>
CC: Oleksii Kurochko <oleksii.kurochko@xxxxxxxxx>
CC: Shawn Anastasio <sanastasio@xxxxxxxxxxxxxxxxxxxxx>
CC: Timothy Pearson <tpearson@xxxxxxxxxxxxxxxxxxxxx>
---

v2: New

 xen/arch/arm/arm64/lib/find_next_bit.c      | 2 +-
 xen/arch/x86/cpu/mcheck/mce.h               | 1 -
 xen/arch/x86/cpu/vpmu.c                     | 1 -
 xen/arch/x86/cpu/vpmu_intel.c               | 1 -
 xen/arch/x86/hvm/hvm.c                      | 1 -
 xen/arch/x86/hvm/vmx/vvmx.c                 | 1 -
 xen/arch/x86/include/asm/byteorder.h        | 2 +-
 xen/arch/x86/include/asm/hvm/svm/svmdebug.h | 2 +-
 xen/arch/x86/include/asm/hvm/vmx/vmx.h      | 3 ++-
 xen/arch/x86/include/asm/io_apic.h          | 3 ++-
 xen/arch/x86/include/asm/page.h             | 2 +-
 xen/arch/x86/include/asm/processor.h        | 1 -
 xen/arch/x86/include/asm/x86_64/page.h      | 2 +-
 xen/arch/x86/mm/p2m-ept.c                   | 1 -
 xen/common/trace.c                          | 1 -
 xen/drivers/char/arm-uart.c                 | 2 +-
 xen/include/xen/bitops.h                    | 2 +-
 xen/include/xen/spinlock.h                  | 3 ++-
 18 files changed, 13 insertions(+), 18 deletions(-)

diff --git a/xen/arch/arm/arm64/lib/find_next_bit.c 
b/xen/arch/arm/arm64/lib/find_next_bit.c
index 8ebf8bfe973c..ca6f82277e77 100644
--- a/xen/arch/arm/arm64/lib/find_next_bit.c
+++ b/xen/arch/arm/arm64/lib/find_next_bit.c
@@ -9,7 +9,7 @@
  * 2 of the License, or (at your option) any later version.
  */
 #include <xen/bitops.h>
-#include <asm/types.h>
+
 #include <asm/byteorder.h>
 
 #ifndef find_next_bit
diff --git a/xen/arch/x86/cpu/mcheck/mce.h b/xen/arch/x86/cpu/mcheck/mce.h
index bea08bdc7464..dd5d258362e6 100644
--- a/xen/arch/x86/cpu/mcheck/mce.h
+++ b/xen/arch/x86/cpu/mcheck/mce.h
@@ -7,7 +7,6 @@
 #include <xen/sched.h>
 #include <xen/smp.h>
 
-#include <asm/types.h>
 #include <asm/traps.h>
 #include <asm/atomic.h>
 
diff --git a/xen/arch/x86/cpu/vpmu.c b/xen/arch/x86/cpu/vpmu.c
index f31c32bcf3a6..a022126f18fd 100644
--- a/xen/arch/x86/cpu/vpmu.c
+++ b/xen/arch/x86/cpu/vpmu.c
@@ -14,7 +14,6 @@
 #include <xen/hypercall.h>
 #include <xen/sched.h>
 #include <asm/regs.h>
-#include <asm/types.h>
 #include <asm/msr.h>
 #include <asm/nmi.h>
 #include <asm/p2m.h>
diff --git a/xen/arch/x86/cpu/vpmu_intel.c b/xen/arch/x86/cpu/vpmu_intel.c
index 35e350578b84..ab122b22f3ac 100644
--- a/xen/arch/x86/cpu/vpmu_intel.c
+++ b/xen/arch/x86/cpu/vpmu_intel.c
@@ -12,7 +12,6 @@
 #include <xen/xenoprof.h>
 #include <asm/system.h>
 #include <asm/regs.h>
-#include <asm/types.h>
 #include <asm/apic.h>
 #include <asm/traps.h>
 #include <asm/msr.h>
diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c
index a67ef79dc003..57363c2ae124 100644
--- a/xen/arch/x86/hvm/hvm.c
+++ b/xen/arch/x86/hvm/hvm.c
@@ -38,7 +38,6 @@
 #include <asm/regs.h>
 #include <asm/cpufeature.h>
 #include <asm/processor.h>
-#include <asm/types.h>
 #include <asm/msr.h>
 #include <asm/i387.h>
 #include <asm/xstate.h>
diff --git a/xen/arch/x86/hvm/vmx/vvmx.c b/xen/arch/x86/hvm/vmx/vvmx.c
index 1034534c977b..16b0ef82b6c8 100644
--- a/xen/arch/x86/hvm/vmx/vvmx.c
+++ b/xen/arch/x86/hvm/vmx/vvmx.c
@@ -10,7 +10,6 @@
 
 #include <xen/ioreq.h>
 
-#include <asm/types.h>
 #include <asm/mtrr.h>
 #include <asm/p2m.h>
 #include <asm/hvm/support.h>
diff --git a/xen/arch/x86/include/asm/byteorder.h 
b/xen/arch/x86/include/asm/byteorder.h
index 1f77e502a528..e935f7b2b03b 100644
--- a/xen/arch/x86/include/asm/byteorder.h
+++ b/xen/arch/x86/include/asm/byteorder.h
@@ -1,7 +1,7 @@
 #ifndef __ASM_X86_BYTEORDER_H__
 #define __ASM_X86_BYTEORDER_H__
 
-#include <asm/types.h>
+#include <xen/types.h>
 #include <xen/compiler.h>
 
 static inline __attribute_const__ __u32 ___arch__swab32(__u32 x)
diff --git a/xen/arch/x86/include/asm/hvm/svm/svmdebug.h 
b/xen/arch/x86/include/asm/hvm/svm/svmdebug.h
index f1cde676dca1..2fb76ec24c76 100644
--- a/xen/arch/x86/include/asm/hvm/svm/svmdebug.h
+++ b/xen/arch/x86/include/asm/hvm/svm/svmdebug.h
@@ -8,7 +8,7 @@
 #ifndef __ASM_X86_HVM_SVM_SVMDEBUG_H__
 #define __ASM_X86_HVM_SVM_SVMDEBUG_H__
 
-#include <asm/types.h>
+#include <xen/types.h>
 #include <asm/hvm/svm/vmcb.h>
 
 void svm_sync_vmcb(struct vcpu *v, enum vmcb_sync_state new_state);
diff --git a/xen/arch/x86/include/asm/hvm/vmx/vmx.h 
b/xen/arch/x86/include/asm/hvm/vmx/vmx.h
index 36c108d8797d..c84acc221daa 100644
--- a/xen/arch/x86/include/asm/hvm/vmx/vmx.h
+++ b/xen/arch/x86/include/asm/hvm/vmx/vmx.h
@@ -8,7 +8,8 @@
 #define __ASM_X86_HVM_VMX_VMX_H__
 
 #include <xen/sched.h>
-#include <asm/types.h>
+#include <xen/types.h>
+
 #include <asm/regs.h>
 #include <asm/asm_defns.h>
 #include <asm/processor.h>
diff --git a/xen/arch/x86/include/asm/io_apic.h 
b/xen/arch/x86/include/asm/io_apic.h
index ef0878b09e24..bd8cb95f46b1 100644
--- a/xen/arch/x86/include/asm/io_apic.h
+++ b/xen/arch/x86/include/asm/io_apic.h
@@ -1,7 +1,8 @@
 #ifndef __ASM_IO_APIC_H
 #define __ASM_IO_APIC_H
 
-#include <asm/types.h>
+#include <xen/types.h>
+
 #include <asm/mpspec.h>
 #include <asm/apicdef.h>
 #include <asm/fixmap.h>
diff --git a/xen/arch/x86/include/asm/page.h b/xen/arch/x86/include/asm/page.h
index b585235d064a..3647bb1260c2 100644
--- a/xen/arch/x86/include/asm/page.h
+++ b/xen/arch/x86/include/asm/page.h
@@ -9,7 +9,7 @@
 #define PAGE_ORDER_1G       18
 
 #ifndef __ASSEMBLY__
-# include <asm/types.h>
+# include <xen/types.h>
 # include <xen/lib.h>
 #endif
 
diff --git a/xen/arch/x86/include/asm/processor.h 
b/xen/arch/x86/include/asm/processor.h
index f983ff501d95..3b3cf51814f8 100644
--- a/xen/arch/x86/include/asm/processor.h
+++ b/xen/arch/x86/include/asm/processor.h
@@ -9,7 +9,6 @@
 #include <xen/types.h>
 #include <xen/smp.h>
 #include <xen/percpu.h>
-#include <asm/types.h>
 #include <asm/cpufeature.h>
 #include <asm/desc.h>
 #endif
diff --git a/xen/arch/x86/include/asm/x86_64/page.h 
b/xen/arch/x86/include/asm/x86_64/page.h
index 26bdb4b19bb9..53faa7875baf 100644
--- a/xen/arch/x86/include/asm/x86_64/page.h
+++ b/xen/arch/x86/include/asm/x86_64/page.h
@@ -19,7 +19,7 @@ static inline unsigned long canonicalise_addr(unsigned long 
addr)
         return addr & ~CANONICAL_MASK;
 }
 
-#include <asm/types.h>
+#include <xen/types.h>
 
 #include <xen/pdx.h>
 
diff --git a/xen/arch/x86/mm/p2m-ept.c b/xen/arch/x86/mm/p2m-ept.c
index ffd34a1cc65f..85c4e8e54f66 100644
--- a/xen/arch/x86/mm/p2m-ept.c
+++ b/xen/arch/x86/mm/p2m-ept.c
@@ -11,7 +11,6 @@
 #include <asm/current.h>
 #include <asm/iocap.h>
 #include <asm/paging.h>
-#include <asm/types.h>
 #include <asm/domain.h>
 #include <asm/p2m.h>
 #include <asm/hvm/vmx/vmx.h>
diff --git a/xen/common/trace.c b/xen/common/trace.c
index df4a719e4b43..17d62f70561f 100644
--- a/xen/common/trace.c
+++ b/xen/common/trace.c
@@ -16,7 +16,6 @@
  * it's possible to reconstruct a chronological record of trace events.
  */
 
-#include <asm/types.h>
 #include <asm/io.h>
 #include <xen/lib.h>
 #include <xen/param.h>
diff --git a/xen/drivers/char/arm-uart.c b/xen/drivers/char/arm-uart.c
index eeb9ceefc06a..8098a968c285 100644
--- a/xen/drivers/char/arm-uart.c
+++ b/xen/drivers/char/arm-uart.c
@@ -18,7 +18,7 @@
  */
 
 #include <asm/device.h>
-#include <asm/types.h>
+
 #include <xen/console.h>
 #include <xen/device_tree.h>
 #include <xen/param.h>
diff --git a/xen/include/xen/bitops.h b/xen/include/xen/bitops.h
index 33619a0873fe..4cd0310789b5 100644
--- a/xen/include/xen/bitops.h
+++ b/xen/include/xen/bitops.h
@@ -1,6 +1,6 @@
 #ifndef _LINUX_BITOPS_H
 #define _LINUX_BITOPS_H
-#include <asm/types.h>
+#include <xen/types.h>
 
 /*
  * Create a contiguous bitmask starting at bit position @l and ending at
diff --git a/xen/include/xen/spinlock.h b/xen/include/xen/spinlock.h
index ca40c71c88f9..0a02a527dc59 100644
--- a/xen/include/xen/spinlock.h
+++ b/xen/include/xen/spinlock.h
@@ -2,9 +2,10 @@
 #define __SPINLOCK_H__
 
 #include <xen/time.h>
+#include <xen/types.h>
+
 #include <asm/system.h>
 #include <asm/spinlock.h>
-#include <asm/types.h>
 
 #define SPINLOCK_CPU_BITS  12
 
-- 
2.30.2




 


Rackspace

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