KVM: SVM: Fix missing kvm_cache_regs.h include in svm.h
Subsystems (4)
PATCH 1/1 KVM: SVM: Fix missing kvm_cache_regs.h include in svm.h
Adds include for is_guest_mode() in svm.h.
Just compile tested.
--- arch/x86/kvm/svm/svm.h | 2 ++ 1 file changed, 2 insertions(+)
arch/x86/kvm/svm/svm.h +2 -0
@@ -22,6 +22,8 @@#include <asm/svm.h> #include <asm/sev-common.h> +#include "kvm_cache_regs.h" +#define __sme_page_pa (x) __sme_set(page_to_pfn(x) << PAGE_SHIFT)#define IOPM_SIZE PAGE_SIZE * 3
Signature · 1 line
2.35.1.574.g5d30c73bfb-goog
Sean Christopherson
maintainerQuoted 1 line · Peter Gonda
Adds include for
is_guest_mode()insvm.h.
Write changelogs as "commands", not descriptions. And a little extra verbosity wouldn't hurt, e.g.
Include kvm_cache_regs.h to pick up the definition of is_guest_mode(), which is referenced by nested_svm_virtualize_tpr().
Though you'll probably need a different changelog (see below).
Quoted 1 line
Just compile tested.
This belongs in the ignored part, not the changelog proper.
Quoted 15 lines
Fixes 883b0a91f41ab ("KVM: SVM: Move Nested SVM Implementation to nested.c")Signed-off-by Peter Gonda <[email protected]>Cc Paolo Bonzini <[email protected]>Cc Sean Christopherson <[email protected]>--- arch/x86/kvm/svm/svm.h | 2 ++ 1 file changed, 2 insertions(+)arch/x86/kvm/svm/svm.h +0
-0
arch/x86/kvm/svm/svm.h line 25
Quoted 4 lines
arch/x86/kvm/svm/svm.h +1
-0@@ -22,6 +22,8 @@#include <asm/svm.h> #include <asm/sev-common.h> +#include "kvm_cache_regs.h"
Ha, we've already got a lovely workaround for exactly this problem. This patch should drop the include from svm_onhyperv.c, there's nothing in that file that needs kvm_cache_regs.h (I verified by deleting use of is_guest_mode()), it's included purely because of this bug in svm.h.
arch/x86/kvm/svm/svm_onhyperv.c +0 -1
@@ -4,7 +4,6 @@*/ #include <linux/kvm_host.h> -#include "kvm_cache_regs.h" #include <asm/mshyperv.h>
Quoted 11 lines · Sean Christopherson
Quoted 1 line · Peter Gonda
Adds include for
is_guest_mode()insvm.h.Write changelogs as "commands", not descriptions. And a little extra verbosity wouldn't hurt, e.g.
Include
kvm_cache_regs.hto pick up the definition ofis_guest_mode(), which is referenced bynested_svm_virtualize_tpr().Though you'll probably need a different changelog (see below).
Thanks Will do.
Quoted 4 lines
Quoted 2 lines
Just compile tested.
This belongs in the ignored part, not the changelog proper.
Ack.
Quoted 19 lines
Quoted 19 lines
Fixes 883b0a91f41ab ("KVM: SVM: Move Nested SVM Implementation to nested.c")Signed-off-by Peter Gonda <[email protected]>Cc Paolo Bonzini <[email protected]>Cc Sean Christopherson <[email protected]>--- arch/x86/kvm/svm/svm.h | 2 ++ 1 file changed, 2 insertions(+)arch/x86/kvm/svm/svm.h +0
-0@@ -22,6 +22,8 @@#include <asm/svm.h> #include <asm/sev-common.h>
Quoted 6 lines
arch/x86/kvm/svm/svm.h line 25
Quoted 1 line
arch/x86/kvm/svm/svm.h +1
-0+#include "kvm_cache_regs.h" Ha, we've already got a lovely workaround for exactly this problem. This patch should drop the include from
svm_onhyperv.c, there's nothing in that file that needskvm_cache_regs.h(I verified by deleting use ofis_guest_mode()), it's included purely because of this bug insvm.h.
Ah good catch. I assume I should add kvm_cache_regs.h to arch/x86/kvm/svm/nested.c too since it uses is_guest_mode().
Quoted 14 lines
arch/x86/kvm/svm/svm_onhyperv.c +0
-1@@ -4,7 +4,6 @@*/ #include <linux/kvm_host.h> -#include "kvm_cache_regs.h" #include <asm/mshyperv.h>
Sean Christopherson
maintainerQuoted 8 lines · Peter Gonda
Quoted 4 lines · Sean Christopherson
Ha, we've already got a lovely workaround for exactly this problem. This patch should drop the include from
svm_onhyperv.c, there's nothing in that file that needskvm_cache_regs.h(I verified by deleting use ofis_guest_mode()), it's included purely because of this bug insvm.h.Ah good catch. I assume I should add
kvm_cache_regs.htoarch/x86/kvm/svm/nested.ctoo since it usesis_guest_mode().
Nah, picking it up from svm.h (and several other headers) is ok. If we required every compilation unit to _directly_ include every header, we'd probably double the size of the kernel source :-)