[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <66b4cb9d-f26f-4ddd-b6c8-8ef4fc3744fd@linux.intel.com>
Date: Tue, 5 Dec 2023 15:55:14 +0800
From: Binbin Wu <binbin.wu@...ux.intel.com>
To: Chao Gao <chao.gao@...el.com>, isaku.yamahata@...el.com
Cc: kvm@...r.kernel.org, linux-kernel@...r.kernel.org,
isaku.yamahata@...il.com, Paolo Bonzini <pbonzini@...hat.com>,
erdemaktas@...gle.com, Sean Christopherson <seanjc@...gle.com>,
Sagi Shahar <sagis@...gle.com>,
David Matlack <dmatlack@...gle.com>,
Kai Huang <kai.huang@...el.com>,
Zhi Wang <zhi.wang.linux@...il.com>, chen.bo@...el.com,
hang.yuan@...el.com, tina.zhang@...el.com
Subject: Re: [PATCH v17 004/116] KVM: VMX: Reorder vmx initialization with kvm
vendor initialization
On 12/4/2023 4:25 PM, Chao Gao wrote:
> On Tue, Nov 07, 2023 at 06:55:30AM -0800, isaku.yamahata@...el.com wrote:
>> From: Isaku Yamahata <isaku.yamahata@...el.com>
>>
>> To match vmx_exit cleanup.
>>
>> Signed-off-by: Isaku Yamahata <isaku.yamahata@...el.com>
>> ---
>> 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 266760865ed8..e07bec005eda 100644
>> --- a/arch/x86/kvm/vmx/main.c
>> +++ b/arch/x86/kvm/vmx/main.c
>> @@ -180,11 +180,11 @@ static int __init vt_init(void)
>> */
>> hv_init_evmcs();
>>
>> - r = kvm_x86_vendor_init(&vt_init_ops);
>> + r = vmx_init();
>> if (r)
>> - return r;
>> + goto err_vmx_init;
> this is incorrect. vmx_exit() shouldn't be called if
> vmx_init() failed.
>
>> - r = vmx_init();
>> + r = kvm_x86_vendor_init(&vt_init_ops);
>> if (r)
>> goto err_vmx_init;
And also, maybe better to rename the lable, e.g, err_vendor_init?
>>
>> @@ -201,9 +201,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
>>
>>
Powered by blists - more mailing lists