Re: [PATCH 00/23] [v4] KAISER: unmap most of the kernel from userspace page tables

From: Ingo Molnar
Date: Thu Nov 23 2017 - 02:24:12 EST



* Dave Hansen <dave.hansen@xxxxxxxxxxxxxxx> wrote:

> Thanks, everyone for all the reviews thus far. I hope I managed to
> address all the feedback given so far, except for the TODOs of
> course. This is a pretty minor update compared to v1->v2.
>
> These patches are all on this tip branch:
>
> https://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git/log/?h=WIP.x86/mm

Note that on top of latest -tip the bzImage build fails with:

arch/x86/boot/compressed/pagetable.o: In function `kernel_ident_mapping_init':
pagetable.c:(.text+0x31b): undefined reference to `kaiser_enabled'
arch/x86/boot/compressed/Makefile:109: recipe for target 'arch/x86/boot/compressed/vmlinux' failed

that's I think because the early boot code shares some code via
kernel_ident_mapping_init() et al, and that code grew a new KAISER runtime
variable which isn't present in the special early-boot environment.

I.e. something like the (totally untested) patch below should do the trick.

Thanks,

Ingo

---
arch/x86/boot/compressed/pagetable.c | 6 ++++++
1 file changed, 6 insertions(+)

Index: tip/arch/x86/boot/compressed/pagetable.c
===================================================================
--- tip.orig/arch/x86/boot/compressed/pagetable.c
+++ tip/arch/x86/boot/compressed/pagetable.c
@@ -36,6 +36,12 @@
/* Used by pgtable.h asm code to force instruction serialization. */
unsigned long __force_order;

+/*
+ * We share the kernel_ident_mapping_init(), but the early boot version does not need
+ * the Kaiser-logic:
+ */
+int kaiser_enabled = 0;
+
/* Used to track our page table allocation area. */
struct alloc_pgt_data {
unsigned char *pgt_buf;