All of lore.kernel.org
 help / color / mirror / Atom feed
From: Kechen Lu <kechenl@nvidia.com>
To: Vitaly Kuznetsov <vkuznets@redhat.com>,
	Paolo Bonzini <pbonzini@redhat.com>
Cc: "suravee.suthikulpanit@amd.com" <suravee.suthikulpanit@amd.com>,
	"Somdutta Roy" <somduttar@nvidia.com>,
	"kvm@vger.kernel.org" <kvm@vger.kernel.org>,
	"qemu-discuss@nongnu.org" <qemu-discuss@nongnu.org>
Subject: RE: Optimized clocksource with AMD AVIC enabled for Windows guest
Date: Fri, 5 Feb 2021 05:38:33 +0000	[thread overview]
Message-ID: <DM6PR12MB350095499FBD665AA7D969A2CAB29@DM6PR12MB3500.namprd12.prod.outlook.com> (raw)
In-Reply-To: <87tuqroo7g.fsf@vitty.brq.redhat.com>

Cool! Thanks for correction, yeah, APICV_INHIBIT_REASON_HYPERV setting is per-VM while synic is per-vCPU. Since the machine with AVIC is not in my hands today, I will test it hopefully by end of this week:)

BR,
Kechen

>-----Original Message-----
>From: Vitaly Kuznetsov <vkuznets@redhat.com>
>Sent: Thursday, February 4, 2021 7:19 AM
>To: Paolo Bonzini <pbonzini@redhat.com>; Kechen Lu <kechenl@nvidia.com>
>Cc: suravee.suthikulpanit@amd.com; Somdutta Roy <somduttar@nvidia.com>;
>kvm@vger.kernel.org; qemu-discuss@nongnu.org
>Subject: Re: Optimized clocksource with AMD AVIC enabled for Windows guest
>
>External email: Use caution opening links or attachments
>
>
>Vitaly Kuznetsov <vkuznets@redhat.com> writes:
>
>> +
>> +     auto_eoi_new = bitmap_weight(synic->auto_eoi_bitmap, 256);
>> +
>> +     /* Hyper-V SynIC auto EOI SINT's are not compatible with APICV */
>> +     if (!auto_eoi_old && auto_eoi_new) {
>> +             if (atomic_inc_return(&hv->synic_auto_eoi_used) == 1)
>> +                     kvm_request_apicv_update(vcpu->kvm, false,
>> +                                              APICV_INHIBIT_REASON_HYPERV);
>> +     } else if (!auto_eoi_old && auto_eoi_new) {
>
>Sigh, this 'else' should be
>
>} else if (!auto_eoi_new && auto_eoi_old) {
>
>...
>
>> +             if (atomic_dec_return(&hv->synic_auto_eoi_used) == 0)
>> +                     kvm_request_apicv_update(vcpu->kvm, true,
>> +                                              APICV_INHIBIT_REASON_HYPERV);
>> +     }
>>  }
>>
>>  static int synic_set_sint(struct kvm_vcpu_hv_synic *synic, int sint,
>> @@ -903,12 +923,6 @@ int kvm_hv_activate_synic(struct kvm_vcpu *vcpu,
>> bool dont_zero_synic_pages)  {
>>       struct kvm_vcpu_hv_synic *synic = vcpu_to_synic(vcpu);
>>
>> -     /*
>> -      * Hyper-V SynIC auto EOI SINT's are
>> -      * not compatible with APICV, so request
>> -      * to deactivate APICV permanently.
>> -      */
>> -     kvm_request_apicv_update(vcpu->kvm, false,
>APICV_INHIBIT_REASON_HYPERV);
>>       synic->active = true;
>>       synic->dont_zero_synic_pages = dont_zero_synic_pages;
>>       synic->control = HV_SYNIC_CONTROL_ENABLE;
>
>--
>Vitaly


  reply	other threads:[~2021-02-05  5:41 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-03  6:40 Optimized clocksource with AMD AVIC enabled for Windows guest Kechen Lu
2021-02-03  7:58 ` Paolo Bonzini
2021-02-03  9:15   ` Vitaly Kuznetsov
2021-02-04  2:05     ` Kechen Lu
2021-02-04 12:24       ` Vitaly Kuznetsov
2021-02-04 13:35         ` Paolo Bonzini
2021-02-04 15:01           ` Vitaly Kuznetsov
2021-02-04 15:19             ` Vitaly Kuznetsov
2021-02-05  5:38               ` Kechen Lu [this message]
2021-02-17 20:41                 ` Kechen Lu
2021-02-25 10:25                   ` 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=DM6PR12MB350095499FBD665AA7D969A2CAB29@DM6PR12MB3500.namprd12.prod.outlook.com \
    --to=kechenl@nvidia.com \
    --cc=kvm@vger.kernel.org \
    --cc=pbonzini@redhat.com \
    --cc=qemu-discuss@nongnu.org \
    --cc=somduttar@nvidia.com \
    --cc=suravee.suthikulpanit@amd.com \
    --cc=vkuznets@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.