linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Wanpeng Li <kernellwp@gmail.com>
To: Peter Zijlstra <peterz@infradead.org>,
	Paolo Bonzini <pbonzini@redhat.com>
Cc: Sean Christopherson <sean.j.christopherson@intel.com>,
	Vitaly Kuznetsov <vkuznets@redhat.com>, kvm <kvm@vger.kernel.org>,
	"the arch/x86 maintainers" <x86@kernel.org>,
	Thomas Gleixner <tglx@linutronix.de>,
	Ingo Molnar <mingo@redhat.com>, Borislav Petkov <bp@alien8.de>,
	Jim Mattson <jmattson@google.com>,
	Liran Alon <liran.alon@oracle.com>,
	LKML <linux-kernel@vger.kernel.org>,
	"H. Peter Anvin" <hpa@zytor.com>
Subject: Re: [PATCH RFC] KVM: x86: tell guests if the exposed SMT topology is trustworthy
Date: Wed, 20 Nov 2019 18:13:41 +0800	[thread overview]
Message-ID: <CANRm+CxtE-jMCGbhfL5QSU9JDCFcytsF=KQD6QGzT22-5_ZS8A@mail.gmail.com> (raw)
In-Reply-To: <20191106083235.GP4131@hirez.programming.kicks-ass.net>

Hi Paolo,
On Wed, 6 Nov 2019 at 16:34, Peter Zijlstra <peterz@infradead.org> wrote:
>
> On Tue, Nov 05, 2019 at 03:25:28PM -0800, Sean Christopherson wrote:
> > On Tue, Nov 05, 2019 at 09:02:18PM +0100, Peter Zijlstra wrote:
> > > On Tue, Nov 05, 2019 at 05:17:37PM +0100, Vitaly Kuznetsov wrote:
> > > > Virtualized guests may pick a different strategy to mitigate hardware
> > > > vulnerabilities when it comes to hyper-threading: disable SMT completely,
> > > > use core scheduling, or, for example, opt in for STIBP. Making the
> > > > decision, however, requires an extra bit of information which is currently
> > > > missing: does the topology the guest see match hardware or if it is 'fake'
> > > > and two vCPUs which look like different cores from guest's perspective can
> > > > actually be scheduled on the same physical core. Disabling SMT or doing
> > > > core scheduling only makes sense when the topology is trustworthy.
> > > >
> > > > Add two feature bits to KVM: KVM_FEATURE_TRUSTWORTHY_SMT with the meaning
> > > > that KVM_HINTS_TRUSTWORTHY_SMT bit answers the question if the exposed SMT
> > > > topology is actually trustworthy. It would, of course, be possible to get
> > > > away with a single bit (e.g. 'KVM_FEATURE_FAKE_SMT') and not lose backwards
> > > > compatibility but the current approach looks more straightforward.
> > >
> > > The only way virt topology can make any sense what so ever is if the
> > > vcpus are pinned to physical CPUs.
> > >
> > > And I was under the impression we already had a bit for that (isn't it
> > > used to disable paravirt spinlocks and the like?). But I cannot seem to
> > > find it in a hurry.
> >
> > Yep, KVM_HINTS_REALTIME does what you describe.
>
> *sigh*, that's a pretty shit name for it :/

My original commit name this to KVM_HINTS_DEDICATED, commit a4429e53c
(KVM: Introduce paravirtualization hints and KVM_HINTS_DEDICATED),
could we revert the KVM_HINTS_REALTIME renaming? A lot of guys
confused by this renaming now, Peterz, Marcelo ("The previous
definition was much better IMO: HINTS_DEDICATED".
https://lkml.org/lkml/2019/8/26/855).

    Wanpeng

  reply	other threads:[~2019-11-20 10:13 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-11-05 16:17 [PATCH RFC] KVM: x86: tell guests if the exposed SMT topology is trustworthy Vitaly Kuznetsov
2019-11-05 17:17 ` Liran Alon
2019-11-05 17:30   ` Liran Alon
2019-11-05 17:35     ` Jim Mattson
2019-11-05 19:37 ` Sean Christopherson
2019-11-05 23:25   ` Sean Christopherson
2019-11-07 10:38     ` Vitaly Kuznetsov
     [not found]     ` <943488A8-2DD7-4471-B3C7-9F21A0B0BCF9@dinechin.org>
2019-11-07 15:02       ` Liran Alon
2019-11-08 15:35         ` Christophe de Dinechin
2019-11-08 15:52           ` Liran Alon
2019-11-05 20:02 ` Peter Zijlstra
2019-11-05 23:25   ` Sean Christopherson
2019-11-06  8:32     ` Peter Zijlstra
2019-11-20 10:13       ` Wanpeng Li [this message]
2019-11-05 23:51   ` Paolo Bonzini
2019-11-06  8:32     ` Peter Zijlstra
2019-11-06  9:41       ` Paolo Bonzini
2019-11-05 23:56 ` Paolo Bonzini
2019-12-06  4:01   ` Ankur Arora
2019-12-06 13:46     ` Vitaly Kuznetsov
2019-12-06 20:31       ` Ankur Arora
2019-12-09  9:15         ` 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='CANRm+CxtE-jMCGbhfL5QSU9JDCFcytsF=KQD6QGzT22-5_ZS8A@mail.gmail.com' \
    --to=kernellwp@gmail.com \
    --cc=bp@alien8.de \
    --cc=hpa@zytor.com \
    --cc=jmattson@google.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=liran.alon@oracle.com \
    --cc=mingo@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=peterz@infradead.org \
    --cc=sean.j.christopherson@intel.com \
    --cc=tglx@linutronix.de \
    --cc=vkuznets@redhat.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;
as well as URLs for NNTP newsgroup(s).