All of lore.kernel.org
 help / color / mirror / Atom feed
From: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
To: speck@linutronix.de
Subject: [MODERATED] Re: [PATCH v4 8/8] [PATCH v4 8/8] Linux Patch #8
Date: Wed, 27 Jun 2018 10:43:26 -0400	[thread overview]
Message-ID: <20180627144326.GD21873@char.US.ORACLE.com> (raw)
In-Reply-To: <alpine.DEB.2.21.1806271459420.17787@nanos.tec.linutronix.de>

On Wed, Jun 27, 2018 at 03:05:02PM +0200, speck for Thomas Gleixner wrote:
> On Sat, 23 Jun 2018, speck for konrad.wilk_at_oracle.com wrote:
> > x86/KVM/VMX: Use MSR save list for IA32_FLUSH_CMD if required.
> > +
> > +	/*
> > +	 * If we enforce flushing the L1D cache on every VMENTER lets use the
> > +	 * MSR save list.
> > +	 */
> > +	if (vmx_l1d_cache_flush_req(&vmx->vcpu))
> > +		if (vmentry_l1d_flush == 2)
> > +			add_atomic_switch_msr(vmx, MSR_IA32_FLUSH_CMD,
> > +					      L1D_FLUSH, 0, true);
> 
> That's broken when the CPU does not have the FLUSH MSR, unless I'm missing
> something.

<nods>
It should have the check for the static_cpu_has(X86_FEATURE_FLUSH_L1D).

> 
> >  static void vmx_vcpu_reset(struct kvm_vcpu *vcpu, bool init_event)
> > @@ -10079,7 +10095,7 @@ static void __noclone vmx_vcpu_run(struct kvm_vcpu *vcpu)
> >  	evmcs_rsp = static_branch_unlikely(&enable_evmcs) ?
> >  		(unsigned long)&current_evmcs->host_rsp : 0;
> >  
> > -	if (vcpu->arch.flush_cache_req)
> > +	if (vcpu->arch.flush_cache_req && vmentry_l1d_flush != 1)
> >  		kvm_l1d_flush();
> 
> Huch? So above you use the MSR list for vmentry_l1d_flush == 2 and here you
> do the direct flush for vmentry_l1d_flush != 1. That should be == 1, right?

Yes in fact I vividely remember fixing this up as my debug patch has this
this extra logic (so that I could turn on/off the MSR list):

    if (vcpu->arch.flush_cache_req) {
+               if ((vmentry_l1d_flush == 2) && (!use_msr_save))
+                       kvm_l1d_flush();
+               else if (vmentry_l1d_flush == 1)
+                       kvm_l1d_flush();

and yet I managed to post the stale version. Arggh.


> 
> Thanks,
> 
> 	tglx

  reply	other threads:[~2018-06-27 14:43 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-06-23 13:54 [MODERATED] [PATCH v4 8/8] [PATCH v4 8/8] Linux Patch #8 konrad.wilk
2018-06-25 14:32 ` [MODERATED] " Paolo Bonzini
2018-06-27 13:05 ` Thomas Gleixner
2018-06-27 14:43   ` Konrad Rzeszutek Wilk [this message]
2018-06-27 17:00     ` Thomas Gleixner
2018-06-28 16:40       ` [MODERATED] " Konrad Rzeszutek Wilk

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=20180627144326.GD21873@char.US.ORACLE.com \
    --to=konrad.wilk@oracle.com \
    --cc=speck@linutronix.de \
    /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.