mirror of
https://github.com/torvalds/linux.git
synced 2024-11-10 06:01:57 +00:00
6cdc82db0c
Have ptdump_check_wx() return true when the check is successful or false otherwise. [akpm@linux-foundation.org: fix a couple of build issues (x86_64 allmodconfig)] Link: https://lkml.kernel.org/r/7943149fe955458cb7b57cd483bf41a3aad94684.1706610398.git.christophe.leroy@csgroup.eu Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu> Cc: Albert Ou <aou@eecs.berkeley.edu> Cc: Alexander Gordeev <agordeev@linux.ibm.com> Cc: Alexandre Ghiti <alexghiti@rivosinc.com> Cc: Andy Lutomirski <luto@kernel.org> Cc: "Aneesh Kumar K.V (IBM)" <aneesh.kumar@kernel.org> Cc: Borislav Petkov (AMD) <bp@alien8.de> Cc: Catalin Marinas <catalin.marinas@arm.com> Cc: Christian Borntraeger <borntraeger@linux.ibm.com> Cc: Dave Hansen <dave.hansen@linux.intel.com> Cc: Gerald Schaefer <gerald.schaefer@linux.ibm.com> Cc: Greg KH <greg@kroah.com> Cc: Heiko Carstens <hca@linux.ibm.com> Cc: "H. Peter Anvin" <hpa@zytor.com> Cc: Ingo Molnar <mingo@redhat.com> Cc: Kees Cook <keescook@chromium.org> Cc: Mark Rutland <mark.rutland@arm.com> Cc: Michael Ellerman <mpe@ellerman.id.au> Cc: "Naveen N. Rao" <naveen.n.rao@linux.ibm.com> Cc: Nicholas Piggin <npiggin@gmail.com> Cc: Palmer Dabbelt <palmer@dabbelt.com> Cc: Paul Walmsley <paul.walmsley@sifive.com> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Phong Tran <tranmanphong@gmail.com> Cc: Russell King <linux@armlinux.org.uk> Cc: Steven Price <steven.price@arm.com> Cc: Sven Schnelle <svens@linux.ibm.com> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: Vasily Gorbik <gor@linux.ibm.com> Cc: Will Deacon <will@kernel.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
34 lines
815 B
C
34 lines
815 B
C
/* SPDX-License-Identifier: GPL-2.0 */
|
|
|
|
#ifndef _LINUX_PTDUMP_H
|
|
#define _LINUX_PTDUMP_H
|
|
|
|
#include <linux/mm_types.h>
|
|
|
|
struct ptdump_range {
|
|
unsigned long start;
|
|
unsigned long end;
|
|
};
|
|
|
|
struct ptdump_state {
|
|
/* level is 0:PGD to 4:PTE, or -1 if unknown */
|
|
void (*note_page)(struct ptdump_state *st, unsigned long addr,
|
|
int level, u64 val);
|
|
void (*effective_prot)(struct ptdump_state *st, int level, u64 val);
|
|
const struct ptdump_range *range;
|
|
};
|
|
|
|
bool ptdump_walk_pgd_level_core(struct seq_file *m,
|
|
struct mm_struct *mm, pgd_t *pgd,
|
|
bool checkwx, bool dmesg);
|
|
void ptdump_walk_pgd(struct ptdump_state *st, struct mm_struct *mm, pgd_t *pgd);
|
|
bool ptdump_check_wx(void);
|
|
|
|
static inline void debug_checkwx(void)
|
|
{
|
|
if (IS_ENABLED(CONFIG_DEBUG_WX))
|
|
ptdump_check_wx();
|
|
}
|
|
|
|
#endif /* _LINUX_PTDUMP_H */
|