mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Thomas Gleixner <tglx@linutronix.de>
To: Borislav Petkov <bp@alien8.de>
Cc: Peter Zijlstra <peterz@infradead.org>,
	Steven Rostedt <rostedt@goodmis.org>,
	Jiri Olsa <jolsa@redhat.com>,
	"Paul E. McKenney" <paulmck@linux.vnet.ibm.com>,
	linux-kernel@vger.kernel.org, Ingo Molnar <mingo@kernel.org>,
	Josh Triplett <josh@joshtriplett.org>,
	Andi Kleen <andi@firstfloor.org>,
	Jan Stancek <jstancek@redhat.com>
Subject: Re: [BUG] msr-trace.h:42 suspicious rcu_dereference_check() usage!
Date: Wed, 30 Nov 2016 09:54:58 +0100 (CET)	[thread overview]
Message-ID: <alpine.DEB.2.20.1611300952380.3439@nanos> (raw)
In-Reply-To: <20161130084828.7jsi6r6pxztj5dmz@pd.tnic>

On Wed, 30 Nov 2016, Borislav Petkov wrote:
> On Tue, Nov 29, 2016 at 02:59:01PM +0100, Thomas Gleixner wrote:
> > The issue is that you obvioulsy start with the assumption, that the machine
> > has this bug. As a consequence the machine is brute forced into tick
> > broadcast mode, which cannot be reverted when you clear that misfeature
> > after ACPI init. So in case of !NOHZ and !HIGHRES the periodic tick is
> > forced into broadcast mode, which is not what you want.
> > 
> > As far as I understood the whole magic, this C1E misfeature takes only
> > effect _after_ ACPI has been initialized. So instead of setting the bug in
> > early boot and therefor forcing the broadcast nonsense, we should only set
> > it when ACPI has actually detected it.
> 
> Problem is, select_idle_routine() runs a lot earlier than acpi_init() so
> there's a window where we don't definitively know yet whether the box is
> actually going to enter C1E or not.
> 
>   [ I presume the reason why we have to do the proper detection after
>     ACPI has been initialized is because the frickelware decides whether
>     to do C1E entry or not and then sets those bits in the MSR (or not). ]
> 
> If in that window we enter idle and we're on an affected machine and we
> *don't* switch to broadcast mode, we risk not waking up from C1E, i.e.,
> the main reason this fix was even done.
> 
> So, if we "prematurely" switch to broadcast mode on the affected CPUs,
> we're ok, it will be detected properly later and we're in broadcast
> mode already.

Right, that's the safe bet. But I'm quite sure that the C1E crap only
starts to work _after_ ACPI initialization.

> Now, on those machines which are not affected and we clear
> X86_BUG_AMD_APIC_C1E because they don't enter C1E at all, I was thinking
> of maybe doing amd_e400_remove_cpu() and clearing that e400 mask and
> even freeing it so that they can do default_idle().
> 
> But you're saying tick_broadcast_enter() is irreversible?

tick_force_broadcast() is irreversible

Thanks,

	tglx
	

  reply	other threads:[~2016-11-30  8:58 UTC|newest]

Thread overview: 48+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-11-21  0:53 Jiri Olsa
2016-11-21  9:02 ` Paul E. McKenney
2016-11-21  9:43   ` Peter Zijlstra
2016-11-21 11:00     ` Paul E. McKenney
2016-11-21  9:28 ` Peter Zijlstra
2016-11-21  9:34   ` Jiri Olsa
2016-11-21  9:42     ` Peter Zijlstra
2016-11-21 11:22       ` Jiri Olsa
2016-11-21 11:31         ` Peter Zijlstra
2016-11-21 12:49           ` Jiri Olsa
2016-11-21 12:58     ` Peter Zijlstra
2016-11-21 14:15       ` Steven Rostedt
2016-11-21 14:37         ` Peter Zijlstra
2016-11-21 15:35           ` Borislav Petkov
2016-11-21 15:41             ` Peter Zijlstra
2016-11-21 16:06               ` Borislav Petkov
2016-11-29 13:16                 ` Borislav Petkov
2016-11-29 13:59                   ` Thomas Gleixner
2016-11-30  8:48                     ` Borislav Petkov
2016-11-30  8:54                       ` Thomas Gleixner [this message]
2016-11-30  9:07                         ` Borislav Petkov
2016-11-30  9:14                           ` Thomas Gleixner
2016-11-29 14:04                   ` Jiri Olsa
2016-11-21 14:20       ` Steven Rostedt
2016-11-21 17:06   ` Andi Kleen
2016-11-21 17:18     ` Peter Zijlstra
2016-11-21 17:45       ` Andi Kleen
2016-11-21 18:01         ` Steven Rostedt
2016-11-21 18:06           ` Andi Kleen
2016-11-21 18:22             ` Steven Rostedt
2016-11-21 18:37               ` Andi Kleen
2016-11-21 19:06                 ` Steven Rostedt
2016-11-21 19:15                 ` Steven Rostedt
2016-11-21 20:44                   ` Andi Kleen
2016-11-22  8:19                     ` Paul E. McKenney
2016-11-22 14:39                 ` Steven Rostedt
2016-11-22 19:05                   ` Andi Kleen
2016-11-24  2:06                 ` Steven Rostedt
2016-11-28 21:48                   ` Andi Kleen
2016-11-28 22:46                     ` Steven Rostedt
2016-11-28 23:10                       ` Andi Kleen
2016-11-21 17:55       ` Steven Rostedt
2016-11-21 18:24         ` Steven Rostedt
2016-11-21 20:12           ` Paul E. McKenney
2017-02-23 12:24   ` Jiri Olsa
2017-02-23 17:11     ` Andi Kleen
2017-02-23 17:28     ` Peter Zijlstra
2017-02-23 17:56       ` Borislav Petkov

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=alpine.DEB.2.20.1611300952380.3439@nanos \
    --to=tglx@linutronix.de \
    --cc=andi@firstfloor.org \
    --cc=bp@alien8.de \
    --cc=jolsa@redhat.com \
    --cc=josh@joshtriplett.org \
    --cc=jstancek@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=paulmck@linux.vnet.ibm.com \
    --cc=peterz@infradead.org \
    --cc=rostedt@goodmis.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®