lkml.org 
[lkml]   [2022]   [Feb]   [18]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] kvm/vmx: Make setup/unsetup under the same conditions
Date
Make sure nested_vmx_hardware_setup/unsetup are called in pairs under
the same conditions.

Signed-off-by: Peng Hao <flyingpeng@tencent.com>
---
arch/x86/kvm/vmx/vmx.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/x86/kvm/vmx/vmx.c b/arch/x86/kvm/vmx/vmx.c
index 0ffcfe54eea5..5392def71093 100644
--- a/arch/x86/kvm/vmx/vmx.c
+++ b/arch/x86/kvm/vmx/vmx.c
@@ -7852,7 +7852,7 @@ static __init int hardware_setup(void)
vmx_set_cpu_caps();

r = alloc_kvm_area();
- if (r)
+ if (r && nested)
nested_vmx_hardware_unsetup();

kvm_set_posted_intr_wakeup_handler(pi_wakeup_handler);
--
2.27.0
\
 
 \ /
  Last update: 2022-02-18 12:13    [W:0.253 / U:0.188 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site