From 436b5fbb5526c80aee1744ac1bde101f116935e2 Mon Sep 17 00:00:00 2001 From: Jan Beulich Date: Wed, 26 Feb 2020 17:33:57 +0100 Subject: [PATCH] SVM: drop asm/hvm/emulate.h inclusion from vmcb.h It's not needed there and introduces a needless, almost global dependency. Include the file (or in some cases just xen/err.h) where actually needed, or - in one case - simply forward-declare a struct. In microcode*.c take the opportunity and also re-order a few other #include-s. Signed-off-by: Jan Beulich Acked-by: Andrew Cooper Reviewed-by: Alexandru Isaila Reviewed-by: Paul Durrant Reviewed-by: Kevin Tian --- xen/arch/x86/hvm/hvm.c | 1 + xen/arch/x86/hvm/ioreq.c | 1 + xen/arch/x86/hvm/svm/emulate.c | 1 + xen/arch/x86/hvm/vm_event.c | 1 + xen/arch/x86/microcode.c | 5 +++-- xen/arch/x86/microcode_amd.c | 5 +++-- xen/arch/x86/microcode_intel.c | 5 +++-- xen/arch/x86/mm/shadow/hvm.c | 1 + xen/arch/x86/pv/emul-gate-op.c | 1 + xen/drivers/passthrough/amd/iommu_intr.c | 1 + xen/include/asm-x86/hvm/svm/vmcb.h | 2 -- xen/include/asm-x86/hvm/vmx/vmx.h | 1 + 12 files changed, 17 insertions(+), 8 deletions(-) diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c index a339b36a0d..db5d7b4d30 100644 --- a/xen/arch/x86/hvm/hvm.c +++ b/xen/arch/x86/hvm/hvm.c @@ -56,6 +56,7 @@ #include #include #include +#include #include #include #include diff --git a/xen/arch/x86/hvm/ioreq.c b/xen/arch/x86/hvm/ioreq.c index e51aebd69a..f8a5c81546 100644 --- a/xen/arch/x86/hvm/ioreq.c +++ b/xen/arch/x86/hvm/ioreq.c @@ -28,6 +28,7 @@ #include #include +#include #include #include #include diff --git a/xen/arch/x86/hvm/svm/emulate.c b/xen/arch/x86/hvm/svm/emulate.c index d586bad127..635b3705f7 100644 --- a/xen/arch/x86/hvm/svm/emulate.c +++ b/xen/arch/x86/hvm/svm/emulate.c @@ -20,6 +20,7 @@ #include #include #include +#include #include #include #include diff --git a/xen/arch/x86/hvm/vm_event.c b/xen/arch/x86/hvm/vm_event.c index 121de23071..07f135217e 100644 --- a/xen/arch/x86/hvm/vm_event.c +++ b/xen/arch/x86/hvm/vm_event.c @@ -22,6 +22,7 @@ #include #include +#include #include #include diff --git a/xen/arch/x86/microcode.c b/xen/arch/x86/microcode.c index c0fb690f79..35c1d36cdc 100644 --- a/xen/arch/x86/microcode.c +++ b/xen/arch/x86/microcode.c @@ -22,9 +22,10 @@ */ #include -#include -#include +#include #include +#include +#include #include #include #include diff --git a/xen/arch/x86/microcode_amd.c b/xen/arch/x86/microcode_amd.c index 00750f7bbb..bc7459416c 100644 --- a/xen/arch/x86/microcode_amd.c +++ b/xen/arch/x86/microcode_amd.c @@ -14,9 +14,10 @@ * License version 2. See file COPYING for details. */ -#include -#include +#include #include +#include +#include #include #include #include diff --git a/xen/arch/x86/microcode_intel.c b/xen/arch/x86/microcode_intel.c index 9f66057aad..91b7d473f7 100644 --- a/xen/arch/x86/microcode_intel.c +++ b/xen/arch/x86/microcode_intel.c @@ -21,9 +21,10 @@ * 2 of the License, or (at your option) any later version. */ -#include -#include +#include #include +#include +#include #include #include #include diff --git a/xen/arch/x86/mm/shadow/hvm.c b/xen/arch/x86/mm/shadow/hvm.c index a219266fa2..1e6024c71f 100644 --- a/xen/arch/x86/mm/shadow/hvm.c +++ b/xen/arch/x86/mm/shadow/hvm.c @@ -28,6 +28,7 @@ #include #include +#include #include #include "private.h" diff --git a/xen/arch/x86/pv/emul-gate-op.c b/xen/arch/x86/pv/emul-gate-op.c index 06fcbbce30..3c7f6d70bc 100644 --- a/xen/arch/x86/pv/emul-gate-op.c +++ b/xen/arch/x86/pv/emul-gate-op.c @@ -19,6 +19,7 @@ * along with this program; If not, see . */ +#include #include #include #include diff --git a/xen/drivers/passthrough/amd/iommu_intr.c b/xen/drivers/passthrough/amd/iommu_intr.c index e1cc13b873..cec575071d 100644 --- a/xen/drivers/passthrough/amd/iommu_intr.c +++ b/xen/drivers/passthrough/amd/iommu_intr.c @@ -16,6 +16,7 @@ * along with this program; If not, see . */ +#include #include #include diff --git a/xen/include/asm-x86/hvm/svm/vmcb.h b/xen/include/asm-x86/hvm/svm/vmcb.h index 56aff9b2ea..b9e389d481 100644 --- a/xen/include/asm-x86/hvm/svm/vmcb.h +++ b/xen/include/asm-x86/hvm/svm/vmcb.h @@ -20,8 +20,6 @@ #define __ASM_X86_HVM_SVM_VMCB_H__ #include -#include - /* general 1 intercepts */ enum GenericIntercept1bits diff --git a/xen/include/asm-x86/hvm/vmx/vmx.h b/xen/include/asm-x86/hvm/vmx/vmx.h index 371b912887..b334e1ec94 100644 --- a/xen/include/asm-x86/hvm/vmx/vmx.h +++ b/xen/include/asm-x86/hvm/vmx/vmx.h @@ -97,6 +97,7 @@ void vmx_asm_do_vmentry(void); void vmx_intr_assist(void); void noreturn vmx_do_resume(struct vcpu *); void vmx_vlapic_msr_changed(struct vcpu *v); +struct hvm_emulate_ctxt; void vmx_realmode_emulate_one(struct hvm_emulate_ctxt *hvmemul_ctxt); void vmx_realmode(struct cpu_user_regs *regs); void vmx_update_debug_state(struct vcpu *v); -- 2.39.5