kvm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] kvm: x86: disable the narrow guest module parameter on unload
@ 2021-06-23 20:34 Aaron Lewis
  2021-06-23 20:47 ` Jim Mattson
  2021-06-23 21:36 ` Paolo Bonzini
  0 siblings, 2 replies; 4+ messages in thread
From: Aaron Lewis @ 2021-06-23 20:34 UTC (permalink / raw)
  To: kvm; +Cc: jmattson, pbonzini, mgamal, Aaron Lewis

When the kvm_intel module unloads the module parameter
'allow_smaller_maxphyaddr' is not cleared because it is also used in the
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);
 
-- 
2.32.0.93.g670b81a890-goog


^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2021-06-23 21:38 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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
2021-06-23 21:37   ` Paolo Bonzini
2021-06-23 21:36 ` Paolo Bonzini

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).