[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <3e25a121a6754020ac3a1eda9fb7fad6@huawei.com>
Date: Wed, 26 Feb 2020 01:48:28 +0000
From: linmiaohe <linmiaohe@...wei.com>
To: Vitaly Kuznetsov <vkuznets@...hat.com>
CC: "kvm@...r.kernel.org" <kvm@...r.kernel.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"x86@...nel.org" <x86@...nel.org>,
"pbonzini@...hat.com" <pbonzini@...hat.com>,
"rkrcmar@...hat.com" <rkrcmar@...hat.com>,
"sean.j.christopherson@...el.com" <sean.j.christopherson@...el.com>,
"wanpengli@...cent.com" <wanpengli@...cent.com>,
"jmattson@...gle.com" <jmattson@...gle.com>,
"joro@...tes.org" <joro@...tes.org>,
"tglx@...utronix.de" <tglx@...utronix.de>,
"mingo@...hat.com" <mingo@...hat.com>,
"bp@...en8.de" <bp@...en8.de>, "hpa@...or.com" <hpa@...or.com>
Subject: Re: [PATCH] KVM: Fix some obsolete comments
Vitaly Kuznetsov <vkuznets@...hat.com> writes:
>linmiaohe <linmiaohe@...wei.com> writes:
>
>> From: Miaohe Lin <linmiaohe@...wei.com>
>>
>
>Thank you for the cleanup, I looked at nested_svm_intercept() and I see room for improvement, e.g. (completely untested!)
>
>diff --git a/arch/x86/kvm/svm.c b/arch/x86/kvm/svm.c index 76c24b3491f6..fcb26d64d3c7 100644
>--- a/arch/x86/kvm/svm.c
>+++ b/arch/x86/kvm/svm.c
>@@ -3280,42 +3280,36 @@ static int nested_svm_intercept(struct vcpu_svm *svm)
> case SVM_EXIT_IOIO:
> vmexit = nested_svm_intercept_ioio(svm);
> break;
>- case SVM_EXIT_READ_CR0 ... SVM_EXIT_WRITE_CR8: {
>- u32 bit = 1U << (exit_code - SVM_EXIT_READ_CR0);
>- if (svm->nested.intercept_cr & bit)
>+ case SVM_EXIT_READ_CR0 ... SVM_EXIT_WRITE_CR8:
>+ if (svm->nested.intercept_cr &
>+ BIT(exit_code - SVM_EXIT_READ_CR0))
>- default: {
>- u64 exit_bits = 1ULL << (exit_code - SVM_EXIT_INTR);
>- if (svm->nested.intercept & exit_bits)
>+ default:
>+ if (svm->nested.intercept & BIT_ULL(exit_code -
>+ SVM_EXIT_INTR))
> vmexit = NESTED_EXIT_DONE;
> }
>- }
>
> return vmexit;
> }
>
>Feel free to pick stuff you like and split your changes to this function in a separate patch.
Sounds good, many thanks for your improvement suggestion. Will do in a separate patch.
>> u32 exit_code = svm->vmcb->control.exit_code; diff --git
>> throws
>> - * #UD or #GP.
>> + * #UD, #GP or #SS.
>
>Oxford comma, anyone? :-)))
I have no strong preference. ^_^
>> */
>> int get_vmx_mem_address(struct kvm_vcpu *vcpu, unsigned long exit_qualification,
>
>All your changes look correct, so
>
>Reviewed-by: Vitaly Kuznetsov <vkuznets@...hat.com>
>
Many thanks for your review, and nice suggestion again!
Powered by blists - more mailing lists