* + mm-page_table_check-move-pxx_user_accessible_page-into-x86.patch added to -mm tree
@ 2022-04-21 20:36 Andrew Morton
0 siblings, 0 replies; only message in thread
From: Andrew Morton @ 2022-04-21 20:36 UTC (permalink / raw)
To: mm-commits, will, tongtiangen, tglx, paul.walmsley,
pasha.tatashin, palmer, mingo, hpa, guohanjun, dave.hansen,
catalin.marinas, bp, aou, anshuman.khandual, wangkefeng.wang,
akpm
The patch titled
Subject: mm: page_table_check: move pxx_user_accessible_page into x86
has been added to the -mm tree. Its filename is
mm-page_table_check-move-pxx_user_accessible_page-into-x86.patch
This patch should soon appear at
https://ozlabs.org/~akpm/mmots/broken-out/mm-page_table_check-move-pxx_user_accessible_page-into-x86.patch
and later at
https://ozlabs.org/~akpm/mmotm/broken-out/mm-page_table_check-move-pxx_user_accessible_page-into-x86.patch
Before you just go and hit "reply", please:
a) Consider who else should be cc'ed
b) Prefer to cc a suitable mailing list as well
c) Ideally: find the original patch on the mailing list and do a
reply-to-all to that, adding suitable additional cc's
*** Remember to use Documentation/process/submit-checklist.rst when testing your code ***
The -mm tree is included into linux-next and is updated
there every 3-4 working days
------------------------------------------------------
From: Kefeng Wang <wangkefeng.wang@huawei.com>
Subject: mm: page_table_check: move pxx_user_accessible_page into x86
The pxx_user_accessible_page() check the PTE bit, it's
architecture-specific code, move them into x86's pgtable.h,
Link: https://lkml.kernel.org/r/20220421082042.1167967-3-tongtiangen@huawei.com
Signed-off-by: Kefeng Wang <wangkefeng.wang@huawei.com>
Signed-off-by: Tong Tiangen <tongtiangen@huawei.com>
Acked-by: Pasha Tatashin <pasha.tatashin@soleen.com>
Cc: Albert Ou <aou@eecs.berkeley.edu>
Cc: Anshuman Khandual <anshuman.khandual@arm.com>
Cc: Borislav Petkov <bp@alien8.de>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Dave Hansen <dave.hansen@linux.intel.com>
Cc: Guohanjun <guohanjun@huawei.com>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Palmer Dabbelt <palmer@dabbelt.com>
Cc: Paul Walmsley <paul.walmsley@sifive.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Will Deacon <will@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---
arch/x86/include/asm/pgtable.h | 19 +++++++++++++++++++
mm/page_table_check.c | 17 -----------------
2 files changed, 19 insertions(+), 17 deletions(-)
--- a/arch/x86/include/asm/pgtable.h~mm-page_table_check-move-pxx_user_accessible_page-into-x86
+++ a/arch/x86/include/asm/pgtable.h
@@ -1430,6 +1430,25 @@ static inline bool arch_faults_on_old_pt
return false;
}
+#ifdef CONFIG_PAGE_TABLE_CHECK
+static inline bool pte_user_accessible_page(pte_t pte)
+{
+ return (pte_val(pte) & _PAGE_PRESENT) && (pte_val(pte) & _PAGE_USER);
+}
+
+static inline bool pmd_user_accessible_page(pmd_t pmd)
+{
+ return pmd_leaf(pmd) && (pmd_val(pmd) & _PAGE_PRESENT) &&
+ (pmd_val(pmd) & _PAGE_USER);
+}
+
+static inline bool pud_user_accessible_page(pud_t pud)
+{
+ return pud_leaf(pud) && (pud_val(pud) & _PAGE_PRESENT) &&
+ (pud_val(pud) & _PAGE_USER);
+}
+#endif
+
#endif /* __ASSEMBLY__ */
#endif /* _ASM_X86_PGTABLE_H */
--- a/mm/page_table_check.c~mm-page_table_check-move-pxx_user_accessible_page-into-x86
+++ a/mm/page_table_check.c
@@ -52,23 +52,6 @@ static struct page_table_check *get_page
return (void *)(page_ext) + page_table_check_ops.offset;
}
-static inline bool pte_user_accessible_page(pte_t pte)
-{
- return (pte_val(pte) & _PAGE_PRESENT) && (pte_val(pte) & _PAGE_USER);
-}
-
-static inline bool pmd_user_accessible_page(pmd_t pmd)
-{
- return pmd_leaf(pmd) && (pmd_val(pmd) & _PAGE_PRESENT) &&
- (pmd_val(pmd) & _PAGE_USER);
-}
-
-static inline bool pud_user_accessible_page(pud_t pud)
-{
- return pud_leaf(pud) && (pud_val(pud) & _PAGE_PRESENT) &&
- (pud_val(pud) & _PAGE_USER);
-}
-
/*
* An enty is removed from the page table, decrement the counters for that page
* verify that it is of correct type and counters do not become negative.
_
Patches currently in -mm which might be from wangkefeng.wang@huawei.com are
mm-page_table_check-move-pxx_user_accessible_page-into-x86.patch
arm64-mm-add-support-for-page-table-check.patch
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2022-04-21 20:36 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-21 20:36 + mm-page_table_check-move-pxx_user_accessible_page-into-x86.patch added to -mm tree Andrew Morton
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).