Commit d6de72cf authored by Sven Schnelle's avatar Sven Schnelle Committed by Heiko Carstens

s390: add kfence region to pagetable dumper

Signed-off-by: default avatarSven Schnelle <svens@linux.ibm.com>
Link: https://lore.kernel.org/r/20210728190254.3921642-5-hca@linux.ibm.comSigned-off-by: default avatarHeiko Carstens <hca@linux.ibm.com>
parent e41ba111
...@@ -4,6 +4,7 @@ ...@@ -4,6 +4,7 @@
#include <linux/seq_file.h> #include <linux/seq_file.h>
#include <linux/debugfs.h> #include <linux/debugfs.h>
#include <linux/mm.h> #include <linux/mm.h>
#include <linux/kfence.h>
#include <linux/kasan.h> #include <linux/kasan.h>
#include <asm/ptdump.h> #include <asm/ptdump.h>
#include <asm/kasan.h> #include <asm/kasan.h>
...@@ -21,6 +22,10 @@ enum address_markers_idx { ...@@ -21,6 +22,10 @@ enum address_markers_idx {
IDENTITY_BEFORE_END_NR, IDENTITY_BEFORE_END_NR,
KERNEL_START_NR, KERNEL_START_NR,
KERNEL_END_NR, KERNEL_END_NR,
#ifdef CONFIG_KFENCE
KFENCE_START_NR,
KFENCE_END_NR,
#endif
IDENTITY_AFTER_NR, IDENTITY_AFTER_NR,
IDENTITY_AFTER_END_NR, IDENTITY_AFTER_END_NR,
#ifdef CONFIG_KASAN #ifdef CONFIG_KASAN
...@@ -40,6 +45,10 @@ static struct addr_marker address_markers[] = { ...@@ -40,6 +45,10 @@ static struct addr_marker address_markers[] = {
[IDENTITY_BEFORE_END_NR] = {(unsigned long)_stext, "Identity Mapping End"}, [IDENTITY_BEFORE_END_NR] = {(unsigned long)_stext, "Identity Mapping End"},
[KERNEL_START_NR] = {(unsigned long)_stext, "Kernel Image Start"}, [KERNEL_START_NR] = {(unsigned long)_stext, "Kernel Image Start"},
[KERNEL_END_NR] = {(unsigned long)_end, "Kernel Image End"}, [KERNEL_END_NR] = {(unsigned long)_end, "Kernel Image End"},
#ifdef CONFIG_KFENCE
[KFENCE_START_NR] = {0, "KFence Pool Start"},
[KFENCE_END_NR] = {0, "KFence Pool End"},
#endif
[IDENTITY_AFTER_NR] = {(unsigned long)_end, "Identity Mapping Start"}, [IDENTITY_AFTER_NR] = {(unsigned long)_end, "Identity Mapping Start"},
[IDENTITY_AFTER_END_NR] = {0, "Identity Mapping End"}, [IDENTITY_AFTER_END_NR] = {0, "Identity Mapping End"},
#ifdef CONFIG_KASAN #ifdef CONFIG_KASAN
...@@ -248,6 +257,9 @@ static void sort_address_markers(void) ...@@ -248,6 +257,9 @@ static void sort_address_markers(void)
static int pt_dump_init(void) static int pt_dump_init(void)
{ {
#ifdef CONFIG_KFENCE
unsigned long kfence_start = (unsigned long)__kfence_pool;
#endif
/* /*
* Figure out the maximum virtual address being accessible with the * Figure out the maximum virtual address being accessible with the
* kernel ASCE. We need this to keep the page table walker functions * kernel ASCE. We need this to keep the page table walker functions
...@@ -262,6 +274,10 @@ static int pt_dump_init(void) ...@@ -262,6 +274,10 @@ static int pt_dump_init(void)
address_markers[VMEMMAP_END_NR].start_address = (unsigned long)vmemmap + vmemmap_size; address_markers[VMEMMAP_END_NR].start_address = (unsigned long)vmemmap + vmemmap_size;
address_markers[VMALLOC_NR].start_address = VMALLOC_START; address_markers[VMALLOC_NR].start_address = VMALLOC_START;
address_markers[VMALLOC_END_NR].start_address = VMALLOC_END; address_markers[VMALLOC_END_NR].start_address = VMALLOC_END;
#ifdef CONFIG_KFENCE
address_markers[KFENCE_START_NR].start_address = kfence_start;
address_markers[KFENCE_END_NR].start_address = kfence_start + KFENCE_POOL_SIZE;
#endif
sort_address_markers(); sort_address_markers();
#ifdef CONFIG_PTDUMP_DEBUGFS #ifdef CONFIG_PTDUMP_DEBUGFS
debugfs_create_file("kernel_page_tables", 0400, NULL, NULL, &ptdump_fops); debugfs_create_file("kernel_page_tables", 0400, NULL, NULL, &ptdump_fops);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment