diff mbox

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

Message ID 20170810172253.3720-1-wei.liu2@citrix.com (mailing list archive)
State New, archived
Headers show

Commit Message

Wei Liu Aug. 10, 2017, 5:22 p.m. UTC
They don't belong there. Removing them causes build errors in several
places. Add the forward declarations in those places.

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
---
Cc: Andrew Cooper <andrew.cooper3@citrix.com>
Cc: George Dunlap <George.Dunlap@eu.citrix.com>
Cc: Ian Jackson <ian.jackson@eu.citrix.com>
Cc: Jan Beulich <jbeulich@suse.com>
Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Cc: Stefano Stabellini <sstabellini@kernel.org>
Cc: Tim Deegan <tim@xen.org>
Cc: Wei Liu <wei.liu2@citrix.com>
Cc: Julien Grall <Julien.Grall@arm.com>
---
 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(-)

Comments

Jan Beulich Aug. 11, 2017, 10:15 a.m. UTC | #1
>>> On 10.08.17 at 19:22, <wei.liu2@citrix.com> wrote:
> --- a/xen/include/asm-x86/xenoprof.h
> +++ b/xen/include/asm-x86/xenoprof.h
> @@ -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
Wei Liu Aug. 11, 2017, 10:17 a.m. UTC | #2
On Fri, Aug 11, 2017 at 04:15:59AM -0600, Jan Beulich wrote:
> >>> On 10.08.17 at 19:22, <wei.liu2@citrix.com> wrote:
> > --- a/xen/include/asm-x86/xenoprof.h
> > +++ b/xen/include/asm-x86/xenoprof.h
> > @@ -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.
> 

Sure and thanks.

> Jan
>
Julien Grall Aug. 11, 2017, 10:25 a.m. UTC | #3
Hi Wei,

On 10/08/17 18:22, Wei Liu wrote:
> They don't belong there. Removing them causes build errors in several
> places. Add the forward declarations in those places.
>
> Signed-off-by: Wei Liu <wei.liu2@citrix.com>

For ARM:

reviewed-by: Julien Grall <julien.grall@arm.com>

Cheers,

> ---
> Cc: Andrew Cooper <andrew.cooper3@citrix.com>
> Cc: George Dunlap <George.Dunlap@eu.citrix.com>
> Cc: Ian Jackson <ian.jackson@eu.citrix.com>
> Cc: Jan Beulich <jbeulich@suse.com>
> Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
> Cc: Stefano Stabellini <sstabellini@kernel.org>
> Cc: Tim Deegan <tim@xen.org>
> Cc: Wei Liu <wei.liu2@citrix.com>
> Cc: Julien Grall <Julien.Grall@arm.com>
> ---
>  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(-)
>
> diff --git a/xen/include/asm-arm/processor.h b/xen/include/asm-arm/processor.h
> index 855ded1b07..ab5225fa6c 100644
> --- a/xen/include/asm-arm/processor.h
> +++ b/xen/include/asm-arm/processor.h
> @@ -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,
> diff --git a/xen/include/asm-x86/xenoprof.h b/xen/include/asm-x86/xenoprof.h
> index 3a1b001edb..1d2464804a 100644
> --- a/xen/include/asm-x86/xenoprof.h
> +++ b/xen/include/asm-x86/xenoprof.h
> @@ -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)
>  {
> diff --git a/xen/include/xen/compat.h b/xen/include/xen/compat.h
> index ce6245c10f..895e2ff68d 100644
> --- a/xen/include/xen/compat.h
> +++ b/xen/include/xen/compat.h
> @@ -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
> diff --git a/xen/include/xen/types.h b/xen/include/xen/types.h
> index 170e993558..b1dbb8720a 100644
> --- a/xen/include/xen/types.h
> +++ b/xen/include/xen/types.h
> @@ -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;
>
diff mbox

Patch

diff --git a/xen/include/asm-arm/processor.h b/xen/include/asm-arm/processor.h
index 855ded1b07..ab5225fa6c 100644
--- a/xen/include/asm-arm/processor.h
+++ b/xen/include/asm-arm/processor.h
@@ -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,
diff --git a/xen/include/asm-x86/xenoprof.h b/xen/include/asm-x86/xenoprof.h
index 3a1b001edb..1d2464804a 100644
--- a/xen/include/asm-x86/xenoprof.h
+++ b/xen/include/asm-x86/xenoprof.h
@@ -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)
 {
diff --git a/xen/include/xen/compat.h b/xen/include/xen/compat.h
index ce6245c10f..895e2ff68d 100644
--- a/xen/include/xen/compat.h
+++ b/xen/include/xen/compat.h
@@ -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
diff --git a/xen/include/xen/types.h b/xen/include/xen/types.h
index 170e993558..b1dbb8720a 100644
--- a/xen/include/xen/types.h
+++ b/xen/include/xen/types.h
@@ -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;