public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: "Wang,Guangju" <wangguangju@baidu.com>
To: Chao Gao <chao.gao@intel.com>, Sean Christopherson <seanjc@google.com>
Cc: "pbonzini@redhat.com" <pbonzini@redhat.com>,
	"vkuznets@redhat.com" <vkuznets@redhat.com>,
	"wanpengli@tencent.com" <wanpengli@tencent.com>,
	"jmattson@google.com" <jmattson@google.com>,
	"joro@8bytes.org" <joro@8bytes.org>,
	"kvm@vger.kernel.org" <kvm@vger.kernel.org>,
	"dave.hansen@linux.intel.co" <dave.hansen@linux.intel.co>,
	"tglx@linutronix.de" <tglx@linutronix.de>,
	"mingo@redhat.com" <mingo@redhat.com>,
	"x86@kernel.org" <x86@kernel.org>,
	"linux-kernel@vger.kernel.orga" <linux-kernel@vger.kernel.orga>
Subject: 答复: [PATCH] KVM: x86: add a bool variable to distinguish whether to use PVIPI
Date: Wed, 15 Jun 2022 04:21:21 +0000	[thread overview]
Message-ID: <aa618267a02c4ca9b10d75b5035b92d0@baidu.com> (raw)
In-Reply-To: <20220614150319.GA13174@gao-cwp>

>On Mon, Jun 13, 2022 at 05:16:48PM +0000, Sean Christopherson wrote:
>>The shortlog is not at all helpful, it doesn't say anything about what 
>>actual functional change.
>>
>>  KVM: x86: Don't advertise PV IPI to userspace if IPIs are virtualized
>>
>>On Mon, Jun 13, 2022, wangguangju wrote:
>>> Commit d588bb9be1da ("KVM: VMX: enable IPI virtualization") enable 
>> >IPI virtualization in Intel SPR platform.There is no point in using 
>> >PVIPI if IPIv is supported, it doesn't work less good with PVIPI than 
>> >without it.
>>> 
>> >So add a bool variable to distinguish whether to use PVIPI.
>>
>>Similar complaint with the changelog, it doesn't actually call out why 
>>PV IPIs are unwanted.
>>
>>  Don't advertise PV IPI support to userspace if IPI virtualization is  
> >supported by the CPU.  Hardware virtualization of IPIs more performant  
> >as senders do not need to exit.

>PVIPI is mainly [*] for sending multi-cast IPIs. Intel IPI virtualization can virtualize only uni-cast IPIs. Their use cases don't overlap. So, I don't think it makes sense to disable PVIPI if intel IPI virtualization is supported.
A question, like x2apic mode, guest uses PVIPI with replace apic->send_IPI_mask to kvm_send_ipi_mask. The original function implementation is __x2apic_send_IPI_mask , and it poll each CPU to send IPI. So in this case 
Intel virtualization can not work? Thanks.

static void
__x2apic_send_IPI_mask(const struct cpumask *mask, int vector, int apic_dest)
{
	unsigned long query_cpu;
	unsigned long this_cpu;
	unsigned long flags;

	/* x2apic MSRs are special and need a special fence: */
	weak_wrmsr_fence();

	local_irq_save(flags);

	this_cpu = smp_processor_id();
	for_each_cpu(query_cpu, mask) {
		if (apic_dest == APIC_DEST_ALLBUT && this_cpu == query_cpu)
			continue;
		__x2apic_send_IPI_dest(per_cpu(x86_cpu_to_apicid, query_cpu),
				       vector, APIC_DEST_PHYSICAL);
	}
	local_irq_restore(flags);
}

  reply	other threads:[~2022-06-15  4:37 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1655124522-42030-1-git-send-email-wangguangju@baidu.com>
2022-06-13 17:16 ` [PATCH] KVM: x86: add a bool variable to distinguish whether to use PVIPI Sean Christopherson
2022-06-14  2:54   ` Chao Gao
2022-06-14 14:41     ` Sean Christopherson
2022-06-14 15:03       ` Chao Gao
2022-06-15  4:21         ` Wang,Guangju [this message]
2022-06-15  5:33           ` 答复: " Chao Gao

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=aa618267a02c4ca9b10d75b5035b92d0@baidu.com \
    --to=wangguangju@baidu.com \
    --cc=chao.gao@intel.com \
    --cc=dave.hansen@linux.intel.co \
    --cc=jmattson@google.com \
    --cc=joro@8bytes.org \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.orga \
    --cc=mingo@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=seanjc@google.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