All of lore.kernel.org
 help / color / mirror / Atom feed
From: Borislav Petkov <bp@suse.de>
To: speck@linutronix.de
Subject: [MODERATED] Re: [PATCH v5 5/8] L1TFv4 0
Date: Thu, 24 May 2018 00:22:46 +0200	[thread overview]
Message-ID: <20180523222246.GC25143@pd.tnic> (raw)
In-Reply-To: <20180523215658.63CAB61104@crypto-ml.lab.linutronix.de>

On Wed, May 23, 2018 at 02:51:22PM -0700, speck for Andi Kleen wrote:
> From: Andi Kleen <ak@linux.intel.com>
> Subject:  x86, l1tf: Add sysfs reporting for l1tf
> 
> L1TF core kernel workarounds are cheap and normally always enabled,
> However we still want to report in sysfs if the system is vulnerable
> or mitigated. Add the necessary checks.
> 
> - We use the same checks as Meltdown to determine if the system is
> vulnerable. This excludes some Atom CPUs which don't have this
> problem.
> - We check for the (very unlikely) memory > MAX_PA/2 case
> - We check for 32bit non PAE and warn
> 
> Note this patch will likely conflict with some other workaround patches
> floating around, but should be straight forward to fix.

...

> diff --git a/arch/x86/kernel/cpu/bugs.c b/arch/x86/kernel/cpu/bugs.c
> index 7416fc206b4a..6b557f069a6f 100644
> --- a/arch/x86/kernel/cpu/bugs.c
> +++ b/arch/x86/kernel/cpu/bugs.c
> @@ -707,4 +707,15 @@ ssize_t cpu_show_spec_store_bypass(struct device *dev, struct device_attribute *
>  {
>  	return cpu_show_common(dev, attr, buf, X86_BUG_SPEC_STORE_BYPASS);
>  }
> +
> +ssize_t cpu_show_l1tf(struct device *dev, struct device_attribute *attr, char *buf)
> +{
> +	if (!boot_cpu_has_bug(X86_BUG_L1TF))
> +		return sprintf(buf, "Not affected\n");

In your other patches you should test the bug flag X86_BUG_L1TF like
here, not with boot_cpu_has().

It works now but we might enforce it someday.

> +
> +	if (boot_cpu_has(X86_FEATURE_L1TF_WA))
> +		return sprintf(buf, "Mitigated\n");
> +
> +	return sprintf(buf, "Vulnerable\n");
> +}

Make that cpu_show_l1tf() call cpu_show_common() like the others do.

-- 
Regards/Gruss,
    Boris.

SUSE Linux GmbH, GF: Felix Imendörffer, Jane Smithard, Graham Norton, HRB 21284 (AG Nürnberg)
-- 

  parent reply	other threads:[~2018-05-23 22:23 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-23 21:51 [MODERATED] [PATCH v5 0/8] L1TFv4 5 Andi Kleen
2018-05-23 21:51 ` [MODERATED] [PATCH v5 1/8] L1TFv4 6 Andi Kleen
2018-05-23 21:51 ` [MODERATED] [PATCH v5 2/8] L1TFv4 7 Andi Kleen
2018-05-23 21:51 ` [MODERATED] [PATCH v5 3/8] L1TFv4 2 Andi Kleen
2018-05-23 21:51 ` [MODERATED] [PATCH v5 4/8] L1TFv4 8 Andi Kleen
2018-05-23 21:51 ` [MODERATED] [PATCH v5 5/8] L1TFv4 0 Andi Kleen
2018-05-23 21:51 ` [MODERATED] [PATCH v5 6/8] L1TFv4 4 Andi Kleen
2018-05-23 21:51 ` [MODERATED] [PATCH v5 7/8] L1TFv4 3 Andi Kleen
2018-05-23 21:51 ` [MODERATED] [PATCH v5 8/8] L1TFv4 1 Andi Kleen
     [not found] ` <20180523215658.63CAB61104@crypto-ml.lab.linutronix.de>
2018-05-23 22:22   ` Borislav Petkov [this message]
     [not found] ` <20180523215726.A931B61157@crypto-ml.lab.linutronix.de>
2018-05-23 22:50   ` [MODERATED] " Dave Hansen
     [not found] ` <20180523215737.7C50E61169@crypto-ml.lab.linutronix.de>
2018-05-23 23:15   ` [MODERATED] Re: [PATCH v5 1/8] L1TFv4 6 Dave Hansen
2018-05-23 23:52     ` Andrew Cooper
2018-05-24  9:09     ` Michal Hocko
2018-05-24 15:26     ` Andi Kleen
2018-05-24 17:00       ` Dave Hansen
     [not found] ` <20180523215136.EB16B610ED@crypto-ml.lab.linutronix.de>
2018-05-24  3:34   ` [MODERATED] Re: [PATCH v5 4/8] L1TFv4 8 Josh Poimboeuf
     [not found] ` <20180523215651.BFF82610ED@crypto-ml.lab.linutronix.de>
2018-05-24  4:04   ` [MODERATED] Re: [PATCH v5 6/8] L1TFv4 4 Josh Poimboeuf
2018-05-24 13:35     ` Andi Kleen
2018-05-24 15:45       ` Josh Poimboeuf
2018-05-24 16:53         ` Andi Kleen
2018-05-24 17:53           ` Josh Poimboeuf
2018-05-24 20:32             ` Andi Kleen

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=20180523222246.GC25143@pd.tnic \
    --to=bp@suse.de \
    --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.