[RFC UKL 02/10] x86/boot: Load the PT_TLS segment for Unikernel configs

From
Ali Raza <hidden>
Date
2022-10-03 22:22:06
Also in
linux-arch, linux-fsdevel, linux-kbuild, linux-mm, lkml
Reply to
Ali Raza, 2022-10-03
The kernel normally skips loading this segment as it is not inlcuded in
standard builds. However, when linked with an application in the Unikernel
configuration the segment will be present. Load PT_TLS when configured as a
unikernel.

Cc: Jonathan Corbet <corbet@lwn.net>
Cc: Masahiro Yamada <masahiroy@kernel.org>
Cc: Michal Marek <redacted>
Cc: Nick Desaulniers <ndesaulniers@google.com>
Cc: Thomas Gleixner <redacted>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Borislav Petkov <bp@alien8.de>
Cc: Dave Hansen <dave.hansen@linux.intel.com>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Cc: Andy Lutomirski <luto@kernel.org>
Cc: Eric Biederman <redacted>
Cc: Kees Cook <redacted>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Alexander Viro <viro@zeniv.linux.org.uk>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Juri Lelli <juri.lelli@redhat.com>
Cc: Vincent Guittot <vincent.guittot@linaro.org>
Cc: Dietmar Eggemann <dietmar.eggemann@arm.com>
Cc: Steven Rostedt <rostedt@goodmis.org>
Cc: Ben Segall <bsegall@google.com>
Cc: Mel Gorman <mgorman@suse.de>
Cc: Daniel Bristot de Oliveira <redacted>
Cc: Valentin Schneider <vschneid@redhat.com>
Cc: Paolo Bonzini <pbonzini@redhat.com>
Cc: Josh Poimboeuf <jpoimboe@kernel.org>

Signed-off-by: Ali Raza <redacted>
---
 arch/x86/boot/compressed/misc.c | 3 +++
 1 file changed, 3 insertions(+)
diff --git a/arch/x86/boot/compressed/misc.c b/arch/x86/boot/compressed/misc.c
index cf690d8712f4..0d07b5661c9c 100644
--- a/arch/x86/boot/compressed/misc.c
+++ b/arch/x86/boot/compressed/misc.c
@@ -310,6 +310,9 @@ static void parse_elf(void *output)
 		phdr = &phdrs[i];
 
 		switch (phdr->p_type) {
+#ifdef CONFIG_UNIKERNEL_LINUX
+		case PT_TLS:
+#endif
 		case PT_LOAD:
 #ifdef CONFIG_X86_64
 			if ((phdr->p_align % 0x200000) != 0)
-- 
2.21.3
Thread (26 messages) 26 messages, 5 authors, last reply 2022-10-13
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help