Skip to contentSkip to conversation

tools/symbols: drop asm/types.h inclusion

PATCH In review Jan Beulich 4 participants 7 messages Jan 20, 2023 – Feb 6, 2023 RISC-V

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 tools/symbols: drop asm/types.h inclusion

While this has been there forever, it's not clear to me what it was (thought to be) needed for. In fact, all three instances of the header already exclude their entire bodies when __ASSEMBLY__ was defined. Hence, with no other assembly files including this header, we can at the same time get rid of those conditionals.

xen/arch/arm/include/asm/types.h +0 -5
@@ -1,9 +1,6 @@
 #ifndef __ARM_TYPES_H__
 #define __ARM_TYPES_H__
 
-#ifndef __ASSEMBLY__
-
-
 typedef __signed__ char __s8;
 typedef unsigned char __u8;
 
@@ -54,8 +51,6 @@ typedef u64 register_t;
 #define PRIregister "016lx"
 #endif
 
-#endif /* __ASSEMBLY__ */
-
 #endif /* __ARM_TYPES_H__ */
 /*
  * Local variables:
xen/arch/riscv/include/asm/types.h +0 -4
@@ -1,8 +1,6 @@
 #ifndef __RISCV_TYPES_H__
 #define __RISCV_TYPES_H__
 
-#ifndef __ASSEMBLY__
-
 typedef __signed__ char __s8;
 typedef unsigned char __u8;
 
@@ -57,8 +55,6 @@ typedef u64 register_t;
 
 #endif
 
-#endif /* __ASSEMBLY__ */
-
 #endif /* __RISCV_TYPES_H__ */
 /*
  * Local variables:
xen/arch/x86/include/asm/types.h +0 -4
@@ -1,8 +1,6 @@
 #ifndef __X86_TYPES_H__
 #define __X86_TYPES_H__
 
-#ifndef __ASSEMBLY__
-
 typedef __signed__ char __s8;
 typedef unsigned char __u8;
 
@@ -32,6 +30,4 @@ typedef unsigned long paddr_t;
 #define INVALID_PADDR (~0UL)
 #define PRIpaddr "016lx"
 
-#endif /* __ASSEMBLY__ */
-
 #endif /* __X86_TYPES_H__ */
xen/tools/symbols.c +0 -1
@@ -302,7 +302,6 @@ static void write_src(void)
 		return;
 	}
 	printf("#include <xen/config.h>\n");
-	printf("#include <asm/types.h>\n");
 	printf("#if BITS_PER_LONG == 64 && !defined(SYMBOLS_ORIGIN)\n");
 	printf("#define PTR .quad\n");
 	printf("#define ALGN .align 8\n");
Acked-by on v1 1/1
#1 lore raw
Quoted 7 lines · Jan Beulich

While this has been there forever, it's not clear to me what it was (thought to be) needed for. In fact, all three instances of the header already exclude their entire bodies when __ASSEMBLY__ was defined. Hence, with no other assembly files including this header, we can at the same time get rid of those conditionals.

Acked-by on v1 1/1
#2 lore raw
In reply to Jan Beulich

Hi Jan,

Quoted 2 lines · Jan Beulich

While this has been there forever, it's not clear to me what it was (thought to be) needed for.

asm/types.h used to be directly included in assembly x86 file. This was dropped by commit 3f76e83c4cf6 "x86/entry: drop unused header inclusions".

Quoted 6 lines

In fact, all three instances of the header
already exclude their entire bodies when __ASSEMBLY__ was defined. Hence, with no other assembly files including this header, we can at the same time get rid of those conditionals.

Cheers,

Signature · 1 line
Julien Grall
#3 lore raw
Quoted 6 lines · Julien Grall
Quoted 2 lines · Jan Beulich

While this has been there forever, it's not clear to me what it was (thought to be) needed for.

asm/types.h used to be directly included in assembly x86 file. This was dropped by commit 3f76e83c4cf6 "x86/entry: drop unused header inclusions".

Just to clarify: The statement in the description is about $subject, not ...

Quoted 4 lines
Quoted 4 lines

In fact, all three instances of the header
already exclude their entire bodies when __ASSEMBLY__ was defined. Hence, with no other assembly files including this header, we can at the same time get rid of those conditionals.

... this further aspect. I can certainly see why the guards may have been there (without having gone look for when the last such use may have disappeared) beyond the bogus use by the tool.

Quoted 3 lines
Quoted 1 line

Thanks.

Jan

#4 lore raw
Quoted 11 lines · Jan Beulich
Quoted 6 lines · Julien Grall
Quoted 2 lines · Jan Beulich

While this has been there forever, it's not clear to me what it was (thought to be) needed for.

asm/types.h used to be directly included in assembly x86 file. This was dropped by commit 3f76e83c4cf6 "x86/entry: drop unused header inclusions".

Just to clarify: The statement in the description is about $subject, not ...

Quoted 8 lines
Quoted 4 lines
Quoted 4 lines

In fact, all three instances of the header
already exclude their entire bodies when __ASSEMBLY__ was defined. Hence, with no other assembly files including this header, we can at the same time get rid of those conditionals.

... this further aspect. I can certainly see why the guards may have been there (without having gone look for when the last such use may have disappeared) beyond the bogus use by the tool.

Ah! Thanks for the clarification. I indeed misinterpreted the first sentence.

Cheers,

Signature · 1 line
Julien Grall
#5 lore raw

