All of lore.kernel.org
 help / color / mirror / Atom feed
From: Marcelo Tosatti <mtosatti@redhat.com>
To: Avi Kivity <avi@redhat.com>
Cc: Sheng Yang <sheng@linux.intel.com>,
	Jan Kiszka <jan.kiszka@siemens.com>,
	Joerg Roedel <joerg.roedel@amd.com>,
	kvm@vger.kernel.org, "Yaozu (Eddie) Dong" <eddie.dong@intel.com>
Subject: Re: [PATCH v5] KVM: VMX: Execute WBINVD to keep data consistency with assigned devices
Date: Tue, 29 Jun 2010 10:35:16 -0300	[thread overview]
Message-ID: <20100629133516.GC28951@amt.cnet> (raw)
In-Reply-To: <4C29F503.7020400@redhat.com>

On Tue, Jun 29, 2010 at 04:28:35PM +0300, Avi Kivity wrote:
> On 06/29/2010 04:25 PM, Marcelo Tosatti wrote:
> >
> >>+			smp_call_function_single(vcpu->cpu,
> >>+					wbinvd_ipi, NULL, 1);
> >>+	}
> >>+
> >>  	kvm_x86_ops->vcpu_load(vcpu, cpu);
> >>  	if (unlikely(per_cpu(cpu_tsc_khz, cpu) == 0)) {
> >>  		unsigned long khz = cpufreq_quick_get(cpu);
> >>@@ -3650,6 +3670,21 @@ int emulate_invlpg(struct kvm_vcpu *vcpu, gva_t address)
> >>  	return X86EMUL_CONTINUE;
> >>  }
> >>
> >>+int kvm_emulate_wbinvd(struct kvm_vcpu *vcpu)
> >>+{
> >>+	if (!need_emulate_wbinvd(vcpu))
> >>+		return X86EMUL_CONTINUE;
> >>+
> >>+	if (kvm_x86_ops->has_wbinvd_exit()) {
> >>+		smp_call_function_many(vcpu->arch.wbinvd_dirty_mask,
> >>+				wbinvd_ipi, NULL, 1);
> >work_on_cpu() loop instead of smp_call_function_many(), to avoid executing
> >wbinvd with interrupts disabled.
> 
> Why?  wbinvd is not interruptible.

Right. But still, smp_call_function_many() is going to busy-spin until
the target CPUs finish their work, while work_on_cpu() will schedule.

Also the IPI request has to handled immediately, bypassing the
scheduler.


  reply	other threads:[~2010-06-29 13:36 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-06-28  3:36 [PATCH v3] KVM: VMX: Execute WBINVD to keep data consistency with assigned devices Sheng Yang
2010-06-28  3:56 ` Avi Kivity
2010-06-28  6:42   ` Sheng Yang
2010-06-28  6:56     ` Avi Kivity
2010-06-28  6:56       ` Sheng Yang
2010-06-28  7:08         ` Avi Kivity
2010-06-28  7:41           ` Sheng Yang
2010-06-28  8:07             ` Avi Kivity
2010-06-28  8:42               ` [PATCH v4] " Sheng Yang
2010-06-28  9:27                 ` Avi Kivity
2010-06-28  9:31                   ` Gleb Natapov
2010-06-28  9:35                     ` Avi Kivity
2010-06-29  3:16                       ` [PATCH v5] " Sheng Yang
2010-06-29  9:39                         ` Avi Kivity
2010-06-29 10:32                           ` Jan Kiszka
2010-06-29 10:42                             ` Avi Kivity
2010-06-29 12:32                               ` Roedel, Joerg
2010-06-29 12:37                                 ` Avi Kivity
2010-06-29 10:14                         ` Roedel, Joerg
2010-06-29 10:44                           ` Avi Kivity
2010-06-29 12:28                             ` Roedel, Joerg
2010-06-29 12:35                               ` Avi Kivity
2010-06-29 13:34                                 ` Roedel, Joerg
2010-06-29 13:25                         ` Marcelo Tosatti
2010-06-29 13:28                           ` Avi Kivity
2010-06-29 13:35                             ` Marcelo Tosatti [this message]
2010-06-29 13:50                               ` Avi Kivity
2010-06-29 14:31                                 ` Marcelo Tosatti
2010-06-28  7:30       ` [PATCH v3] " Dong, Eddie
2010-06-28  8:04         ` Avi Kivity
2010-06-28  8:16           ` Dong, Eddie
2010-06-28  8:45             ` Jan Kiszka

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=20100629133516.GC28951@amt.cnet \
    --to=mtosatti@redhat.com \
    --cc=avi@redhat.com \
    --cc=eddie.dong@intel.com \
    --cc=jan.kiszka@siemens.com \
    --cc=joerg.roedel@amd.com \
    --cc=kvm@vger.kernel.org \
    --cc=sheng@linux.intel.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.