[PATCH] KVM: VMX: Reorder vmx initialization with kvm vendor initialization

From: Isaku Yamahata
Date: Wed May 31 2023 - 16:36:10 EST


To match vmx_exit cleanup.

Signed-off-by: Isaku Yamahata <isaku.yamahata@xxxxxxxxx>
---
arch/x86/kvm/vmx/main.c | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/arch/x86/kvm/vmx/main.c b/arch/x86/kvm/vmx/main.c
index 2e4667307458..a0586da86d81 100644
--- a/arch/x86/kvm/vmx/main.c
+++ b/arch/x86/kvm/vmx/main.c
@@ -1251,11 +1251,11 @@ static int __init vt_init(void)
__alignof__(struct vcpu_tdx));
}

- r = kvm_x86_vendor_init(&vt_init_ops);
+ r = vmx_init();
if (r)
- return r;
+ goto err_vmx_init;

- r = vmx_init();
+ r = kvm_x86_vendor_init(&vt_init_ops);
if (r)
goto err_vmx_init;

@@ -1270,9 +1270,9 @@ static int __init vt_init(void)
return 0;

err_kvm_init:
- vmx_exit();
-err_vmx_init:
kvm_x86_vendor_exit();
+err_vmx_init:
+ vmx_exit();
return r;
}
module_init(vt_init);
--
2.25.1




--
Isaku Yamahata <isaku.yamahata@xxxxxxxxx>