diff mbox series

KVM: VMX: Reinstate __exit attribute for vmx_exit

Message ID 20250102154050.2403-1-costas.argyris@amd.com (mailing list archive)
State New, archived
Headers show
Series KVM: VMX: Reinstate __exit attribute for vmx_exit | expand

Commit Message

Costas Argyris Jan. 2, 2025, 3:40 p.m. UTC
Commit a7b9020b06ec ("x86/l1tf: Handle EPT disabled state proper",
2018-07-13) dropped the "__exit" attribute from vmx_exit because
vmx_init was changed to call vmx_exit.

However, commit e32b120071ea (KVM: VMX: Do _all_ initialization
before exposing /dev/kvm to userspace, 2022-11-30) changed vmx_init
to call __vmx_exit instead of vmx_exit. This made it possible to
mark vmx_exit as "__exit" again, as it originally was, and enjoy
the benefits that it provides (the function can be discarded from
memory in situations where it cannot be called, like the module
being built-in or module unloading being disabled in the kernel).

Signed-off-by: Costas Argyris <costas.argyris@amd.com>
---
 arch/x86/kvm/vmx/vmx.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Sean Christopherson Jan. 9, 2025, 7:47 p.m. UTC | #1
On Thu, 02 Jan 2025 15:40:50 +0000, Costas Argyris wrote:
> Commit a7b9020b06ec ("x86/l1tf: Handle EPT disabled state proper",
> 2018-07-13) dropped the "__exit" attribute from vmx_exit because

Uber nit, the preferred format for referencing commits is:

  a7b9020b06ec ("x86/l1tf: Handle EPT disabled state proper")

> vmx_init was changed to call vmx_exit.
> 
> However, commit e32b120071ea (KVM: VMX: Do _all_ initialization
> before exposing /dev/kvm to userspace, 2022-11-30) changed vmx_init
> to call __vmx_exit instead of vmx_exit. This made it possible to
> mark vmx_exit as "__exit" again, as it originally was, and enjoy
> the benefits that it provides (the function can be discarded from
> memory in situations where it cannot be called, like the module
> being built-in or module unloading being disabled in the kernel).
> 
> [...]

Applied to kvm-x86 vmx, thanks!

[1/1] KVM: VMX: Reinstate __exit attribute for vmx_exit
      https://github.com/kvm-x86/linux/commit/b5fd06847320

--
https://github.com/kvm-x86/linux/tree/next
diff mbox series

Patch

diff --git a/arch/x86/kvm/vmx/vmx.c b/arch/x86/kvm/vmx/vmx.c
index 893366e53732..b98174b44b89 100644
--- a/arch/x86/kvm/vmx/vmx.c
+++ b/arch/x86/kvm/vmx/vmx.c
@@ -8597,7 +8597,7 @@  static void __vmx_exit(void)
 	vmx_cleanup_l1d_flush();
 }
 
-static void vmx_exit(void)
+static void __exit vmx_exit(void)
 {
 	kvm_exit();
 	__vmx_exit();