[PATCH v13 11/13] um: nommu: disable SMP on nommu UML

Hajime Tazaki
2025-11-08T08:06:21Z

CONFIG_SMP doesn't work with nommu UML since fs register handling of
host does conflict with thread local storage (more specifically,
the variable signals_enabled).

Thus this commit disables the CONFIG option and the TLS variables.

Signed-off-by: Hajime Tazaki <thehajime@gmail.com>
---
arch/um/os-Linux/internal.h | 8 ++++++++
arch/x86/um/Kconfig | 2 +-
2 files changed, 9 insertions(+), 1 deletion(-)

diff --git a/arch/um/os-Linux/internal.h b/arch/um/os-Linux/internal.h
index bac9fcc8c14c..25cb5cc931c1 100644
--- a/arch/um/os-Linux/internal.h
+++ b/arch/um/os-Linux/internal.h
@@ -6,6 +6,14 @@
#include <stub-data.h>
#include <signal.h>

+/* NOMMU doesn't work with thread-local storage used in CONFIG_SMP,
+ * due to the dependency on host_fs variable switch upon user/kernel
+ * context so, disable TLS until NOMMU supports SMP.
+ */
+#ifndef CONFIG_MMU
+#define __thread
+#endif
+
/*
* elf_aux.c
*/
diff --git a/arch/x86/um/Kconfig b/arch/x86/um/Kconfig
index bdd7c8e39b01..f12e2e4e0a12 100644
--- a/arch/x86/um/Kconfig
+++ b/arch/x86/um/Kconfig
@@ -12,7 +12,7 @@ config UML_X86
select ARCH_USE_QUEUED_SPINLOCKS
select DCACHE_WORD_ACCESS
select HAVE_EFFICIENT_UNALIGNED_ACCESS
- select UML_SUBARCH_SUPPORTS_SMP if X86_CX8
+ select UML_SUBARCH_SUPPORTS_SMP if X86_CX8 && MMU

config 64BIT
bool "64-bit kernel" if "$(SUBARCH)" = "x86"
--
2.43.0