From 90d9a9884292eacce4f6fa9e54cbdeb3e0125c4d Mon Sep 17 00:00:00 2001 From: Jan Beulich Date: Tue, 17 Mar 2020 16:11:33 +0100 Subject: [PATCH] x86/HVM: reduce domain.h include dependencies Drop #include-s not needed by the header itself. Put the ones needed into whichever other files actually need them. Signed-off-by: Jan Beulich Reviewed-by: Paul Durrant Acked-by: Andrew Cooper --- xen/arch/x86/cpu/mcheck/vmce.c | 1 + xen/arch/x86/hvm/dm.c | 2 ++ xen/arch/x86/hvm/dom0_build.c | 1 + xen/arch/x86/hvm/hpet.c | 1 + xen/arch/x86/hvm/hypercall.c | 3 +++ xen/arch/x86/hvm/ioreq.c | 1 + xen/arch/x86/hvm/irq.c | 1 + xen/arch/x86/hvm/rtc.c | 1 + xen/arch/x86/hvm/viridian/private.h | 1 + xen/arch/x86/hvm/vpt.c | 1 + xen/arch/x86/msr.c | 2 ++ xen/arch/x86/pv/shim.c | 1 + xen/arch/x86/traps.c | 1 + xen/common/vm_event.c | 1 + xen/drivers/char/xen_pv_console.c | 1 + xen/include/asm-x86/hvm/domain.h | 16 +++++----------- xen/include/asm-x86/hvm/nestedhvm.h | 1 + xen/include/xsm/dummy.h | 1 + xen/xsm/flask/hooks.c | 2 +- 19 files changed, 27 insertions(+), 12 deletions(-) diff --git a/xen/arch/x86/cpu/mcheck/vmce.c b/xen/arch/x86/cpu/mcheck/vmce.c index 816ef61ad4..b1df9e9efd 100644 --- a/xen/arch/x86/cpu/mcheck/vmce.c +++ b/xen/arch/x86/cpu/mcheck/vmce.c @@ -28,6 +28,7 @@ #include #include #include +#include #include #include #include diff --git a/xen/arch/x86/hvm/dm.c b/xen/arch/x86/hvm/dm.c index d6d0e8be89..96c5042b75 100644 --- a/xen/arch/x86/hvm/dm.c +++ b/xen/arch/x86/hvm/dm.c @@ -27,6 +27,8 @@ #include +#include + struct dmop_args { domid_t domid; unsigned int nr_bufs; diff --git a/xen/arch/x86/hvm/dom0_build.c b/xen/arch/x86/hvm/dom0_build.c index ee1d50acc6..2afd44c8a4 100644 --- a/xen/arch/x86/hvm/dom0_build.c +++ b/xen/arch/x86/hvm/dom0_build.c @@ -38,6 +38,7 @@ #include #include #include +#include /* * Have the TSS cover the ISA port range, which makes it diff --git a/xen/arch/x86/hvm/hpet.c b/xen/arch/x86/hvm/hpet.c index 9fbdc5302b..ca94e8b453 100644 --- a/xen/arch/x86/hvm/hpet.c +++ b/xen/arch/x86/hvm/hpet.c @@ -26,6 +26,7 @@ #include #include #include +#include #define domain_vhpet(x) (&(x)->arch.hvm.pl_time->vhpet) #define vcpu_vhpet(x) (domain_vhpet((x)->domain)) diff --git a/xen/arch/x86/hvm/hypercall.c b/xen/arch/x86/hvm/hypercall.c index 33dd2d99d2..782197ff8a 100644 --- a/xen/arch/x86/hvm/hypercall.c +++ b/xen/arch/x86/hvm/hypercall.c @@ -24,6 +24,9 @@ #include +#include +#include + static long hvm_memory_op(int cmd, XEN_GUEST_HANDLE_PARAM(void) arg) { const struct vcpu *curr = current; diff --git a/xen/arch/x86/hvm/ioreq.c b/xen/arch/x86/hvm/ioreq.c index f8a5c81546..36fbbcf0ea 100644 --- a/xen/arch/x86/hvm/ioreq.c +++ b/xen/arch/x86/hvm/ioreq.c @@ -34,6 +34,7 @@ #include #include +#include static void set_ioreq_server(struct domain *d, unsigned int id, struct hvm_ioreq_server *s) diff --git a/xen/arch/x86/hvm/irq.c b/xen/arch/x86/hvm/irq.c index dd202aab5a..b3ee0d9130 100644 --- a/xen/arch/x86/hvm/irq.c +++ b/xen/arch/x86/hvm/irq.c @@ -26,6 +26,7 @@ #include #include #include +#include bool hvm_domain_use_pirq(const struct domain *d, const struct pirq *pirq) { diff --git a/xen/arch/x86/hvm/rtc.c b/xen/arch/x86/hvm/rtc.c index ce603b8cf8..5bbbdc0e0f 100644 --- a/xen/arch/x86/hvm/rtc.c +++ b/xen/arch/x86/hvm/rtc.c @@ -28,6 +28,7 @@ #include #include #include +#include #define USEC_PER_SEC 1000000UL #define NS_PER_USEC 1000UL diff --git a/xen/arch/x86/hvm/viridian/private.h b/xen/arch/x86/hvm/viridian/private.h index 958a2814c2..d2fe3c2ea1 100644 --- a/xen/arch/x86/hvm/viridian/private.h +++ b/xen/arch/x86/hvm/viridian/private.h @@ -4,6 +4,7 @@ #define X86_HVM_VIRIDIAN_PRIVATE_H #include +#include int viridian_synic_wrmsr(struct vcpu *v, uint32_t idx, uint64_t val); int viridian_synic_rdmsr(const struct vcpu *v, uint32_t idx, uint64_t *val); diff --git a/xen/arch/x86/hvm/vpt.c b/xen/arch/x86/hvm/vpt.c index ecd25d7ad4..47f2c2aa64 100644 --- a/xen/arch/x86/hvm/vpt.c +++ b/xen/arch/x86/hvm/vpt.c @@ -22,6 +22,7 @@ #include #include #include +#include #define mode_is(d, name) \ ((d)->arch.hvm.params[HVM_PARAM_TIMER_MODE] == HVMPTM_##name) diff --git a/xen/arch/x86/msr.c b/xen/arch/x86/msr.c index 519222a2b8..385ad6d169 100644 --- a/xen/arch/x86/msr.c +++ b/xen/arch/x86/msr.c @@ -28,6 +28,8 @@ #include #include +#include + DEFINE_PER_CPU(uint32_t, tsc_aux); struct msr_policy __read_mostly raw_msr_policy, diff --git a/xen/arch/x86/pv/shim.c b/xen/arch/x86/pv/shim.c index d86e2de118..ed2ece8a8a 100644 --- a/xen/arch/x86/pv/shim.c +++ b/xen/arch/x86/pv/shim.c @@ -35,6 +35,7 @@ #include #include +#include #include diff --git a/xen/arch/x86/traps.c b/xen/arch/x86/traps.c index f4f2c13ae9..e838846c6b 100644 --- a/xen/arch/x86/traps.c +++ b/xen/arch/x86/traps.c @@ -76,6 +76,7 @@ #include #include #include +#include #include #include #include diff --git a/xen/common/vm_event.c b/xen/common/vm_event.c index 3b18195ebf..127f2d58f1 100644 --- a/xen/common/vm_event.c +++ b/xen/common/vm_event.c @@ -29,6 +29,7 @@ #include #include #include +#include /* for public/io/ring.h macros */ #define xen_mb() smp_mb() diff --git a/xen/drivers/char/xen_pv_console.c b/xen/drivers/char/xen_pv_console.c index 612784b074..1536bdaf52 100644 --- a/xen/drivers/char/xen_pv_console.c +++ b/xen/drivers/char/xen_pv_console.c @@ -28,6 +28,7 @@ #include #include +#include #include static struct xencons_interface *cons_ring; diff --git a/xen/include/asm-x86/hvm/domain.h b/xen/include/asm-x86/hvm/domain.h index 8f70ba2b1a..624a67d0dd 100644 --- a/xen/include/asm-x86/hvm/domain.h +++ b/xen/include/asm-x86/hvm/domain.h @@ -20,20 +20,14 @@ #ifndef __ASM_X86_HVM_DOMAIN_H__ #define __ASM_X86_HVM_DOMAIN_H__ -#include -#include -#include -#include -#include +#include +#include +#include + #include -#include #include #include -#include -#include -#include -#include -#include + #include struct hvm_ioreq_page { diff --git a/xen/include/asm-x86/hvm/nestedhvm.h b/xen/include/asm-x86/hvm/nestedhvm.h index 256fed733a..d9784a2e0b 100644 --- a/xen/include/asm-x86/hvm/nestedhvm.h +++ b/xen/include/asm-x86/hvm/nestedhvm.h @@ -22,6 +22,7 @@ #include /* for uintNN_t */ #include /* for struct vcpu, struct domain */ #include /* for vcpu_nestedhvm */ +#include enum nestedhvm_vmexits { NESTEDHVM_VMEXIT_ERROR = 0, /* inject VMEXIT w/ invalid VMCB */ diff --git a/xen/include/xsm/dummy.h b/xen/include/xsm/dummy.h index b8e185e6fa..295dd67c48 100644 --- a/xen/include/xsm/dummy.h +++ b/xen/include/xsm/dummy.h @@ -17,6 +17,7 @@ #include #include +#include /* Cannot use BUILD_BUG_ON here because the expressions we check are not * considered constant at compile time. Instead, rely on constant propagation to diff --git a/xen/xsm/flask/hooks.c b/xen/xsm/flask/hooks.c index cf7f25cda2..8af8602b46 100644 --- a/xen/xsm/flask/hooks.c +++ b/xen/xsm/flask/hooks.c @@ -28,7 +28,7 @@ #include #include #include - +#include #include #include -- 2.30.2