[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <425468c9-15f0-9486-d317-fd25c38a714a@gmail.com>
Date: Tue, 15 Sep 2020 19:29:39 +0800
From: Haiwei Li <lihaiwei.kernel@...il.com>
To: Krish Sadhukhan <krish.sadhukhan@...cle.com>,
Wanpeng Li <kernellwp@...il.com>, linux-kernel@...r.kernel.org,
kvm@...r.kernel.org
Cc: Paolo Bonzini <pbonzini@...hat.com>,
Sean Christopherson <sean.j.christopherson@...el.com>,
Vitaly Kuznetsov <vkuznets@...hat.com>,
Wanpeng Li <wanpengli@...cent.com>,
Jim Mattson <jmattson@...gle.com>,
Joerg Roedel <joro@...tes.org>
Subject: Re: [PATCH] KVM: SVM: Analyze is_guest_mode() in svm_vcpu_run()
On 20/9/15 04:43, Krish Sadhukhan wrote:
>
> On 9/13/20 11:55 PM, Wanpeng Li wrote:
>> From: Wanpeng Li <wanpengli@...cent.com>
>>
>> Analyze is_guest_mode() in svm_vcpu_run() instead of
>> svm_exit_handlers_fastpath()
>> in conformity with VMX version.
>>
>> Suggested-by: Vitaly Kuznetsov <vkuznets@...hat.com>
>> Signed-off-by: Wanpeng Li <wanpengli@...cent.com>
>> ---
>> arch/x86/kvm/svm/svm.c | 7 +++++--
>> 1 file changed, 5 insertions(+), 2 deletions(-)
>>
>> diff --git a/arch/x86/kvm/svm/svm.c b/arch/x86/kvm/svm/svm.c
>> index 3da5b2f..009035a 100644
>> --- a/arch/x86/kvm/svm/svm.c
>> +++ b/arch/x86/kvm/svm/svm.c
>> @@ -3393,8 +3393,7 @@ static void svm_cancel_injection(struct kvm_vcpu
>> *vcpu)
>> static fastpath_t svm_exit_handlers_fastpath(struct kvm_vcpu *vcpu)
>> {
>> - if (!is_guest_mode(vcpu) &&
>> - to_svm(vcpu)->vmcb->control.exit_code == SVM_EXIT_MSR &&
>> + if (to_svm(vcpu)->vmcb->control.exit_code == SVM_EXIT_MSR &&
>> to_svm(vcpu)->vmcb->control.exit_info_1)
>> return handle_fastpath_set_msr_irqoff(vcpu);
>> @@ -3580,6 +3579,10 @@ static __no_kcsan fastpath_t
>> svm_vcpu_run(struct kvm_vcpu *vcpu)
>> svm_handle_mce(svm);
>> svm_complete_interrupts(svm);
>> +
>> + if (is_guest_mode(vcpu))
>> + return EXIT_FASTPATH_NONE;
>> +
>> exit_fastpath = svm_exit_handlers_fastpath(vcpu);
>> return exit_fastpath;
>
> Not related to your changes, but should we get rid of the variable
> 'exit_fastpath' and just do,
>
> return svm_exit_handler_fastpath(vcpu);
>
> It seems the variable isn't used anywhere else and svm_vcpu_run()
> doesn't return from anywhere else either.
>
> Also, svm_exit_handlers_fastpath() doesn't have any other caller. Should
> we get rid of it as well ?
I will do this soon, thanks.
Powered by blists - more mailing lists