kvm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: linmiaohe <linmiaohe@huawei.com>
To: Vitaly Kuznetsov <vkuznets@redhat.com>
Cc: "kvm@vger.kernel.org" <kvm@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"x86@kernel.org" <x86@kernel.org>,
	"pbonzini@redhat.com" <pbonzini@redhat.com>,
	"rkrcmar@redhat.com" <rkrcmar@redhat.com>,
	"sean.j.christopherson@intel.com"
	<sean.j.christopherson@intel.com>,
	"wanpengli@tencent.com" <wanpengli@tencent.com>,
	"jmattson@google.com" <jmattson@google.com>,
	"joro@8bytes.org" <joro@8bytes.org>,
	"tglx@linutronix.de" <tglx@linutronix.de>,
	"mingo@redhat.com" <mingo@redhat.com>,
	"bp@alien8.de" <bp@alien8.de>, "hpa@zytor.com" <hpa@zytor.com>
Subject: Re: [PATCH] KVM: Fix some obsolete comments
Date: Wed, 26 Feb 2020 01:48:28 +0000	[thread overview]
Message-ID: <3e25a121a6754020ac3a1eda9fb7fad6@huawei.com> (raw)

Vitaly Kuznetsov <vkuznets@redhat.com> writes:
>linmiaohe <linmiaohe@huawei.com> writes:
>
>> From: Miaohe Lin <linmiaohe@huawei.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@redhat.com>
>

Many thanks for your review, and nice suggestion again!


             reply	other threads:[~2020-02-26  1:48 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-26  1:48 linmiaohe [this message]
2020-02-26 15:30 ` [PATCH] KVM: Fix some obsolete comments Sean Christopherson
  -- strict thread matches above, loose matches on Subject: below --
2020-02-27  1:35 linmiaohe
2020-02-25  3:05 linmiaohe
2020-02-25 13:04 ` Vitaly Kuznetsov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3e25a121a6754020ac3a1eda9fb7fad6@huawei.com \
    --to=linmiaohe@huawei.com \
    --cc=bp@alien8.de \
    --cc=hpa@zytor.com \
    --cc=jmattson@google.com \
    --cc=joro@8bytes.org \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=rkrcmar@redhat.com \
    --cc=sean.j.christopherson@intel.com \
    --cc=tglx@linutronix.de \
    --cc=vkuznets@redhat.com \
    --cc=wanpengli@tencent.com \
    --cc=x86@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).