summaryrefslogtreecommitdiff
path: root/arch/um/os-Linux/start_up.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2025-12-05 16:30:56 -0800
committerLinus Torvalds <torvalds@linux-foundation.org>2025-12-05 16:30:56 -0800
commit399ead3a6d76cbdd29a716660db5c84a314dab70 (patch)
tree21fabb627af50846eebd0aed52da7d65953b6221 /arch/um/os-Linux/start_up.c
parent07025b51c1149951d64804c73014499bb3564dca (diff)
parenta3209bb94b36351f11e0d9e72ac44e5dd777a069 (diff)
Merge tag 'uml-for-linux-6.19-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/uml/linux
Pull UML updates from Johannes Berg: "Apart from the usual small churn, we have - initial SMP support (only kernel) - major vDSO cleanups (and fixes for 32-bit)" * tag 'uml-for-linux-6.19-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/uml/linux: (33 commits) um: Disable KASAN_INLINE when STATIC_LINK is selected um: Don't rename vmap to kernel_vmap um: drivers: virtio: use string choices helper um: Always set up AT_HWCAP and AT_PLATFORM x86/um: Remove FIXADDR_USER_START and FIXADDR_USE_END um: Remove __access_ok_vsyscall() um: Remove redundant range check from __access_ok_vsyscall() um: Remove fixaddr_user_init() x86/um: Drop gate area handling x86/um: Do not inherit vDSO from host um: Split out default elf_aux_hwcap x86/um: Move ELF_PLATFORM fallback to x86-specific code um: Split out default elf_aux_platform um: Avoid circular dependency on asm-offsets in pgtable.h um: Enable SMP support on x86 asm-generic: percpu: Add assembly guard um: vdso: Remove getcpu support on x86 um: Add initial SMP support um: Define timers on a per-CPU basis um: Determine sleep based on need_resched() ...
Diffstat (limited to 'arch/um/os-Linux/start_up.c')
-rw-r--r--arch/um/os-Linux/start_up.c54
1 files changed, 4 insertions, 50 deletions
diff --git a/arch/um/os-Linux/start_up.c b/arch/um/os-Linux/start_up.c
index a827c2e01aa5..054ac03bbf5e 100644
--- a/arch/um/os-Linux/start_up.c
+++ b/arch/um/os-Linux/start_up.c
@@ -22,6 +22,7 @@
#include <asm/unistd.h>
#include <init.h>
#include <os.h>
+#include <smp.h>
#include <kern_util.h>
#include <mem_user.h>
#include <ptrace_user.h>
@@ -481,6 +482,9 @@ void __init os_early_checks(void)
fatal("SECCOMP userspace requested but not functional!\n");
}
+ if (uml_ncpus > 1)
+ fatal("SMP is not supported with PTRACE userspace.\n");
+
using_seccomp = 0;
check_ptrace();
@@ -489,53 +493,3 @@ void __init os_early_checks(void)
fatal("Failed to initialize default registers");
stop_ptraced_child(pid, 1);
}
-
-int __init parse_iomem(char *str, int *add)
-{
- struct iomem_region *new;
- struct stat64 buf;
- char *file, *driver;
- int fd, size;
-
- driver = str;
- file = strchr(str,',');
- if (file == NULL) {
- os_warn("parse_iomem : failed to parse iomem\n");
- goto out;
- }
- *file = '\0';
- file++;
- fd = open(file, O_RDWR, 0);
- if (fd < 0) {
- perror("parse_iomem - Couldn't open io file");
- goto out;
- }
-
- if (fstat64(fd, &buf) < 0) {
- perror("parse_iomem - cannot stat_fd file");
- goto out_close;
- }
-
- new = malloc(sizeof(*new));
- if (new == NULL) {
- perror("Couldn't allocate iomem_region struct");
- goto out_close;
- }
-
- size = (buf.st_size + UM_KERN_PAGE_SIZE) & ~(UM_KERN_PAGE_SIZE - 1);
-
- *new = ((struct iomem_region) { .next = iomem_regions,
- .driver = driver,
- .fd = fd,
- .size = size,
- .phys = 0,
- .virt = 0 });
- iomem_regions = new;
- iomem_size += new->size + UM_KERN_PAGE_SIZE;
-
- return 0;
- out_close:
- close(fd);
- out:
- return 1;
-}