Skip to contentSkip to conversation

xenoprof: move asm/ include

PATCH In review Jan Beulich 3 participants 4 messages Oct 30, 2023

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 xenoprof: move asm/ include

There's no need for xen/xenoprof.h to include the arch header when the respective config option is off. The only compensation needed is for svm.c to explicitly include the arch header instead of the common one (matching what vmx.c and traps.c do).

With that Arm's header can be deleted, and neither RISC-V nor PPC will need to introduce one.

While there also adjust and move the (prior) inclusion of inttypes.h.

xen/arch/arm/include/asm/xenoprof.h deleted +0 -12
@@ -1,12 +0,0 @@
-#ifndef __ASM_XENOPROF_H__
-#define __ASM_XENOPROF_H__
-
-#endif /* __ASM_XENOPROF_H__ */
-/*
- * Local variables:
- * mode: C
- * c-file-style: "BSD"
- * c-basic-offset: 4
- * indent-tabs-mode: nil
- * End:
- */
xen/arch/x86/hvm/svm/svm.c +1 -1
@@ -12,7 +12,6 @@
 #include <xen/lib.h>
 #include <xen/sched.h>
 #include <xen/trace.h>
-#include <xen/xenoprof.h>
 
 #include <asm/amd.h>
 #include <asm/apic.h>
@@ -38,6 +37,7 @@
 #include <asm/processor.h>
 #include <asm/p2m.h>
 #include <asm/x86_emulate.h>
+#include <asm/xenoprof.h>
 
 #include <public/sched.h>
 
xen/include/xen/xenoprof.h +3 -3
@@ -10,15 +10,15 @@
 #ifndef __XEN_XENOPROF_H__
 #define __XEN_XENOPROF_H__
 
-#include <xen/inttypes.h>
-#include <asm/xenoprof.h>
-
 #define PMU_OWNER_NONE          0
 #define PMU_OWNER_XENOPROF      1
 #define PMU_OWNER_HVM           2
 
 #ifdef CONFIG_XENOPROF
 
+#include <xen/stdint.h>
+#include <asm/xenoprof.h>
+
 struct domain;
 struct vcpu;
 struct cpu_user_regs;
#1 lore raw
Quoted 17 lines · Jan Beulich

There's no need for xen/xenoprof.h to include the arch header when the respective config option is off. The only compensation needed is for svm.c to explicitly include the arch header instead of the common one (matching what vmx.c and traps.c do).

With that Arm's header can be deleted, and neither RISC-V nor PPC will need to introduce one.

While there also adjust and move the (prior) inclusion of inttypes.h.

xen/arch/arm/include/asm/xenoprof.h deleted +0 -2
@@ -1,12 +0,0 @@
-#ifndef __ASM_XENOPROF_H__
-#define __ASM_XENOPROF_H__

xen/arch/arm/include/asm/xenoprof.h line 12

Quoted 10 lines
xen/arch/arm/include/asm/xenoprof.h deleted +0 -10
-
-#endif /* __ASM_XENOPROF_H__ */
-/*
- * Local variables:
- * mode: C
- * c-file-style: "BSD"
- * c-basic-offset: 4
- * indent-tabs-mode: nil
- * End:
- */

First time that I notice a shortcoming in quilt that I would not have run into if I used git: quilt can't express deletion of an empty file; arch/ppc/include/asm/xenoprof.h wants deleting as well.

Jan

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

Hi Jan,

Quoted 65 lines · Jan Beulich

There's no need for xen/xenoprof.h to include the arch header when the
respective config option is off. The only compensation needed is for svm.c to explicitly include the arch header instead of the common one (matching what vmx.c and traps.c do).

With that Arm's header can be deleted, and neither RISC-V nor PPC will
need to introduce one.

While there also adjust and move the (prior) inclusion of inttypes.h.

