Skip to contentSkip to conversation

xen: remove struct domain and vcpu declarations from types.h

PATCH In review Wei Liu 3 participants 4 messages Aug 10, 2017 – Aug 11, 2017

lore
Share & tools
lore

Wei Liu

author
#0 lore raw

PATCH v2 1/1 xen: remove struct domain and vcpu declarations from types.h

They don't belong there. Removing them causes build errors in several places. Add the forward declarations in those places.

---
Cc: Andrew Cooper <[email protected]>
Cc: George Dunlap <[email protected]>
Cc: Ian Jackson <[email protected]>
Cc: Jan Beulich <[email protected]>
Cc: Konrad Rzeszutek Wilk <[email protected]>
Cc: Stefano Stabellini <[email protected]>
Cc: Tim Deegan <[email protected]>
Cc: Wei Liu <[email protected]>
Cc: Julien Grall <[email protected]>

---
 xen/include/asm-arm/processor.h | 1 +
 xen/include/asm-x86/xenoprof.h  | 2 ++
 xen/include/xen/compat.h        | 1 +
 xen/include/xen/types.h         | 3 ---
 4 files changed, 4 insertions(+), 3 deletions(-)
xen/include/asm-arm/processor.h +1 -0
index 855ded1b07..ab5225fa6c 100644
@@ -699,6 +699,7 @@ void show_registers(struct cpu_user_regs *regs);
 
 void noreturn do_unexpected_trap(const char *msg, struct cpu_user_regs *regs);
 
+struct vcpu;
 void vcpu_regs_hyp_to_user(const struct vcpu *vcpu,
                            struct vcpu_guest_core_regs *regs);
 void vcpu_regs_user_to_hyp(struct vcpu *vcpu,
xen/include/asm-x86/xenoprof.h +2 -0
index 3a1b001edb..1d2464804a 100644
@@ -68,6 +68,8 @@ void passive_domain_destroy(struct vcpu *v);
 
 #else
 
+struct vcpu;
+
 static inline int passive_domain_do_rdmsr(unsigned int msr,
                                           uint64_t *msr_content)
 {
xen/include/xen/compat.h +1 -0
index ce6245c10f..895e2ff68d 100644
@@ -227,6 +227,7 @@ void xlat_start_info(struct start_info *, enum XLAT_start_info_console);
 struct vcpu_runstate_info;
 void xlat_vcpu_runstate_info(struct vcpu_runstate_info *);
 
+struct domain;
 int switch_compat(struct domain *);
 
 #else
xen/include/xen/types.h +0 -3
index 170e993558..b1dbb8720a 100644
@@ -42,9 +42,6 @@ typedef         __s32           int32_t;
 typedef         __u64           uint64_t;
 typedef         __s64           int64_t;
 
-struct domain;
-struct vcpu;
-
 typedef __u16 __le16;
 typedef __u16 __be16;
 typedef __u32 __le32;
Signature · 7 lines
2.11.0


_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel
#1 lore raw

xen/include/asm-x86/xenoprof.h void passive_domain_destroy(struct vcpu *v); · line 71

Quoted 8 lines
Quoted 1 line
Quoted 1 line · On 10.08.17 at 19:22, <[email protected]> wrote:
xen/include/asm-x86/xenoprof.h +1 -0
@@ -68,6 +68,8 @@ void passive_domain_destroy(struct vcpu *v);
 
 #else
 
+struct vcpu;

There already is a forward declaration in this header - I'd suggest moving that one up (outside the #if) instead of adding a 2nd one. With that feel free to re-add the ack I had given on v1.

Jan

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel

author
#2 lore raw
Quoted 5 lines · Jan Beulich
Quoted 5 lines
Quoted 1 line
Quoted 1 line · On 10.08.17 at 19:22, <[email protected]> wrote:
xen/include/asm-x86/xenoprof.h +0 -0
@@ -68,6 +68,8 @@ void passive_domain_destroy(struct vcpu *v);
 
Quoted 8 lines

xen/include/asm-x86/xenoprof.h void passive_domain_destroy(struct vcpu *v); · line 71

Quoted 3 lines
xen/include/asm-x86/xenoprof.h +1 -0
 #else
 
+struct vcpu;

There already is a forward declaration in this header - I'd suggest moving that one up (outside the #if) instead of adding a 2nd one. With that feel free to re-add the ack I had given on v1.

Sure and thanks.

Quoted 2 lines

Jan

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel

Reviewed-by on v2 1/1
#3 lore raw
In reply to Wei Liu

Hi Wei,

Quoted 4 lines · Wei Liu

They don't belong there. Removing them causes build errors in several places. Add the forward declarations in those places.

For ARM:

Cheers,

Quoted 69 lines

---
Cc: Andrew Cooper <[email protected]>
Cc: George Dunlap <[email protected]>
Cc: Ian Jackson <[email protected]>
Cc: Jan Beulich <[email protected]>
Cc: Konrad Rzeszutek Wilk <[email protected]>
Cc: Stefano Stabellini <[email protected]>
Cc: Tim Deegan <[email protected]>
Cc: Wei Liu <[email protected]>
Cc: Julien Grall <[email protected]>

---
 xen/include/asm-arm/processor.h | 1 +
 xen/include/asm-x86/xenoprof.h  | 2 ++
 xen/include/xen/compat.h        | 1 +
 xen/include/xen/types.h         | 3 ---
 4 files changed, 4 insertions(+), 3 deletions(-)
xen/include/asm-arm/processor.h +1 -0
index 855ded1b07..ab5225fa6c 100644
@@ -699,6 +699,7 @@ void show_registers(struct cpu_user_regs *regs);
 
 void noreturn do_unexpected_trap(const char *msg, struct cpu_user_regs *regs);
 
+struct vcpu;
 void vcpu_regs_hyp_to_user(const struct vcpu *vcpu,
                            struct vcpu_guest_core_regs *regs);
 void vcpu_regs_user_to_hyp(struct vcpu *vcpu,
xen/include/asm-x86/xenoprof.h +2 -0
index 3a1b001edb..1d2464804a 100644
@@ -68,6 +68,8 @@ void passive_domain_destroy(struct vcpu *v);
 
 #else
 
+struct vcpu;
+
 static inline int passive_domain_do_rdmsr(unsigned int msr,
                                           uint64_t *msr_content)
 {
xen/include/xen/compat.h +1 -0
index ce6245c10f..895e2ff68d 100644
@@ -227,6 +227,7 @@ void xlat_start_info(struct start_info *, enum XLAT_start_info_console);
 struct vcpu_runstate_info;
 void xlat_vcpu_runstate_info(struct vcpu_runstate_info *);
 
+struct domain;
 int switch_compat(struct domain *);
 
 #else
xen/include/xen/types.h +0 -3
index 170e993558..b1dbb8720a 100644
@@ -42,9 +42,6 @@ typedef         __s32           int32_t;
 typedef         __u64           uint64_t;
 typedef         __s64           int64_t;
 
-struct domain;
-struct vcpu;
-
 typedef __u16 __le16;
 typedef __u16 __be16;
 typedef __u32 __le32;
Signature · 6 lines
Julien Grall

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel