From: Jim Mattson <jmattson@google.com>
To: Aaron Lewis <aaronlewis@google.com>
Cc: kvm@vger.kernel.org, pbonzini@redhat.com, mgamal@redhat.com
Subject: Re: [PATCH] kvm: x86: disable the narrow guest module parameter on unload
Date: Wed, 23 Jun 2021 13:47:28 -0700 [thread overview]
Message-ID: <CALMp9eRHR1x=+diFKM+FbO1_h-Vk+tNN9_ECuNc3THot4shrdg@mail.gmail.com> (raw)
In-Reply-To: <20210623203426.1891402-1-aaronlewis@google.com>
On Wed, Jun 23, 2021 at 1:35 PM Aaron Lewis <aaronlewis@google.com> wrote:
>
> When the kvm_intel module unloads the module parameter
> 'allow_smaller_maxphyaddr' is not cleared because it is also used in the
...because the backing variable is defined in the
(Or something like that.)
> kvm module. As a result, if the module parameter's state was set before
> kvm_intel unloads, it will also be set when it reloads. Explicitly
> clear the state in vmx_exit() to prevent this from happening.
>
> Signed-off-by: Aaron Lewis <aaronlewis@google.com>
> ---
> arch/x86/kvm/vmx/vmx.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/arch/x86/kvm/vmx/vmx.c b/arch/x86/kvm/vmx/vmx.c
> index c2a779b688e6..fd161c9a83fd 100644
> --- a/arch/x86/kvm/vmx/vmx.c
> +++ b/arch/x86/kvm/vmx/vmx.c
> @@ -7996,6 +7996,8 @@ static void vmx_exit(void)
> }
> #endif
> vmx_cleanup_l1d_flush();
> +
> + allow_smaller_maxphyaddr = false;
> }
> module_exit(vmx_exit);
This seems reasonable to me. Another option is to move the backing
variable to the kvm_intel module, given the recent suggestion that it
should never be enabled for AMD.
Reviewed-by: Jim Mattson <jmattson@google.com>
next prev parent reply other threads:[~2021-06-23 20:47 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-06-23 20:34 [PATCH] kvm: x86: disable the narrow guest module parameter on unload Aaron Lewis
2021-06-23 20:47 ` Jim Mattson [this message]
2021-06-23 21:37 ` Paolo Bonzini
2021-06-23 21:36 ` Paolo Bonzini
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='CALMp9eRHR1x=+diFKM+FbO1_h-Vk+tNN9_ECuNc3THot4shrdg@mail.gmail.com' \
--to=jmattson@google.com \
--cc=aaronlewis@google.com \
--cc=kvm@vger.kernel.org \
--cc=mgamal@redhat.com \
--cc=pbonzini@redhat.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).