All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dan Williams <dan.j.williams@intel.com>
To: Dave Hansen <dave.hansen@intel.com>
Cc: Thomas Gleixner <tglx@linutronix.de>,
	"Kirill A. Shutemov" <kirill.shutemov@linux.intel.com>,
	Sebastian Andrzej Siewior <bigeasy@linutronix.de>,
	Peter Zijlstra <peterz@infradead.org>,
	Borislav Petkov <bp@alien8.de>, X86 ML <x86@kernel.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v2 3/5] generic/pgtable: Introduce set_pte_safe()
Date: Mon, 3 Dec 2018 09:57:09 -0800	[thread overview]
Message-ID: <CAPcyv4gLA_UryDZzdtAi-T=2x8io4V_2BwX_qTF7KS8Ff1Kb3A@mail.gmail.com> (raw)
In-Reply-To: <4bc8cab6-4e1a-c3b9-0023-3ecde932cc70@intel.com>

On Mon, Dec 3, 2018 at 9:53 AM Dave Hansen <dave.hansen@intel.com> wrote:
>
> On 11/30/18 4:35 PM, Dan Williams wrote:
> > +/*
> > + * The _safe versions of set_{pte,pmd,pud,p4d,pgd} validate that the
> > + * entry was not populated previously. I.e. for cases where a flush-tlb
> > + * is elided, double-check that there is no stale mapping to shoot down.
> > + */
>
> Functionally these look great to me.
>
> The only thing I'd suggest is to make the comment more about when to use
> these, instead of what they do:
>
>         Use the set_p*_safe() version when confident that *no*
>         TLB flush will be required as a result of the "set", such
>         as setting non-present entries or when possibly superfluously
>         re-setting an entry.

The second sentence was meant to be a "why", but yes, it's entirely too subtle.

  reply	other threads:[~2018-12-03 17:57 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-12-01  0:35 [PATCH v2 0/5] x86/mm: Drop usage of __flush_tlb_all() in kernel_physical_mapping_init() Dan Williams
2018-12-01  0:35 ` Dan Williams
2018-12-01  0:35 ` [PATCH v2 1/5] generic/pgtable: Make {pmd, pud}_same() unconditionally available Dan Williams
2018-12-01  0:35 ` [PATCH v2 2/5] generic/pgtable: Introduce {p4d,pgd}_same() Dan Williams
2018-12-01  0:35 ` [PATCH v2 3/5] generic/pgtable: Introduce set_pte_safe() Dan Williams
2018-12-03 17:53   ` Dave Hansen
2018-12-03 17:57     ` Dan Williams [this message]
2018-12-01  0:35 ` [PATCH v2 4/5] x86/mm: Validate kernel_physical_mapping_init() pte population Dan Williams
2018-12-01  0:35 ` [PATCH v2 5/5] x86/mm: Drop usage of __flush_tlb_all() in kernel_physical_mapping_init() Dan Williams
2018-12-01 10:27   ` Peter Zijlstra
2018-12-02  6:43   ` Sasha Levin
2018-12-02 17:04     ` Dan Williams
2018-12-03 17:18       ` Dave Hansen
2018-12-01 10:28 ` [PATCH v2 0/5] " Peter Zijlstra
2018-12-01 17:49   ` Dan Williams
2018-12-03  9:21 ` Kirill A. Shutemov

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='CAPcyv4gLA_UryDZzdtAi-T=2x8io4V_2BwX_qTF7KS8Ff1Kb3A@mail.gmail.com' \
    --to=dan.j.williams@intel.com \
    --cc=bigeasy@linutronix.de \
    --cc=bp@alien8.de \
    --cc=dave.hansen@intel.com \
    --cc=kirill.shutemov@linux.intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=peterz@infradead.org \
    --cc=tglx@linutronix.de \
    --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.