@@ -615,6 +615,20 @@ extern pgd_t idmap_pg_dir[PTRS_PER_PGD];
extern pgd_t tramp_pg_dir[PTRS_PER_PGD];
extern pgd_t reserved_pg_dir[PTRS_PER_PGD];
+struct pgtables {
+#ifdef CONFIG_UNMAP_KERNEL_AT_EL0
+ pgd_t tramp_pg_dir[PTRS_PER_PGD];
+#endif
+ pgd_t reserved_pg_dir[PTRS_PER_PGD];
+ pgd_t swapper_pg_dir[PTRS_PER_PGD];
+};
+
+extern struct pgtables pgtable_node0;
+
+#ifdef CONFIG_REPLICATE_KTEXT
+extern struct pgtables *pgtables[MAX_NUMNODES];
+#endif
+
extern void set_swapper_pgd(pgd_t *pgdp, pgd_t pgd);
static inline bool in_swapper_pgdir(void *addr)
@@ -212,6 +212,9 @@ SECTIONS
idmap_pg_dir = .;
. += PAGE_SIZE;
+ /* pgtable struct - covers the tramp, reserved and swapper pgdirs */
+ pgtable_node0 = .;
+
#ifdef CONFIG_UNMAP_KERNEL_AT_EL0
tramp_pg_dir = .;
. += PAGE_SIZE;
@@ -15,6 +15,10 @@
#include <asm/ktext.h>
#include <asm/memory.h>
+struct pgtables *pgtables[MAX_NUMNODES] = {
+ [0 ... MAX_NUMNODES - 1] = &pgtable_node0,
+};
+
static void *kernel_texts[MAX_NUMNODES];
void __kprobes ktext_replication_patch(u32 *tp, __le32 insn)
Add a struct definition for the level zero page table group (the optional trampoline page tables, reserved page tables, and swapper page tables). Add a symbol and extern declaration for the node 0 page table group. Add an array of pointers to per-node page tables, which will default to using the node 0 page table group. Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk> --- arch/arm64/include/asm/pgtable.h | 14 ++++++++++++++ arch/arm64/kernel/vmlinux.lds.S | 3 +++ arch/arm64/mm/ktext.c | 4 ++++ 3 files changed, 21 insertions(+)