* [PATCH] x86/memory: Drop pud_mknotpresent()
@ 2020-03-23 1:05 Anshuman Khandual
2020-03-23 1:37 ` Baoquan He
` (3 more replies)
0 siblings, 4 replies; 5+ messages in thread
From: Anshuman Khandual @ 2020-03-23 1:05 UTC (permalink / raw)
To: linux-mm
Cc: jhubbard, Anshuman Khandual, Thomas Gleixner, Ingo Molnar,
Borislav Petkov, H. Peter Anvin, Dave Hansen, Kirill A . Shutemov,
Dan Williams, Andrew Morton, x86, linux-kernel
There is an inconsistency between PMD and PUD based THP page table helpers
like the following, as pud_present() does not test for _PAGE_PSE.
pmd_present(pmd_mknotpresent(pmd)) : True
pud_present(pud_mknotpresent(pud)) : False
This drops pud_mknotpresent() as there are no current users. If/when needed
back later, pud_present() will also have to fixed to accommodate _PAGE_PSE.
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: Kirill A. Shutemov <kirill@shutemov.name>
Cc: Dan Williams <dan.j.williams@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>
---
This has been build and boot tested on x86.
Changes in V2:
- Dropped pud_mknotpresent() instead per Kirill
Changes in V1: (https://patchwork.kernel.org/patch/11444529/)
arch/x86/include/asm/pgtable.h | 6 ------
1 file changed, 6 deletions(-)
diff --git a/arch/x86/include/asm/pgtable.h b/arch/x86/include/asm/pgtable.h
index 7e118660bbd9..d74dc560e3ab 100644
--- a/arch/x86/include/asm/pgtable.h
+++ b/arch/x86/include/asm/pgtable.h
@@ -595,12 +595,6 @@ static inline pmd_t pmd_mknotpresent(pmd_t pmd)
__pgprot(pmd_flags(pmd) & ~(_PAGE_PRESENT|_PAGE_PROTNONE)));
}
-static inline pud_t pud_mknotpresent(pud_t pud)
-{
- return pfn_pud(pud_pfn(pud),
- __pgprot(pud_flags(pud) & ~(_PAGE_PRESENT|_PAGE_PROTNONE)));
-}
-
static inline u64 flip_protnone_guard(u64 oldval, u64 val, u64 mask);
static inline pte_t pte_modify(pte_t pte, pgprot_t newprot)
--
2.17.1
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH] x86/memory: Drop pud_mknotpresent()
2020-03-23 1:05 [PATCH] x86/memory: Drop pud_mknotpresent() Anshuman Khandual
@ 2020-03-23 1:37 ` Baoquan He
2020-03-23 3:25 ` Balbir Singh
` (2 subsequent siblings)
3 siblings, 0 replies; 5+ messages in thread
From: Baoquan He @ 2020-03-23 1:37 UTC (permalink / raw)
To: Anshuman Khandual
Cc: linux-mm, jhubbard, Thomas Gleixner, Ingo Molnar, Borislav Petkov,
H. Peter Anvin, Dave Hansen, Kirill A . Shutemov, Dan Williams,
Andrew Morton, x86, linux-kernel
On 03/23/20 at 06:35am, Anshuman Khandual wrote:
> There is an inconsistency between PMD and PUD based THP page table helpers
> like the following, as pud_present() does not test for _PAGE_PSE.
>
> pmd_present(pmd_mknotpresent(pmd)) : True
> pud_present(pud_mknotpresent(pud)) : False
>
> This drops pud_mknotpresent() as there are no current users. If/when needed
> back later, pud_present() will also have to fixed to accommodate _PAGE_PSE.
>
> 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: Kirill A. Shutemov <kirill@shutemov.name>
> Cc: Dan Williams <dan.j.williams@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>
> ---
> This has been build and boot tested on x86.
>
> Changes in V2:
>
> - Dropped pud_mknotpresent() instead per Kirill
>
> Changes in V1: (https://patchwork.kernel.org/patch/11444529/)
>
> arch/x86/include/asm/pgtable.h | 6 ------
> 1 file changed, 6 deletions(-)
>
> diff --git a/arch/x86/include/asm/pgtable.h b/arch/x86/include/asm/pgtable.h
> index 7e118660bbd9..d74dc560e3ab 100644
> --- a/arch/x86/include/asm/pgtable.h
> +++ b/arch/x86/include/asm/pgtable.h
> @@ -595,12 +595,6 @@ static inline pmd_t pmd_mknotpresent(pmd_t pmd)
> __pgprot(pmd_flags(pmd) & ~(_PAGE_PRESENT|_PAGE_PROTNONE)));
> }
>
> -static inline pud_t pud_mknotpresent(pud_t pud)
> -{
> - return pfn_pud(pud_pfn(pud),
> - __pgprot(pud_flags(pud) & ~(_PAGE_PRESENT|_PAGE_PROTNONE)));
> -}
> -
> static inline u64 flip_protnone_guard(u64 oldval, u64 val, u64 mask);
>
> static inline pte_t pte_modify(pte_t pte, pgprot_t newprot)
Reviewed-by: Baoquan He <bhe@redhat.com>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] x86/memory: Drop pud_mknotpresent()
2020-03-23 1:05 [PATCH] x86/memory: Drop pud_mknotpresent() Anshuman Khandual
2020-03-23 1:37 ` Baoquan He
@ 2020-03-23 3:25 ` Balbir Singh
2020-03-23 7:47 ` Kirill A. Shutemov
2020-03-23 20:29 ` Dave Hansen
3 siblings, 0 replies; 5+ messages in thread
From: Balbir Singh @ 2020-03-23 3:25 UTC (permalink / raw)
To: Anshuman Khandual, linux-mm
Cc: jhubbard, Thomas Gleixner, Ingo Molnar, Borislav Petkov,
H. Peter Anvin, Dave Hansen, Kirill A . Shutemov, Dan Williams,
Andrew Morton, x86, linux-kernel
[-- Attachment #1: Type: text/plain, Size: 1025 bytes --]
On 23/3/20 12:05 pm, Anshuman Khandual wrote:
> There is an inconsistency between PMD and PUD based THP page table helpers
> like the following, as pud_present() does not test for _PAGE_PSE.
>
> pmd_present(pmd_mknotpresent(pmd)) : True
> pud_present(pud_mknotpresent(pud)) : False
>
> This drops pud_mknotpresent() as there are no current users. If/when needed
> back later, pud_present() will also have to fixed to accommodate _PAGE_PSE.
>
> 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: Kirill A. Shutemov <kirill@shutemov.name>
> Cc: Dan Williams <dan.j.williams@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>
> ---
Makes sense
Acked-by: Balbir Singh <bsingharora@gmail.com>
[-- Attachment #2: pEpkey.asc --]
[-- Type: application/pgp-keys, Size: 2501 bytes --]
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] x86/memory: Drop pud_mknotpresent()
2020-03-23 1:05 [PATCH] x86/memory: Drop pud_mknotpresent() Anshuman Khandual
2020-03-23 1:37 ` Baoquan He
2020-03-23 3:25 ` Balbir Singh
@ 2020-03-23 7:47 ` Kirill A. Shutemov
2020-03-23 20:29 ` Dave Hansen
3 siblings, 0 replies; 5+ messages in thread
From: Kirill A. Shutemov @ 2020-03-23 7:47 UTC (permalink / raw)
To: Anshuman Khandual
Cc: linux-mm, jhubbard, Thomas Gleixner, Ingo Molnar, Borislav Petkov,
H. Peter Anvin, Dave Hansen, Dan Williams, Andrew Morton, x86,
linux-kernel
On Mon, Mar 23, 2020 at 06:35:42AM +0530, Anshuman Khandual wrote:
> There is an inconsistency between PMD and PUD based THP page table helpers
> like the following, as pud_present() does not test for _PAGE_PSE.
>
> pmd_present(pmd_mknotpresent(pmd)) : True
> pud_present(pud_mknotpresent(pud)) : False
>
> This drops pud_mknotpresent() as there are no current users. If/when needed
> back later, pud_present() will also have to fixed to accommodate _PAGE_PSE.
>
> 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: Kirill A. Shutemov <kirill@shutemov.name>
> Cc: Dan Williams <dan.j.williams@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>
Acked-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
--
Kirill A. Shutemov
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] x86/memory: Drop pud_mknotpresent()
2020-03-23 1:05 [PATCH] x86/memory: Drop pud_mknotpresent() Anshuman Khandual
` (2 preceding siblings ...)
2020-03-23 7:47 ` Kirill A. Shutemov
@ 2020-03-23 20:29 ` Dave Hansen
3 siblings, 0 replies; 5+ messages in thread
From: Dave Hansen @ 2020-03-23 20:29 UTC (permalink / raw)
To: Anshuman Khandual, linux-mm
Cc: jhubbard, Thomas Gleixner, Ingo Molnar, Borislav Petkov,
H. Peter Anvin, Kirill A . Shutemov, Dan Williams, Andrew Morton,
x86, linux-kernel
Looks sane. 'git grep' confirms precisely zero references in the entire
tree.
Acked-by: Dave Hansen <dave.hansen@intel.com>
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2020-03-23 20:29 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-03-23 1:05 [PATCH] x86/memory: Drop pud_mknotpresent() Anshuman Khandual
2020-03-23 1:37 ` Baoquan He
2020-03-23 3:25 ` Balbir Singh
2020-03-23 7:47 ` Kirill A. Shutemov
2020-03-23 20:29 ` Dave Hansen
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).