Ping: [PATCH] tools/symbols: drop asm/types.h inclusion

In reply to Jan Beulich
Quoted 7 lines · Jan Beulich

While this has been there forever, it's not clear to me what it was (thought to be) needed for. In fact, all three instances of the header already exclude their entire bodies when __ASSEMBLY__ was defined. Hence, with no other assembly files including this header, we can at the same time get rid of those conditionals.

May I please ask for a RISC-V side ack (or otherwise) here?

Thanks, Jan

Quoted 70 lines
xen/arch/arm/include/asm/types.h +0 -5
@@ -1,9 +1,6 @@
 #ifndef __ARM_TYPES_H__
 #define __ARM_TYPES_H__
 
-#ifndef __ASSEMBLY__
-
-
 typedef __signed__ char __s8;
 typedef unsigned char __u8;
 
@@ -54,8 +51,6 @@ typedef u64 register_t;
 #define PRIregister "016lx"
 #endif
 
-#endif /* __ASSEMBLY__ */
-
 #endif /* __ARM_TYPES_H__ */
 /*
  * Local variables:
xen/arch/riscv/include/asm/types.h +0 -4
@@ -1,8 +1,6 @@
 #ifndef __RISCV_TYPES_H__
 #define __RISCV_TYPES_H__
 
-#ifndef __ASSEMBLY__
-
 typedef __signed__ char __s8;
 typedef unsigned char __u8;
 
@@ -57,8 +55,6 @@ typedef u64 register_t;
 
 #endif
 
-#endif /* __ASSEMBLY__ */
-
 #endif /* __RISCV_TYPES_H__ */
 /*
  * Local variables:
xen/arch/x86/include/asm/types.h +0 -4
@@ -1,8 +1,6 @@
 #ifndef __X86_TYPES_H__
 #define __X86_TYPES_H__
 
-#ifndef __ASSEMBLY__
-
 typedef __signed__ char __s8;
 typedef unsigned char __u8;
 
@@ -32,6 +30,4 @@ typedef unsigned long paddr_t;
 #define INVALID_PADDR (~0UL)
 #define PRIpaddr "016lx"
 
-#endif /* __ASSEMBLY__ */
-
 #endif /* __X86_TYPES_H__ */
xen/tools/symbols.c +0 -1
@@ -302,7 +302,6 @@ static void write_src(void)
 		return;
 	}
 	printf("#include <xen/config.h>\n");
-	printf("#include <asm/types.h>\n");
 	printf("#if BITS_PER_LONG == 64 && !defined(SYMBOLS_ORIGIN)\n");
 	printf("#define PTR .quad\n");
 	printf("#define ALGN .align 8\n");
Reviewed-by
#6 lore raw

Re: Ping: [PATCH] tools/symbols: drop asm/types.h inclusion

Quoted 9 lines · Jan Beulich
Quoted 7 lines · Jan Beulich

While this has been there forever, it's not clear to me what it was (thought to be) needed for. In fact, all three instances of the header already exclude their entire bodies when __ASSEMBLY__ was defined. Hence, with no other assembly files including this header, we can at the same time get rid of those conditionals.

Alistair

Quoted 77 lines

May I please ask for a RISC-V side ack (or otherwise) here?

Thanks, Jan

Quoted 70 lines
xen/arch/arm/include/asm/types.h +0 -5
@@ -1,9 +1,6 @@
 #ifndef __ARM_TYPES_H__
 #define __ARM_TYPES_H__
 
-#ifndef __ASSEMBLY__
-
-
 typedef __signed__ char __s8;
 typedef unsigned char __u8;
 
@@ -54,8 +51,6 @@ typedef u64 register_t;
 #define PRIregister "016lx"
 #endif
 
-#endif /* __ASSEMBLY__ */
-
 #endif /* __ARM_TYPES_H__ */
 /*
  * Local variables:
xen/arch/riscv/include/asm/types.h +0 -4
@@ -1,8 +1,6 @@
 #ifndef __RISCV_TYPES_H__
 #define __RISCV_TYPES_H__
 
-#ifndef __ASSEMBLY__
-
 typedef __signed__ char __s8;
 typedef unsigned char __u8;
 
@@ -57,8 +55,6 @@ typedef u64 register_t;
 
 #endif
 
-#endif /* __ASSEMBLY__ */
-
 #endif /* __RISCV_TYPES_H__ */
 /*
  * Local variables:
xen/arch/x86/include/asm/types.h +0 -4
@@ -1,8 +1,6 @@
 #ifndef __X86_TYPES_H__
 #define __X86_TYPES_H__
 
-#ifndef __ASSEMBLY__
-
 typedef __signed__ char __s8;
 typedef unsigned char __u8;
 
@@ -32,6 +30,4 @@ typedef unsigned long paddr_t;
 #define INVALID_PADDR (~0UL)
 #define PRIpaddr "016lx"
 
-#endif /* __ASSEMBLY__ */
-
 #endif /* __X86_TYPES_H__ */
xen/tools/symbols.c +0 -1
@@ -302,7 +302,6 @@ static void write_src(void)
              return;
      }
      printf("#include <xen/config.h>\n");
-     printf("#include <asm/types.h>\n");
      printf("#if BITS_PER_LONG == 64 && !defined(SYMBOLS_ORIGIN)\n");
      printf("#define PTR .quad\n");
      printf("#define ALGN .align 8\n");