All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Roger Pau Monné" <roger.pau@citrix.com>
To: Jan Beulich <jbeulich@suse.com>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
	xen-devel@lists.xenproject.org
Subject: Re: [PATCH] x86/spec: fix reporting of BHB clearing usage from guest entry points
Date: Thu, 18 Apr 2024 17:28:28 +0200	[thread overview]
Message-ID: <ZiE8HGEW5l0SPaNt@macbook> (raw)
In-Reply-To: <cc211dbe-9d95-46aa-8167-558acac7a3d3@suse.com>

On Thu, Apr 18, 2024 at 12:44:26PM +0200, Jan Beulich wrote:
> On 15.04.2024 16:17, Roger Pau Monne wrote:
> > --- a/xen/arch/x86/spec_ctrl.c
> > +++ b/xen/arch/x86/spec_ctrl.c
> > @@ -643,7 +643,7 @@ static void __init print_details(enum ind_thunk thunk)
> >             opt_eager_fpu                             ? " EAGER_FPU"     : "",
> >             opt_verw_hvm                              ? " VERW"          : "",
> >             boot_cpu_has(X86_FEATURE_IBPB_ENTRY_HVM)  ? " IBPB-entry"    : "",
> > -           cpu_has_bhb_seq                           ? " BHB-entry"     : "");
> > +           opt_bhb_entry_hvm                         ? " BHB-entry"     : "");
> >  
> >  #endif
> >  #ifdef CONFIG_PV
> > @@ -658,7 +658,7 @@ static void __init print_details(enum ind_thunk thunk)
> >             opt_eager_fpu                             ? " EAGER_FPU"     : "",
> >             opt_verw_pv                               ? " VERW"          : "",
> >             boot_cpu_has(X86_FEATURE_IBPB_ENTRY_PV)   ? " IBPB-entry"    : "",
> > -           cpu_has_bhb_seq                           ? " BHB-entry"     : "");
> > +           opt_bhb_entry_pv                          ? " BHB-entry"     : "");
> >  
> >      printk("  XPTI (64-bit PV only): Dom0 %s, DomU %s (with%s PCID)\n",
> >             opt_xpti_hwdom ? "enabled" : "disabled",
> 
> For one the surrounding if() conditions need similar adjustment.

Oh, I see, you mean the printing of "None" if no options are active.

> But then I wonder whether the further uses of cpu_has_bhb_seq don't
> need switching, too (when determining whether to force
> X86_SPEC_NO_LFENCE_ENTRY_*). At which point the question is why
> cpu_has_bhb_seq exists in the first place: It in particular does not
> affect the default calculation of opt_bhb_entry_*, afaics.

Hm, yes, that's indeed not very helpful.  The current code is overly
restrictive, as the lfence won't be elided even when the BHB sequence
is not being used by that specific guest type, as long as some
sequence is configured.  Will add a further patch to fix that and then
remove cpu_has_bhb_seq.

Thanks, Roger.


      reply	other threads:[~2024-04-18 15:28 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-15 14:17 [PATCH] x86/spec: fix reporting of BHB clearing usage from guest entry points Roger Pau Monne
2024-04-18 10:44 ` Jan Beulich
2024-04-18 15:28   ` Roger Pau Monné [this message]

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=ZiE8HGEW5l0SPaNt@macbook \
    --to=roger.pau@citrix.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=jbeulich@suse.com \
    --cc=xen-devel@lists.xenproject.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 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.