Re: [PATCH] kvm: x86: disable the narrow guest module parameter on unload

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Jun 23, 2021 at 1:35 PM Aaron Lewis <aaronlewis@xxxxxxxxxx> 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@xxxxxxxxxx>
> ---
>  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@xxxxxxxxxx>



[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux