historical-speck.lore.kernel.org archive mirror
 help / color / mirror / Atom feed
* [MODERATED] [PATCH] taa fix
@ 2019-11-07  2:26 Josh Poimboeuf
  2019-11-07  2:41 ` [MODERATED] " Tyler Hicks
  2019-11-07  9:25 ` Borislav Petkov
  0 siblings, 2 replies; 7+ messages in thread
From: Josh Poimboeuf @ 2019-11-07  2:26 UTC (permalink / raw)
  To: speck

[-- Attachment #1: Type: text/plain, Size: 1570 bytes --]

From: Josh Poimboeuf <jpoimboe@redhat.com>
Subject: [PATCH] x86/speculation/taa: Fix TAA_MSG_SMT printk

For new IBRS_ALL CPUs, the Enhanced IBRS check at the beginning of
cpu_bugs_smt_update() causes the function to return early,
unintentionally skipping the MDS and TAA logic.

I don't think it's a problem for MDS, because AFAICT there appears to be
no overlap between IBRS_ALL and MDS-affected CPUs.  So the MDS
mitigation would be disabled and nothing would need to be done in this
function anyway.

But for TAA, the TAA_MSG_SMT string will never get printed on Cascade
Lake and newer.

The check is superfluous anyway: when 'spectre_v2_enabled' is
SPECTRE_V2_IBRS_ENHANCED, 'spectre_v2_user' is always
SPECTRE_V2_USER_NONE, and so the 'spectre_v2_user' switch statement
handles it appropriately by doing nothing.  So just remove the check.

Fixes: 1b42f017415b ("x86/speculation/taa: Add mitigation for TSX Async Abort")
Signed-off-by: Josh Poimboeuf <jpoimboe@redhat.com>
---
 arch/x86/kernel/cpu/bugs.c | 4 ----
 1 file changed, 4 deletions(-)

diff --git a/arch/x86/kernel/cpu/bugs.c b/arch/x86/kernel/cpu/bugs.c
index 850005590167..4c7b0fa15a19 100644
--- a/arch/x86/kernel/cpu/bugs.c
+++ b/arch/x86/kernel/cpu/bugs.c
@@ -886,10 +886,6 @@ static void update_mds_branch_idle(void)
 
 void cpu_bugs_smt_update(void)
 {
-	/* Enhanced IBRS implies STIBP. No update required. */
-	if (spectre_v2_enabled == SPECTRE_V2_IBRS_ENHANCED)
-		return;
-
 	mutex_lock(&spec_ctrl_mutex);
 
 	switch (spectre_v2_user) {
-- 
2.20.1


[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 801 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [MODERATED] Re: [PATCH] taa fix
  2019-11-07  2:26 [MODERATED] [PATCH] taa fix Josh Poimboeuf
@ 2019-11-07  2:41 ` Tyler Hicks
  2019-11-07  9:25 ` Borislav Petkov
  1 sibling, 0 replies; 7+ messages in thread
From: Tyler Hicks @ 2019-11-07  2:41 UTC (permalink / raw)
  To: speck

On 2019-11-06 20:26:46, speck for Josh Poimboeuf wrote:
> From: Josh Poimboeuf <jpoimboe@redhat.com>
> Subject: [PATCH] x86/speculation/taa: Fix TAA_MSG_SMT printk
> 
> For new IBRS_ALL CPUs, the Enhanced IBRS check at the beginning of
> cpu_bugs_smt_update() causes the function to return early,
> unintentionally skipping the MDS and TAA logic.
> 
> I don't think it's a problem for MDS, because AFAICT there appears to be
> no overlap between IBRS_ALL and MDS-affected CPUs.  So the MDS
> mitigation would be disabled and nothing would need to be done in this
> function anyway.
> 
> But for TAA, the TAA_MSG_SMT string will never get printed on Cascade
> Lake and newer.
> 
> The check is superfluous anyway: when 'spectre_v2_enabled' is
> SPECTRE_V2_IBRS_ENHANCED, 'spectre_v2_user' is always
> SPECTRE_V2_USER_NONE, and so the 'spectre_v2_user' switch statement
> handles it appropriately by doing nothing.  So just remove the check.
> 
> Fixes: 1b42f017415b ("x86/speculation/taa: Add mitigation for TSX Async Abort")
> Signed-off-by: Josh Poimboeuf <jpoimboe@redhat.com>

Reviewed-by: Tyler Hicks <tyhicks@canonical.com>

I went back through my testing logs and verified that I didn't see the
TAA_MSG_SMT message printed on the Cascade Lake machine I tested with.
Thanks for noticing and fixing it.

Tyler

> ---
>  arch/x86/kernel/cpu/bugs.c | 4 ----
>  1 file changed, 4 deletions(-)
> 
> diff --git a/arch/x86/kernel/cpu/bugs.c b/arch/x86/kernel/cpu/bugs.c
> index 850005590167..4c7b0fa15a19 100644
> --- a/arch/x86/kernel/cpu/bugs.c
> +++ b/arch/x86/kernel/cpu/bugs.c
> @@ -886,10 +886,6 @@ static void update_mds_branch_idle(void)
>  
>  void cpu_bugs_smt_update(void)
>  {
> -	/* Enhanced IBRS implies STIBP. No update required. */
> -	if (spectre_v2_enabled == SPECTRE_V2_IBRS_ENHANCED)
> -		return;
> -
>  	mutex_lock(&spec_ctrl_mutex);
>  
>  	switch (spectre_v2_user) {
> -- 
> 2.20.1
> 

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [MODERATED] Re: [PATCH] taa fix
  2019-11-07  2:26 [MODERATED] [PATCH] taa fix Josh Poimboeuf
  2019-11-07  2:41 ` [MODERATED] " Tyler Hicks
@ 2019-11-07  9:25 ` Borislav Petkov
  2019-11-07 13:47   ` Josh Poimboeuf
  1 sibling, 1 reply; 7+ messages in thread
From: Borislav Petkov @ 2019-11-07  9:25 UTC (permalink / raw)
  To: speck

On Wed, Nov 06, 2019 at 08:26:46PM -0600, speck for Josh Poimboeuf wrote:
> From: Josh Poimboeuf <jpoimboe@redhat.com>
> Subject: [PATCH] x86/speculation/taa: Fix TAA_MSG_SMT printk

Subject should be something like "Print TAA_MSG_SMT on IBRS_ALL CPUs
too" or so.

> For new IBRS_ALL CPUs, the Enhanced IBRS check at the beginning of
> cpu_bugs_smt_update() causes the function to return early,
> unintentionally skipping the MDS and TAA logic.
> 
> I don't think it's a problem for MDS, because AFAICT there appears to be
> no overlap between IBRS_ALL and MDS-affected CPUs.  So the MDS
> mitigation would be disabled and nothing would need to be done in this
> function anyway.
> 
> But for TAA, the TAA_MSG_SMT string will never get printed on Cascade
> Lake and newer.
> 
> The check is superfluous anyway: when 'spectre_v2_enabled' is
> SPECTRE_V2_IBRS_ENHANCED, 'spectre_v2_user' is always
> SPECTRE_V2_USER_NONE, and so the 'spectre_v2_user' switch statement
> handles it appropriately by doing nothing.  So just remove the check.
> 
> Fixes: 1b42f017415b ("x86/speculation/taa: Add mitigation for TSX Async Abort")
> Signed-off-by: Josh Poimboeuf <jpoimboe@redhat.com>
> ---
>  arch/x86/kernel/cpu/bugs.c | 4 ----
>  1 file changed, 4 deletions(-)
> 
> diff --git a/arch/x86/kernel/cpu/bugs.c b/arch/x86/kernel/cpu/bugs.c
> index 850005590167..4c7b0fa15a19 100644
> --- a/arch/x86/kernel/cpu/bugs.c
> +++ b/arch/x86/kernel/cpu/bugs.c
> @@ -886,10 +886,6 @@ static void update_mds_branch_idle(void)
>  
>  void cpu_bugs_smt_update(void)
>  {
> -	/* Enhanced IBRS implies STIBP. No update required. */
> -	if (spectre_v2_enabled == SPECTRE_V2_IBRS_ENHANCED)
> -		return;
> -
>  	mutex_lock(&spec_ctrl_mutex);
>  
>  	switch (spectre_v2_user) {
> -- 

With that addressed:

Reviewed-by: Borislav Petkov <bp@suse.de>

-- 
Regards/Gruss,
    Boris.

SUSE Software Solutions Germany GmbH, GF: Felix Imendörffer, HRB 36809, AG Nürnberg
-- 

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [MODERATED] Re: [PATCH] taa fix
  2019-11-07  9:25 ` Borislav Petkov
@ 2019-11-07 13:47   ` Josh Poimboeuf
  2019-11-07 13:49     ` Borislav Petkov
  0 siblings, 1 reply; 7+ messages in thread
From: Josh Poimboeuf @ 2019-11-07 13:47 UTC (permalink / raw)
  To: speck

On Thu, Nov 07, 2019 at 10:25:33AM +0100, speck for Borislav Petkov wrote:
> On Wed, Nov 06, 2019 at 08:26:46PM -0600, speck for Josh Poimboeuf wrote:
> > From: Josh Poimboeuf <jpoimboe@redhat.com>
> > Subject: [PATCH] x86/speculation/taa: Fix TAA_MSG_SMT printk
> 
> Subject should be something like "Print TAA_MSG_SMT on IBRS_ALL CPUs
> too" or so.

The subject is indeed overly broad.  Though I wanted to highlight that
it's a fix.  How about

  x86/speculation/taa: Fix TAA_MSG_SMT printk on IBRS_ALL CPUs

?

-- 
Josh

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [MODERATED] Re: [PATCH] taa fix
  2019-11-07 13:47   ` Josh Poimboeuf
@ 2019-11-07 13:49     ` Borislav Petkov
  2019-11-07 14:59       ` Josh Poimboeuf
  0 siblings, 1 reply; 7+ messages in thread
From: Borislav Petkov @ 2019-11-07 13:49 UTC (permalink / raw)
  To: speck

On Thu, Nov 07, 2019 at 07:47:14AM -0600, speck for Josh Poimboeuf wrote:
> On Thu, Nov 07, 2019 at 10:25:33AM +0100, speck for Borislav Petkov wrote:
> > On Wed, Nov 06, 2019 at 08:26:46PM -0600, speck for Josh Poimboeuf wrote:
> > > From: Josh Poimboeuf <jpoimboe@redhat.com>
> > > Subject: [PATCH] x86/speculation/taa: Fix TAA_MSG_SMT printk
> > 
> > Subject should be something like "Print TAA_MSG_SMT on IBRS_ALL CPUs
> > too" or so.
> 
> The subject is indeed overly broad.  Though I wanted to highlight that
> it's a fix.  How about
> 
>   x86/speculation/taa: Fix TAA_MSG_SMT printk on IBRS_ALL CPUs
> 
> ?

Make that "Fix printing" and you're good.

Because it is not really fixing the printk but it is making it print
again. But we're bikeshedding...

:-)

-- 
Regards/Gruss,
    Boris.

SUSE Software Solutions Germany GmbH, GF: Felix Imendörffer, HRB 36809, AG Nürnberg
-- 

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [MODERATED] Re: [PATCH] taa fix
  2019-11-07 13:49     ` Borislav Petkov
@ 2019-11-07 14:59       ` Josh Poimboeuf
  2019-11-07 15:04         ` Thomas Gleixner
  0 siblings, 1 reply; 7+ messages in thread
From: Josh Poimboeuf @ 2019-11-07 14:59 UTC (permalink / raw)
  To: speck

On Thu, Nov 07, 2019 at 02:49:52PM +0100, speck for Borislav Petkov wrote:
> On Thu, Nov 07, 2019 at 07:47:14AM -0600, speck for Josh Poimboeuf wrote:
> > On Thu, Nov 07, 2019 at 10:25:33AM +0100, speck for Borislav Petkov wrote:
> > > On Wed, Nov 06, 2019 at 08:26:46PM -0600, speck for Josh Poimboeuf wrote:
> > > > From: Josh Poimboeuf <jpoimboe@redhat.com>
> > > > Subject: [PATCH] x86/speculation/taa: Fix TAA_MSG_SMT printk
> > > 
> > > Subject should be something like "Print TAA_MSG_SMT on IBRS_ALL CPUs
> > > too" or so.
> > 
> > The subject is indeed overly broad.  Though I wanted to highlight that
> > it's a fix.  How about
> > 
> >   x86/speculation/taa: Fix TAA_MSG_SMT printk on IBRS_ALL CPUs
> > 
> > ?
> 
> Make that "Fix printing" and you're good.

Fair enough.  I'll go with 

  x86/speculation/taa: Fix printing of TAA_MSG_SMT on IBRS_ALL CPUs

-- 
Josh

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] taa fix
  2019-11-07 14:59       ` Josh Poimboeuf
@ 2019-11-07 15:04         ` Thomas Gleixner
  0 siblings, 0 replies; 7+ messages in thread
From: Thomas Gleixner @ 2019-11-07 15:04 UTC (permalink / raw)
  To: speck

On Thu, 7 Nov 2019, speck for Josh Poimboeuf wrote:
> On Thu, Nov 07, 2019 at 02:49:52PM +0100, speck for Borislav Petkov wrote:
> > Make that "Fix printing" and you're good.
> 
> Fair enough.  I'll go with 
> 
>   x86/speculation/taa: Fix printing of TAA_MSG_SMT on IBRS_ALL CPUs

No need to resend. I already fixed it locally.

Thanks,

	tglx

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2019-11-07 15:04 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-11-07  2:26 [MODERATED] [PATCH] taa fix Josh Poimboeuf
2019-11-07  2:41 ` [MODERATED] " Tyler Hicks
2019-11-07  9:25 ` Borislav Petkov
2019-11-07 13:47   ` Josh Poimboeuf
2019-11-07 13:49     ` Borislav Petkov
2019-11-07 14:59       ` Josh Poimboeuf
2019-11-07 15:04         ` Thomas Gleixner

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).