Re: [PATCH 00/24] x86/mm: Add KAISER support

Ingo Molnar
2017-11-27T14:03:50Z

* Borislav Petkov <bp@alien8.de> wrote:

> On Mon, Nov 27, 2017 at 02:57:17PM +0100, Thomas Gleixner wrote:
> > On Mon, 27 Nov 2017, Borislav Petkov wrote:
> > > On Mon, Nov 27, 2017 at 11:48:59AM +0100, Ingo Molnar wrote:
> > > > Sending this out for another round of review.
> > > >
> > > > These are the main KAISER patches, on top of the preparatory series I just sent.
> > > > This includes KAISER support plus enhancements on top, all the latest code.
> > > >
> > > > ( All review feedback so far is incorporated - if anything is missing please
> > > > let me know. )
> > >
> > > Something's missing:
> > >
> > > arch/x86/boot/compressed/pagetable.o: In function `kernel_ident_mapping_init':
> > > pagetable.c:(.text+0x3cc): undefined reference to `kaiser_enabled'
> > > pagetable.c:(.text+0x400): undefined reference to `__supported_pte_mask'
> > > pagetable.c:(.text+0x473): undefined reference to `system_state'
> > > make[2]: *** [arch/x86/boot/compressed/vmlinux] Error 1
> > > make[1]: *** [arch/x86/boot/compressed/vmlinux] Error 2
> > > make: *** [bzImage] Error 2
> > > make: *** Waiting for unfinished jobs....
> > >
> > > I suspect it is that core patch but need to stare at it more. .config
> > > attached.
> >
> > That's the core patch plus the run time enablement I did.
>
> Right, and I think the fix is as simple as this because we don't care
> about kaiser in the bootstrap kernel:
>
> ---
> diff --git a/arch/x86/boot/compressed/pagetable.c b/arch/x86/boot/compressed/pagetable.c
> index d5364ca2e3f9..63eaa71ad9f1 100644
> --- a/arch/x86/boot/compressed/pagetable.c
> +++ b/arch/x86/boot/compressed/pagetable.c
> @@ -22,6 +22,7 @@
> * the SME support to avoid any compile and link errors.
> */
> #undef CONFIG_AMD_MEM_ENCRYPT
> +#undef CONFIG_KAISER
>
> #include "misc.h"

Yeah - will use one with a bit more explanation:

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

diff --git a/arch/x86/boot/compressed/pagetable.c b/arch/x86/boot/compressed/pagetable.c
index d5364ca2e3f9..6bd51de4475c 100644
--- a/arch/x86/boot/compressed/pagetable.c
+++ b/arch/x86/boot/compressed/pagetable.c
@@ -23,6 +23,11 @@
*/
#undef CONFIG_AMD_MEM_ENCRYPT

+/*
+ * No KAISER support needed either:
+ */
+#undef CONFIG_KAISER
+
#include "misc.h"

/* These actually do the work of building the kernel identity maps. */

Thanks,

Ingo