All of lore.kernel.org
 help / color / mirror / Atom feed
From: Tom Lendacky <thomas.lendacky@amd.com>
To: speck@linutronix.de
Subject: [MODERATED] Re: [patch 14/15] SSB updates V17 14
Date: Wed, 16 May 2018 11:34:43 -0500	[thread overview]
Message-ID: <9e62a5bd-8c4c-6cba-fc53-261b3c99409a@amd.com> (raw)
In-Reply-To: <20180516135210.495220211@linutronix.de>

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

On 05/16/2018 08:51 AM, speck for Thomas Gleixner wrote:

<snip>

> --- a/arch/x86/kernel/cpu/bugs.c
> +++ b/arch/x86/kernel/cpu/bugs.c
> @@ -154,6 +154,36 @@ x86_virt_spec_ctrl(u64 guest_spec_ctrl,
>  			wrmsrl(MSR_IA32_SPEC_CTRL, msrval);
>  		}
>  	}
> +
> +	/*
> +	 * If SSBD is not handled in MSR_SPEC_CTRL on AMD, update
> +	 * MSR_AMD64_L2_CFG or MSR_VIRT_SPEC_CTRL if supported.
> +	 */
> +	if (!static_cpu_has(X86_FEATURE_LS_CFG_SSBD) &&
> +	    !static_cpu_has(X86_FEATURE_VIRT_SSBD))
> +		return;
> +
> +	/*
> +	 * If the host has SSBD mitigation enabled, force it in the host's
> +	 * virtual MSR value. If its not permanently enabled, evaluate
> +	 * current's TIF_SSBD thread flag.
> +	 */
> +	if (static_cpu_has(X86_FEATURE_SPEC_STORE_BYPASS_DISABLE))
> +		hostsval = SPEC_CTRL_SSBD;

hostsval => hostval

Thanks,
Tom

> +	else
> +		hostval = ssbd_tif_to_spec_ctrl(ti->flags);
> +
> +	/* Sanitize the guest value */
> +	guestval = guest_virt_spec_ctrl & SPEC_CTRL_SSBD;
> +
> +	if (hostval != guestval) {
> +		unsigned long tif;
> +
> +		tif = setguest ? ssbd_spec_ctrl_to_tif(guestval) :
> +				 ssbd_spec_ctrl_to_tif(hostval);
> +
> +		speculative_store_bypass_update(tif);
> +	}
>  }
>  EXPORT_SYMBOL_GPL(x86_virt_spec_ctrl);
>  
> 


  reply	other threads:[~2018-05-16 16:35 UTC|newest]

Thread overview: 40+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-16 13:51 [patch 00/15] SSB updates V17 0 Thomas Gleixner
2018-05-16 13:51 ` [patch 01/15] SSB updates V17 1 Thomas Gleixner
2018-05-16 13:51 ` [patch 02/15] SSB updates V17 2 Thomas Gleixner
2018-05-16 14:29   ` [MODERATED] " Konrad Rzeszutek Wilk
2018-05-16 13:51 ` [patch 03/15] SSB updates V17 3 Thomas Gleixner
2018-05-17  1:06   ` [MODERATED] " Konrad Rzeszutek Wilk
2018-05-16 13:51 ` [patch 04/15] SSB updates V17 4 Thomas Gleixner
2018-05-17  1:14   ` [MODERATED] " Konrad Rzeszutek Wilk
2018-05-16 13:51 ` [patch 05/15] SSB updates V17 5 Thomas Gleixner
2018-05-17  1:14   ` [MODERATED] " Konrad Rzeszutek Wilk
2018-05-16 13:51 ` [patch 06/15] SSB updates V17 6 Thomas Gleixner
2018-05-17  1:28   ` [MODERATED] " Konrad Rzeszutek Wilk
2018-05-16 13:51 ` [patch 07/15] SSB updates V17 7 Thomas Gleixner
2018-05-17  1:29   ` [MODERATED] " Konrad Rzeszutek Wilk
2018-05-16 13:51 ` [patch 08/15] SSB updates V17 8 Thomas Gleixner
2018-05-16 21:13   ` [MODERATED] " Tom Lendacky
2018-05-17  2:56     ` Konrad Rzeszutek Wilk
2018-05-17 16:13       ` Tom Lendacky
2018-05-17 16:17         ` Paolo Bonzini
2018-05-17 16:23           ` Konrad Rzeszutek Wilk
2018-05-17 21:25           ` Tom Lendacky
2018-05-17 16:18         ` Tom Lendacky
2018-05-16 13:51 ` [patch 09/15] SSB updates V17 9 Thomas Gleixner
2018-05-17  1:40   ` [MODERATED] " Konrad Rzeszutek Wilk
2018-05-16 13:51 ` [patch 10/15] SSB updates V17 10 Thomas Gleixner
2018-05-17  1:43   ` [MODERATED] " Konrad Rzeszutek Wilk
2018-05-16 13:51 ` [patch 11/15] SSB updates V17 11 Thomas Gleixner
2018-05-17  1:45   ` [MODERATED] " Konrad Rzeszutek Wilk
2018-05-16 13:51 ` [patch 12/15] SSB updates V17 12 Thomas Gleixner
2018-05-16 13:51 ` [patch 13/15] SSB updates V17 13 Thomas Gleixner
2018-05-17  2:08   ` [MODERATED] " Konrad Rzeszutek Wilk
2018-05-17  8:45     ` Thomas Gleixner
2018-05-16 13:51 ` [patch 14/15] SSB updates V17 14 Thomas Gleixner
2018-05-16 16:34   ` Tom Lendacky [this message]
2018-05-16 21:26     ` Thomas Gleixner
2018-05-16 13:51 ` [patch 15/15] SSB updates V17 15 Thomas Gleixner
2018-05-17  2:18   ` [MODERATED] " Konrad Rzeszutek Wilk
2018-05-17 12:42     ` Paolo Bonzini
2018-05-17 15:09       ` Thomas Gleixner
2018-05-16 14:09 ` [patch 00/15] SSB updates V17 0 Thomas Gleixner

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=9e62a5bd-8c4c-6cba-fc53-261b3c99409a@amd.com \
    --to=thomas.lendacky@amd.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.