Re: [PATCH v2 11/16] x86/compressed: move startup32_load_idt() into .text section
From: Borislav Petkov
Date: Fri Nov 18 2022 - 11:44:35 EST
On Wed, Sep 21, 2022 at 04:54:17PM +0200, Ard Biesheuvel wrote:
> Convert startup32_load_idt() into an ordinary function and move it into
> the .text section. This involves turning the rva() immediates into ones
> derived from a local label, and preserving/restoring the %ebp and %ebx
> as per the calling convention.
>
> Also move the #ifdef to the only existing call site. This makes it clear
> that the function call does nothing if support for memory encryption is
> not compiled in.
I'm not crazy about all that ifdeffery in there but this will need a
serious look.
Btw, you can drop one, diff ontop:
---
diff --git a/arch/x86/boot/compressed/head_64.S b/arch/x86/boot/compressed/head_64.S
index bc5bd639217e..a862fd8ac0bd 100644
--- a/arch/x86/boot/compressed/head_64.S
+++ b/arch/x86/boot/compressed/head_64.S
@@ -726,9 +726,7 @@ SYM_DATA_START(boot32_idt)
.quad 0
.endr
SYM_DATA_END_LABEL(boot32_idt, SYM_L_GLOBAL, boot32_idt_end)
-#endif
-#ifdef CONFIG_AMD_MEM_ENCRYPT
.text
.code32
/*
--
Regards/Gruss,
Boris.
https://people.kernel.org/tglx/notes-about-netiquette