mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Pawan Gupta <pawan.kumar.gupta@linux.intel.com>
To: "Kaplan, David" <David.Kaplan@amd.com>
Cc: "x86@kernel.org" <x86@kernel.org>,
	"H. Peter Anvin" <hpa@zytor.com>,
	Josh Poimboeuf <jpoimboe@kernel.org>,
	Sean Christopherson <seanjc@google.com>,
	Paolo Bonzini <pbonzini@redhat.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"kvm@vger.kernel.org" <kvm@vger.kernel.org>,
	Asit Mallick <asit.k.mallick@intel.com>,
	Tao Zhang <tao1.zhang@intel.com>
Subject: Re: [PATCH 2/2] x86/vmscape: Replace IBPB with branch history clear on exit to userspace
Date: Fri, 26 Sep 2025 09:14:59 -0700	[thread overview]
Message-ID: <20250926161459.gdcdag4gr6imeyfk@desk> (raw)
In-Reply-To: <LV3PR12MB9265B1C6D9D36408539B68B9941EA@LV3PR12MB9265.namprd12.prod.outlook.com>

On Fri, Sep 26, 2025 at 01:39:37PM +0000, Kaplan, David wrote:
> > > > --- a/Documentation/admin-guide/kernel-parameters.txt
> > > > +++ b/Documentation/admin-guide/kernel-parameters.txt
> > > > @@ -8048,9 +8048,11 @@
> > > >
> > > >                         off             - disable the mitigation
> > > >                         ibpb            - use Indirect Branch Prediction Barrier
> > > > -                                         (IBPB) mitigation (default)
> > > > +                                         (IBPB) mitigation
> > > >                         force           - force vulnerability detection even on
> > > >                                           unaffected processors
> > > > +                       auto            - (default) automatically select IBPB
> > > > +                                         or BHB clear mitigation based on CPU
> > >
> > > Many of the other bugs (like srso, l1tf, bhi, etc.) do not have explicit
> > > 'auto' options as 'auto' is implied by the lack of an explicit option.
> > > Is there really value in creating an explicit 'auto' option here?
> >
> > Hmm, so to get the BHB clear mitigation do we advise the users to remove
> > the vmscape= parameter? That feels a bit weird to me. Also, with
> > CONFIG_MITIGATION_VMSCAPE=n a user can get IBPB mitigation with
> > vmscape=ibpb, but there is no way to get the BHB clear mitigation.
> >
> 
> Maybe a better solution instead is to add a new option 'vmscape=on'.
> 
> If we look at the other most recently added bugs like TSA and ITS,
> neither have an explicit 'auto' cmdline option.  But they do have 'on'
> cmdline options.
> 
> The difference between 'auto' and 'on' is that 'auto' defers to the
> attack vector controls while 'on' means 'enable this mitigation if the
> CPU is vulnerable' (as opposed to 'force' which will enable it even if
> not vulnerable).
> 
> An explicit 'vmscape=on' could give users an option to ensure the
> mitigation is used (regardless of attack vectors) and could choose the
> best mitigation (BHB clear if available, otherwise IBPB).
> 
> I'd still advise users to not specify any option here unless they know
> what they're doing.  But an 'on' option would arguably be more consistent
> with the other recent bugs and maybe meets the needs you're after?

Sounds good to me. I'll update the patch.

  reply	other threads:[~2025-09-26 16:15 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-09-25  3:09 [PATCH 0/2] VMSCAPE optimization for BHI variant Pawan Gupta
2025-09-25  3:09 ` [PATCH 1/2] x86/bhi: Add BHB clearing for CPUs with larger branch history Pawan Gupta
2025-09-25 17:54   ` Jim Mattson
2025-09-25 20:49     ` Pawan Gupta
2025-09-25  3:09 ` [PATCH 2/2] x86/vmscape: Replace IBPB with branch history clear on exit to userspace Pawan Gupta
2025-09-25 18:14   ` Kaplan, David
2025-09-25 22:02     ` Pawan Gupta
2025-09-25 22:26       ` Pawan Gupta
2025-09-26 13:39       ` Kaplan, David
2025-09-26 16:14         ` Pawan Gupta [this message]
2025-09-29  5:12 ` [PATCH 0/2] VMSCAPE optimization for BHI variant Jack Wang
2025-09-30  1:22 ` Pawan Gupta
2025-10-01  8:12   ` Jinpu Wang

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=20250926161459.gdcdag4gr6imeyfk@desk \
    --to=pawan.kumar.gupta@linux.intel.com \
    --cc=David.Kaplan@amd.com \
    --cc=asit.k.mallick@intel.com \
    --cc=hpa@zytor.com \
    --cc=jpoimboe@kernel.org \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=pbonzini@redhat.com \
    --cc=seanjc@google.com \
    --cc=tao1.zhang@intel.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

all inboxes | Powered by JetHome®