From: Maxim Levitsky <mlevitsk@redhat.com>
To: Paolo Bonzini <pbonzini@redhat.com>,
linux-kernel@vger.kernel.org, kvm@vger.kernel.org
Cc: seanjc@google.com, maciej.szmigiero@oracle.com
Subject: Re: [PATCH v2 7/8] KVM: x86: remove SMRAM address space if SMM is not supported
Date: Mon, 24 Oct 2022 15:33:01 +0300 [thread overview]
Message-ID: <7e63bf39643c34deb86645dd9b35bafd3b64bbe3.camel@redhat.com> (raw)
In-Reply-To: <20220929172016.319443-8-pbonzini@redhat.com>
On Thu, 2022-09-29 at 13:20 -0400, Paolo Bonzini wrote:
> If CONFIG_KVM_SMM is not defined HF_SMM_MASK will always be zero, and
> we can spare userspace the hassle of setting up the SMRAM address space
> simply by reporting that only one address space is supported.
>
> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
> ---
> arch/x86/include/asm/kvm_host.h | 13 ++++++++-----
> 1 file changed, 8 insertions(+), 5 deletions(-)
>
> diff --git a/arch/x86/include/asm/kvm_host.h b/arch/x86/include/asm/kvm_host.h
> index cb88da02d965..d11697504471 100644
> --- a/arch/x86/include/asm/kvm_host.h
> +++ b/arch/x86/include/asm/kvm_host.h
> @@ -1994,11 +1994,14 @@ enum {
> #define HF_SMM_MASK (1 << 6)
> #define HF_SMM_INSIDE_NMI_MASK (1 << 7)
>
> -#define __KVM_VCPU_MULTIPLE_ADDRESS_SPACE
> -#define KVM_ADDRESS_SPACE_NUM 2
> -
> -#define kvm_arch_vcpu_memslots_id(vcpu) ((vcpu)->arch.hflags & HF_SMM_MASK ? 1 : 0)
> -#define kvm_memslots_for_spte_role(kvm, role) __kvm_memslots(kvm, (role).smm)
> +#ifdef CONFIG_KVM_SMM
> +# define __KVM_VCPU_MULTIPLE_ADDRESS_SPACE
> +# define KVM_ADDRESS_SPACE_NUM 2
> +# define kvm_arch_vcpu_memslots_id(vcpu) ((vcpu)->arch.hflags & HF_SMM_MASK ? 1 : 0)
> +# define kvm_memslots_for_spte_role(kvm, role) __kvm_memslots(kvm, (role).smm)
> +#else
> +# define kvm_memslots_for_spte_role(kvm, role) __kvm_memslots(kvm, 0)
> +#endif
>
> #define KVM_ARCH_WANT_MMU_NOTIFIER
>
Reviewed-by: Maxim Levitsky <mlevitsk@redhat.com>
Best regards,
Maxim Levitsky
next prev parent reply other threads:[~2022-10-24 19:22 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-09-29 17:20 [PATCH v2 0/8] KVM: x86: allow compiling out SMM support Paolo Bonzini
2022-09-29 17:20 ` [PATCH v2 1/8] KVM: x86: start moving SMM-related functions to new files Paolo Bonzini
2022-10-14 19:38 ` Sean Christopherson
2022-10-24 12:31 ` Maxim Levitsky
2022-09-29 17:20 ` [PATCH v2 2/8] KVM: x86: move SMM entry to a new file Paolo Bonzini
2022-10-24 12:32 ` Maxim Levitsky
2022-09-29 17:20 ` [PATCH v2 3/8] KVM: x86: move SMM exit " Paolo Bonzini
2022-10-24 12:32 ` Maxim Levitsky
2022-09-29 17:20 ` [PATCH v2 4/8] KVM: x86: do not go through ctxt->ops when emulating rsm Paolo Bonzini
2022-10-01 13:10 ` kernel test robot
2022-10-01 13:41 ` kernel test robot
2022-10-02 2:42 ` kernel test robot
2022-10-14 21:04 ` Sean Christopherson
2022-10-24 12:32 ` Maxim Levitsky
2022-09-29 17:20 ` [PATCH v2 5/8] KVM: allow compiling out SMM support Paolo Bonzini
2022-10-24 12:32 ` Maxim Levitsky
2022-09-29 17:20 ` [PATCH v2 6/8] KVM: x86: compile out vendor-specific code if SMM is disabled Paolo Bonzini
2022-10-24 12:32 ` Maxim Levitsky
2022-09-29 17:20 ` [PATCH v2 7/8] KVM: x86: remove SMRAM address space if SMM is not supported Paolo Bonzini
2022-10-24 12:33 ` Maxim Levitsky [this message]
2022-09-29 17:20 ` [PATCH v2 8/8] KVM: x86: do not define KVM_REQ_SMI if SMM disabled Paolo Bonzini
2022-10-14 21:06 ` Sean Christopherson
2022-10-24 12:33 ` Maxim Levitsky
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=7e63bf39643c34deb86645dd9b35bafd3b64bbe3.camel@redhat.com \
--to=mlevitsk@redhat.com \
--cc=kvm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=maciej.szmigiero@oracle.com \
--cc=pbonzini@redhat.com \
--cc=seanjc@google.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).