* [PATCH] KVM: SVM: Fix missing kvm_cache_regs.h include in svm.h
@ 2022-03-03 16:04 Peter Gonda
2022-03-03 16:25 ` Sean Christopherson
0 siblings, 1 reply; 4+ messages in thread
From: Peter Gonda @ 2022-03-03 16:04 UTC (permalink / raw)
To: kvm; +Cc: Peter Gonda, Paolo Bonzini, Sean Christopherson, linux-kernel
Adds include for is_guest_mode() in svm.h.
Just compile tested.
Fixes: 883b0a91f41ab ("KVM: SVM: Move Nested SVM Implementation to nested.c")
Signed-off-by: Peter Gonda <pgonda@google.com>
Cc: Paolo Bonzini <pbonzini@redhat.com>
Cc: Sean Christopherson <seanjc@google.com>
Cc: kvm@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
---
arch/x86/kvm/svm/svm.h | 2 ++
1 file changed, 2 insertions(+)
diff --git a/arch/x86/kvm/svm/svm.h b/arch/x86/kvm/svm/svm.h
index e45b5645d5e0..396d60e36b82 100644
--- a/arch/x86/kvm/svm/svm.h
+++ b/arch/x86/kvm/svm/svm.h
@@ -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
--
2.35.1.574.g5d30c73bfb-goog
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] KVM: SVM: Fix missing kvm_cache_regs.h include in svm.h
2022-03-03 16:04 [PATCH] KVM: SVM: Fix missing kvm_cache_regs.h include in svm.h Peter Gonda
@ 2022-03-03 16:25 ` Sean Christopherson
2022-03-03 16:49 ` Peter Gonda
0 siblings, 1 reply; 4+ messages in thread
From: Sean Christopherson @ 2022-03-03 16:25 UTC (permalink / raw)
To: Peter Gonda; +Cc: kvm, Paolo Bonzini, linux-kernel
On Thu, Mar 03, 2022, Peter Gonda wrote:
> Adds include for is_guest_mode() in svm.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).
> Just compile tested.
This belongs in the ignored part, not the changelog proper.
> Fixes: 883b0a91f41ab ("KVM: SVM: Move Nested SVM Implementation to nested.c")
> Signed-off-by: Peter Gonda <pgonda@google.com>
> Cc: Paolo Bonzini <pbonzini@redhat.com>
> Cc: Sean Christopherson <seanjc@google.com>
> Cc: kvm@vger.kernel.org
> Cc: linux-kernel@vger.kernel.org
> ---
> arch/x86/kvm/svm/svm.h | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/arch/x86/kvm/svm/svm.h b/arch/x86/kvm/svm/svm.h
> index e45b5645d5e0..396d60e36b82 100644
> --- a/arch/x86/kvm/svm/svm.h
> +++ b/arch/x86/kvm/svm/svm.h
> @@ -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.
diff --git a/arch/x86/kvm/svm/svm_onhyperv.c b/arch/x86/kvm/svm/svm_onhyperv.c
index 98aa981c04ec..8cdc62c74a96 100644
--- a/arch/x86/kvm/svm/svm_onhyperv.c
+++ b/arch/x86/kvm/svm/svm_onhyperv.c
@@ -4,7 +4,6 @@
*/
#include <linux/kvm_host.h>
-#include "kvm_cache_regs.h"
#include <asm/mshyperv.h>
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] KVM: SVM: Fix missing kvm_cache_regs.h include in svm.h
2022-03-03 16:25 ` Sean Christopherson
@ 2022-03-03 16:49 ` Peter Gonda
2022-03-03 16:59 ` Sean Christopherson
0 siblings, 1 reply; 4+ messages in thread
From: Peter Gonda @ 2022-03-03 16:49 UTC (permalink / raw)
To: Sean Christopherson; +Cc: kvm list, Paolo Bonzini, LKML
On Thu, Mar 3, 2022 at 9:26 AM Sean Christopherson <seanjc@google.com> wrote:
>
> On Thu, Mar 03, 2022, Peter Gonda wrote:
> > Adds include for is_guest_mode() in svm.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).
Thanks Will do.
>
> > Just compile tested.
>
> This belongs in the ignored part, not the changelog proper.
Ack.
>
> > Fixes: 883b0a91f41ab ("KVM: SVM: Move Nested SVM Implementation to nested.c")
> > Signed-off-by: Peter Gonda <pgonda@google.com>
> > Cc: Paolo Bonzini <pbonzini@redhat.com>
> > Cc: Sean Christopherson <seanjc@google.com>
> > Cc: kvm@vger.kernel.org
> > Cc: linux-kernel@vger.kernel.org
> > ---
> > arch/x86/kvm/svm/svm.h | 2 ++
> > 1 file changed, 2 insertions(+)
> >
> > diff --git a/arch/x86/kvm/svm/svm.h b/arch/x86/kvm/svm/svm.h
> > index e45b5645d5e0..396d60e36b82 100644
> > --- a/arch/x86/kvm/svm/svm.h
> > +++ b/arch/x86/kvm/svm/svm.h
> > @@ -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.
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().
>
> diff --git a/arch/x86/kvm/svm/svm_onhyperv.c b/arch/x86/kvm/svm/svm_onhyperv.c
> index 98aa981c04ec..8cdc62c74a96 100644
> --- a/arch/x86/kvm/svm/svm_onhyperv.c
> +++ b/arch/x86/kvm/svm/svm_onhyperv.c
> @@ -4,7 +4,6 @@
> */
>
> #include <linux/kvm_host.h>
> -#include "kvm_cache_regs.h"
>
> #include <asm/mshyperv.h>
>
>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] KVM: SVM: Fix missing kvm_cache_regs.h include in svm.h
2022-03-03 16:49 ` Peter Gonda
@ 2022-03-03 16:59 ` Sean Christopherson
0 siblings, 0 replies; 4+ messages in thread
From: Sean Christopherson @ 2022-03-03 16:59 UTC (permalink / raw)
To: Peter Gonda; +Cc: kvm list, Paolo Bonzini, LKML
On Thu, Mar 03, 2022, Peter Gonda wrote:
> On Thu, Mar 3, 2022 at 9:26 AM Sean Christopherson <seanjc@google.com> wrote:
> > 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.
>
> 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().
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 :-)
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2022-03-03 16:59 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-03-03 16:04 [PATCH] KVM: SVM: Fix missing kvm_cache_regs.h include in svm.h Peter Gonda
2022-03-03 16:25 ` Sean Christopherson
2022-03-03 16:49 ` Peter Gonda
2022-03-03 16:59 ` Sean Christopherson
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox