All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dave Hansen <dave.hansen@linux.intel.com>
To: Linus Torvalds <torvalds@linux-foundation.org>,
	Thomas Gleixner <tglx@linutronix.de>
Cc: Dominik Brodowski <linux@dominikbrodowski.net>,
	Andy Lutomirski <luto@kernel.org>,
	LKML <linux-kernel@vger.kernel.org>,
	the arch/x86 maintainers <x86@kernel.org>
Subject: Re: x86/pti: smp_processor_id() called while preemptible in resume-from-sleep
Date: Sat, 30 Dec 2017 11:03:30 -0800	[thread overview]
Message-ID: <dbbfefd1-43d8-07af-dea7-c453650ab1d5@linux.intel.com> (raw)
In-Reply-To: <CA+55aFybDbanqpA2eSy1oSCUj9a8RPuAgQYEZN8c+Rfege1a3Q@mail.gmail.com>

On 12/30/2017 10:40 AM, Linus Torvalds wrote:
> The __native_flush_tlb() function looks _very_ broken.
...
> So I'd suggest moving the preempt_disable() up to the top of that
> function, regardless of whether we could then remove that seemingly
> stale TLB flush in that crazy
> smpboot_setup/restore_warm_reset_vector() dance...

If someone is calling __native_flush_tlb(), shouldn't they already be in
a state where they can't be preempted?  It's fundamentally a one-cpu
thing, both the actual CPU TLB flush _and_ the per-cpu variables.

It seems like we might want to _remove_ the explicit
preempt_dis/enable() from here:

        preempt_disable();
        native_write_cr3(__native_read_cr3());
        preempt_enable();

and add some warnings to ensure it's disabled when we enter
__native_flush_tlb().

  reply	other threads:[~2017-12-30 19:03 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-12-30 13:29 x86/pti: smp_processor_id() called while preemptible in resume-from-sleep Dominik Brodowski
2017-12-30 15:03 ` Thomas Gleixner
2017-12-30 15:30   ` Dominik Brodowski
2017-12-30 17:51     ` Dave Hansen
2017-12-30 18:21       ` Thomas Gleixner
2017-12-30 18:20     ` Thomas Gleixner
2017-12-30 18:40       ` Linus Torvalds
2017-12-30 19:03         ` Dave Hansen [this message]
2017-12-30 19:15           ` Linus Torvalds
2017-12-30 19:32             ` Andy Lutomirski
2017-12-30 19:41         ` Thomas Gleixner
2017-12-30 20:00           ` Linus Torvalds
2017-12-30 20:28         ` Thomas Gleixner
2017-12-30 20:45           ` Linus Torvalds
2017-12-30 20:47           ` Thomas Gleixner
2017-12-30 20:49             ` Linus Torvalds

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=dbbfefd1-43d8-07af-dea7-c453650ab1d5@linux.intel.com \
    --to=dave.hansen@linux.intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@dominikbrodowski.net \
    --cc=luto@kernel.org \
    --cc=tglx@linutronix.de \
    --cc=torvalds@linux-foundation.org \
    --cc=x86@kernel.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 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.