xen/arch/arm/include/asm/xenoprof.h deleted +0 -12
@@ -1,12 +0,0 @@
-#ifndef __ASM_XENOPROF_H__
-#define __ASM_XENOPROF_H__
-
-#endif /* __ASM_XENOPROF_H__ */
-/*
- * Local variables:
- * mode: C
- * c-file-style: "BSD"
- * c-basic-offset: 4
- * indent-tabs-mode: nil
- * End:
- */
xen/arch/x86/hvm/svm/svm.c +0 -1
@@ -12,7 +12,6 @@
  #include <xen/lib.h>
  #include <xen/sched.h>
  #include <xen/trace.h>
-#include <xen/xenoprof.h>


 #include <asm/amd.h>
 #include <asm/apic.h>

xen/arch/x86/hvm/svm/svm.c +1 -0
@@ -38,6 +37,7 @@
  #include <asm/processor.h>
  #include <asm/p2m.h>
  #include <asm/x86_emulate.h>
+#include <asm/xenoprof.h>


 #include <public/sched.h>

xen/include/xen/xenoprof.h +0 -0
@@ -10,15 +10,15 @@
  #ifndef __XEN_XENOPROF_H__
  #define __XEN_XENOPROF_H__

xen/include/xen/xenoprof.h +0 -3
-#include <xen/inttypes.h>
-#include <asm/xenoprof.h>
-

 #define PMU_OWNER_NONE          0
 #define PMU_OWNER_XENOPROF      1
 #define PMU_OWNER_HVM           2

 #ifdef CONFIG_XENOPROF

xen/include/xen/xenoprof.h +3 -0
+#include <xen/stdint.h>
+#include <asm/xenoprof.h>
+
Quoted 3 lines

 struct domain;
 struct vcpu;
 struct cpu_user_regs;

Looks good to me.

~ Oleksii

Reviewed-by on v1 1/1
#3 lore raw
In reply to Jan Beulich

Hi Jan,

Quoted 7 lines · Jan Beulich

There's no need for xen/xenoprof.h to include the arch header when the respective config option is off. The only compensation needed is for svm.c to explicitly include the arch header instead of the common one (matching what vmx.c and traps.c do).

Quoted 6 lines

With that Arm's header can be deleted, and neither RISC-V nor PPC will need to introduce one.

While there also adjust and move the (prior) inclusion of inttypes.h.

Always nice to remove a useless empty file :-)

For the arm part:

Cheers
Bertrand

Quoted 55 lines
xen/arch/arm/include/asm/xenoprof.h deleted +0 -12
@@ -1,12 +0,0 @@
-#ifndef __ASM_XENOPROF_H__
-#define __ASM_XENOPROF_H__
-
-#endif /* __ASM_XENOPROF_H__ */
-/*
- * Local variables:
- * mode: C
- * c-file-style: "BSD"
- * c-basic-offset: 4
- * indent-tabs-mode: nil
- * End:
- */
xen/arch/x86/hvm/svm/svm.c +1 -1
@@ -12,7 +12,6 @@
 #include <xen/lib.h>
 #include <xen/sched.h>
 #include <xen/trace.h>
-#include <xen/xenoprof.h>
 
 #include <asm/amd.h>
 #include <asm/apic.h>
@@ -38,6 +37,7 @@
 #include <asm/processor.h>
 #include <asm/p2m.h>
 #include <asm/x86_emulate.h>
+#include <asm/xenoprof.h>
 
 #include <public/sched.h>
 
xen/include/xen/xenoprof.h +3 -3
@@ -10,15 +10,15 @@
 #ifndef __XEN_XENOPROF_H__
 #define __XEN_XENOPROF_H__
 
-#include <xen/inttypes.h>
-#include <asm/xenoprof.h>
-
 #define PMU_OWNER_NONE          0
 #define PMU_OWNER_XENOPROF      1
 #define PMU_OWNER_HVM           2
 
 #ifdef CONFIG_XENOPROF
 
+#include <xen/stdint.h>
+#include <asm/xenoprof.h>
+
 struct domain;
 struct vcpu;
 struct cpu_user_regs;