All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andi Kleen <ak@linux.intel.com>
To: speck@linutronix.de
Subject: [MODERATED] Re: [PATCH v5 6/8] L1TFv4 4
Date: Thu, 24 May 2018 06:35:45 -0700	[thread overview]
Message-ID: <20180524133545.GN4486@tassilo.jf.intel.com> (raw)
In-Reply-To: <20180524040438.3u66mkm2skcpg24w@treble>

On Wed, May 23, 2018 at 11:04:38PM -0500, speck for Josh Poimboeuf wrote:
> > index 2c0bd38a44ab..ffb178fe6356 100644
> > --- a/arch/x86/kernel/cpu/cpuid-deps.c
> > +++ b/arch/x86/kernel/cpu/cpuid-deps.c
> > @@ -118,4 +118,5 @@ void clear_cpu_cap(struct cpuinfo_x86 *c, unsigned int feature)
> >  void setup_clear_cpu_cap(unsigned int feature)
> >  {
> >  	do_clear_cpu_cap(NULL, feature);
> > +	clear_bit(feature, (unsigned long *)cpu_caps_set);
> 
> The caps code is a jungle, so who knows... but isn't this what
> cpu_caps_cleared is for?  Aren't the cpu_caps_set bits supposed to stay
> set (for some mysterious reason)?

Set beats cleared without this change. I tested it.

> 
> AFAICT, the cpu_caps_cleared bit already gets set in do_clear_cpu_cap()
> -> clear_feature().  So I don't see that clearing the cpu_caps_set bit
> actually accomplishes anything on top of that.

The patch is needed.

> 
> >  }
> > diff --git a/arch/x86/kernel/setup.c b/arch/x86/kernel/setup.c
> > index 443e31c33fa6..99155e9b28c4 100644
> > --- a/arch/x86/kernel/setup.c
> > +++ b/arch/x86/kernel/setup.c
> > @@ -785,7 +785,26 @@ static void __init trim_low_memory_range(void)
> >  {
> >  	memblock_reserve(0, ALIGN(reserve_low, PAGE_SIZE));
> >  }
> > -	
> > +
> > +static __init void check_maxpa_memory(void)
> > +{
> > +	u64 half_pa;
> > +
> > +	if (!boot_cpu_has(X86_BUG_L1TF))
> > +		return;
> > +
> > +	half_pa = (u64)l1tf_pfn_limit() << PAGE_SHIFT;
> > +
> > +	/*
> > +	 * This is extremely unlikely to happen because almost all systems have far
> > +	 * more MAX_PA/2 than DIMM slots.
> 
> s/DIMM slots/actual RAM/?

It's the same in this case.

> 
> Also is MAX_PA a macro or something else?  I don't see it in the code

It's a logical construct but doesn't correspond to a macro in the code.

-Andi

  reply	other threads:[~2018-05-24 13:35 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   ` [MODERATED] Re: [PATCH v5 5/8] L1TFv4 0 Borislav Petkov
     [not found] ` <20180523215726.A931B61157@crypto-ml.lab.linutronix.de>
2018-05-23 22:50   ` [MODERATED] Re: [PATCH v5 8/8] L1TFv4 1 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 [this message]
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=20180524133545.GN4486@tassilo.jf.intel.com \
    --to=ak@linux.intel.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.