mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Suthikulpanit, Suravee" <Suravee.Suthikulpanit@amd.com>
To: "Graf, Alexander" <graf@amazon.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"kvm@vger.kernel.org" <kvm@vger.kernel.org>
Cc: "pbonzini@redhat.com" <pbonzini@redhat.com>,
	"rkrcmar@redhat.com" <rkrcmar@redhat.com>,
	"joro@8bytes.org" <joro@8bytes.org>
Subject: Re: [PATCH] svm/avic: Do not send AVIC doorbell to self
Date: Tue, 14 May 2019 15:52:08 +0000	[thread overview]
Message-ID: <bf389c60-1e47-80c1-43cc-9211a729b693@amd.com> (raw)
In-Reply-To: <ca64dd06-df77-050a-92ff-5d5448382390@amazon.com>

Alex,

On 5/7/2019 8:16 AM, Graf, Alexander wrote:
> [CAUTION: External Email]
> 
> On 03.05.19 15:38, Suthikulpanit, Suravee wrote:
>> AVIC doorbell is used to notify a running vCPU that interrupts
>> has been injected into the vCPU AVIC backing page. Current logic
>> checks only if a VCPU is running before sending a doorbell.
>> However, the doorbell is not necessary if the destination
>> CPU is itself.
>>
>> Add logic to check currently running CPU before sending doorbell.
>>
>> Signed-off-by: Suravee Suthikulpanit <suravee.suthikulpanit@amd.com>
> 
> Reviewed-by: Alexander Graf <graf@amazon.com>

Thanks.

>> ---
>>   arch/x86/kvm/svm.c | 11 +++++++----
>>   1 file changed, 7 insertions(+), 4 deletions(-)
>>
>> diff --git a/arch/x86/kvm/svm.c b/arch/x86/kvm/svm.c
>> index 122788f..4bbf6fc 100644
>> --- a/arch/x86/kvm/svm.c
>> +++ b/arch/x86/kvm/svm.c
>> @@ -5283,10 +5283,13 @@ static void svm_deliver_avic_intr(struct kvm_vcpu *vcpu, int vec)
>>       kvm_lapic_set_irr(vec, vcpu->arch.apic);
>>       smp_mb__after_atomic();
>>
>> -     if (avic_vcpu_is_running(vcpu))
>> -             wrmsrl(SVM_AVIC_DOORBELL,
>> -                    kvm_cpu_get_apicid(vcpu->cpu));
>> -     else
>> +     if (avic_vcpu_is_running(vcpu)) { > +           int cpuid = vcpu->cpu;
>> +
>> +             if (cpuid != get_cpu())
> 
> Tiny nitpick: What would keep you from checking vcpu->cpu directly here?

Nothing. Just coding style.

Thanks,
Suravee

  reply	other threads:[~2019-05-14 15:52 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-03 13:38 Suthikulpanit, Suravee
2019-05-07 13:16 ` Graf, Alexander
2019-05-14 15:52   ` Suthikulpanit, Suravee [this message]
2019-05-20 12:56 ` Paolo Bonzini

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=bf389c60-1e47-80c1-43cc-9211a729b693@amd.com \
    --to=suravee.suthikulpanit@amd.com \
    --cc=graf@amazon.com \
    --cc=joro@8bytes.org \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=pbonzini@redhat.com \
    --cc=rkrcmar@redhat.com \
    /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

all inboxes | Powered by JetHome®