mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Dave Hansen <dave.hansen@intel.com>
To: Thomas Gleixner <tglx@linutronix.de>, Borislav Petkov <bp@alien8.de>
Cc: Jike Song <albcamus@gmail.com>,
	linux-kernel@vger.kernel.org, David Woodhouse <dwmw@amazon.co.uk>,
	Alan Cox <gnomes@lxorguk.ukuu.org.uk>,
	Jiri Koshina <jikos@kernel.org>,
	Linus Torvalds <torvalds@linux-foundation.org>,
	Tim Chen <tim.c.chen@linux.intel.com>,
	Andi Lutomirski <luto@amacapital.net>,
	Andi Kleen <ak@linux.intel.com>,
	Peter Zijlstra <peterz@infradead.org>,
	Paul Turner <pjt@google.com>,
	Tom Lendacky <thomas.lendacky@amd.com>,
	Greg KH <gregkh@linux-foundation.org>,
	Kees Cook <keescook@google.com>,
	stable@vger.kernel.org
Subject: Re: [PATCH v2] x86/mm/pti: remove dead logic during user pagetable population
Date: Sun, 7 Jan 2018 10:34:11 -0800	[thread overview]
Message-ID: <58af26cd-dd39-a544-6449-e59d485bc551@intel.com> (raw)
In-Reply-To: <alpine.DEB.2.20.1801071303540.2094@nanos>

On 01/07/2018 04:05 AM, Thomas Gleixner wrote:
>> static DEFINE_SPINLOCK(shadow_table_allocation_lock);
>>
>> Now I have my suspicions why that's not needed anymore upstream but I'd
>> let tglx explain better.
> We got rid of all that runtime mapping stuff and the functions are only
> called from pti_init(). So the locking and therefor the tests above are not
> needed anymore. While at it we should mark all those function __init.

Yes, the double-test was part of an optimization where we attempted to
avoid using a global spinlock in the fork() path.  We would check for
unallocated mid-level page tables without the lock.  The lock was only
taken it when we needed to *make* an entry to avoid collisions.

Now that it is all single-threaded, there is no chance of a collision,
no need for a lock, and no need for the re-check.

^^ Just in case someone wants to include a bit more first-hand
information about wtf that code was doing there.

  reply	other threads:[~2018-01-07 18:34 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-07 10:33 Jike Song
2018-01-07 11:36 ` Borislav Petkov
2018-01-07 12:05   ` Thomas Gleixner
2018-01-07 18:34     ` Dave Hansen [this message]
2018-01-08 16:03     ` [PATCH v3] " Jike Song
2018-01-08 20:43       ` [tip:x86/pti] x86/mm/pti: Remove dead logic in pti_user_pagetable_walk*() tip-bot for Jike Song

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=58af26cd-dd39-a544-6449-e59d485bc551@intel.com \
    --to=dave.hansen@intel.com \
    --cc=ak@linux.intel.com \
    --cc=albcamus@gmail.com \
    --cc=bp@alien8.de \
    --cc=dwmw@amazon.co.uk \
    --cc=gnomes@lxorguk.ukuu.org.uk \
    --cc=gregkh@linux-foundation.org \
    --cc=jikos@kernel.org \
    --cc=keescook@google.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=luto@amacapital.net \
    --cc=peterz@infradead.org \
    --cc=pjt@google.com \
    --cc=stable@vger.kernel.org \
    --cc=tglx@linutronix.de \
    --cc=thomas.lendacky@amd.com \
    --cc=tim.c.chen@linux.intel.com \
    --cc=torvalds@linux-foundation.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

Powered by JetHome