linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Anshuman Khandual <anshuman.khandual@arm.com>
To: "Kirill A. Shutemov" <kirill@shutemov.name>
Cc: linux-mm@kvack.org, Thomas Gleixner <tglx@linutronix.de>,
	Ingo Molnar <mingo@redhat.com>, Borislav Petkov <bp@alien8.de>,
	"H. Peter Anvin" <hpa@zytor.com>,
	Dave Hansen <dave.hansen@intel.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	x86@kernel.org, linux-kernel@vger.kernel.org,
	Dan Williams <dan.j.williams@intel.com>
Subject: Re: [PATCH] x86/mm: Make pud_present() check _PAGE_PROTNONE and _PAGE_PSE as well
Date: Fri, 20 Mar 2020 18:52:57 +0530	[thread overview]
Message-ID: <2e7a04cf-80cb-58c1-7344-2f8422ed7d31@arm.com> (raw)
In-Reply-To: <20200320114741.c62iolt2yzltnscf@box>



On 03/20/2020 05:17 PM, Kirill A. Shutemov wrote:
> On Fri, Mar 20, 2020 at 08:53:16AM +0530, Anshuman Khandual wrote:
>>
>>
>> On 03/18/2020 10:31 AM, Anshuman Khandual wrote:
>>> pud_present() should also check _PAGE_PROTNONE and _PAGE_PSE bits like in
>>> case pmd_present(). This makes a PUD entry test positive for pud_present()
>>> after getting invalidated with pud_mknotpresent(), hence standardizing the
>>> semantics with PMD helpers.
>>>
>>> Cc: Thomas Gleixner <tglx@linutronix.de>
>>> Cc: Ingo Molnar <mingo@redhat.com>
>>> Cc: Borislav Petkov <bp@alien8.de>
>>> Cc: "H. Peter Anvin" <hpa@zytor.com>
>>> Cc: Dave Hansen <dave.hansen@intel.com>
>>> Cc: Andrew Morton <akpm@linux-foundation.org>
>>> Cc: x86@kernel.org
>>> Cc: linux-mm@kvack.org
>>> Cc: linux-kernel@vger.kernel.org
>>> Signed-off-by: Anshuman Khandual <anshuman.khandual@arm.com>
>>> ---
>>> Even though pud_mknotpresent() is not used any where currently, there is
>>> a discrepancy between PMD and PUD.
>>>
>>> WARN_ON(!pud_present(pud_mknotpresent(pud_mkhuge(pud)))) -> Fail
>>> WARN_ON(!pmd_present(pmd_mknotpresent(pmd_mkhuge(pmd)))) -> Pass
>>>
>>> Though pud_mknotpresent() currently clears _PAGE_PROTNONE, pud_present()
>>> does not check it. This change fixes both inconsistencies.
>>>
>>> This has been build and boot tested on x86.
>>
>> Adding Kirill and Dan.
>>
>> +Cc: Kirill A. Shutemov <kirill@shutemov.name>
>> +Cc: Dan Williams <dan.j.williams@intel.com>
> 
> Or we can just drop the pud_mknotpresent(). There's no users AFAICS and
> only x86 provides it.

Yes that will be an option but IMHO fixing pud_present() here might be
a better choice because,

(1) pud_mknotpresent() with fixed pud_present() might be required later
(2) PMD & PUD will be exact same (THP is supported on either level)

Nonetheless, I am happy to go either way.


  reply	other threads:[~2020-03-20 13:23 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-18  5:01 Anshuman Khandual
2020-03-20  3:23 ` Anshuman Khandual
2020-03-20 11:47   ` Kirill A. Shutemov
2020-03-20 13:22     ` Anshuman Khandual [this message]
2020-03-20 19:50       ` John Hubbard
2020-03-22  1:00         ` Anshuman Khandual

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=2e7a04cf-80cb-58c1-7344-2f8422ed7d31@arm.com \
    --to=anshuman.khandual@arm.com \
    --cc=akpm@linux-foundation.org \
    --cc=bp@alien8.de \
    --cc=dan.j.williams@intel.com \
    --cc=dave.hansen@intel.com \
    --cc=hpa@zytor.com \
    --cc=kirill@shutemov.name \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mingo@redhat.com \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox