diff options
| author | Benjamin Berg <benjamin.berg@intel.com> | 2024-11-11 11:29:10 +0100 |
|---|---|---|
| committer | Johannes Berg <johannes.berg@intel.com> | 2024-11-12 14:50:31 +0100 |
| commit | 2f681ba4b352cdd5658ed2a96062375a12839755 (patch) | |
| tree | 8cc0179eb7c009f8c155acee180270918b93af23 /arch/um/kernel/um_arch.c | |
| parent | 0f659ff362eac69777c4c191b7e5ccb19d76c67d (diff) | |
um: move thread info into task
This selects the THREAD_INFO_IN_TASK option for UM and changes the way
that the current task is discovered. This is trivial though, as UML
already tracks the current task in cpu_tasks[] and this can be used to
retrieve it.
Also remove the signal handler code that copies the thread information
into the IRQ stack. It is obsolete now, which also means that the
mentioned race condition cannot happen anymore.
Signed-off-by: Benjamin Berg <benjamin.berg@intel.com>
Reviewed-by: Hajime Tazaki <thehajime@gmail.com>
Link: https://patch.msgid.link/20241111102910.46512-1-benjamin@sipsolutions.net
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'arch/um/kernel/um_arch.c')
| -rw-r--r-- | arch/um/kernel/um_arch.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/arch/um/kernel/um_arch.c b/arch/um/kernel/um_arch.c index ec17576ce9fc..62ddb865eb91 100644 --- a/arch/um/kernel/um_arch.c +++ b/arch/um/kernel/um_arch.c @@ -65,9 +65,6 @@ struct cpuinfo_um boot_cpu_data = { EXPORT_SYMBOL(boot_cpu_data); -union thread_union cpu0_irqstack - __section(".data..init_irqstack") = - { .thread_info = INIT_THREAD_INFO(init_task) }; /* Changed in setup_arch, which is called in early boot */ static char host_info[(__NEW_UTS_LEN + 1) * 5]; @@ -244,6 +241,8 @@ static struct notifier_block panic_exit_notifier = { void uml_finishsetup(void) { + cpu_tasks[0] = &init_task; + atomic_notifier_chain_register(&panic_notifier_list, &panic_exit_notifier); @@ -418,7 +417,7 @@ void __init setup_arch(char **cmdline_p) { u8 rng_seed[32]; - stack_protections((unsigned long) &init_thread_info); + stack_protections((unsigned long) init_task.stack); setup_physmem(uml_physmem, uml_reserved, physmem_size); mem_total_pages(physmem_size, iomem_size); uml_dtb_init(); |