Merge tag 'uml-for-linux-6.18-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/uml/linux

Pull uml updates from Johannes Berg:

- minor preparations for SMP support

- SPARSE_IRQ support for kunit

- help output cleanups

* tag 'uml-for-linux-6.18-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/uml/linux:
um: Remove unused ipi_pipe field from cpuinfo_um
um: Remove unused cpu_data and current_cpu_data macros
um: Stop tracking virtual CPUs via mm_cpumask()
um: Centralize stub size calculations
um: Remove outdated comment about STUB_DATA_PAGES
um: Remove unused offset and child_err fields from stub_data
um: Indent time-travel help messages
um: Fix help message for ssl-non-raw
um: vector: Fix indentation for help message
um: Add missing trailing newline to help messages
um: virtio-pci: implement .shutdown()
um: Support SPARSE_IRQ

+46 -49
+1
arch/um/Kconfig
··· 39 39 select HAVE_ARCH_TRACEHOOK 40 40 select HAVE_SYSCALL_TRACEPOINTS 41 41 select THREAD_INFO_IN_TASK 42 + select SPARSE_IRQ 42 43 43 44 config MMU 44 45 bool
+4 -1
arch/um/drivers/ssl.c
··· 199 199 return 1; 200 200 } 201 201 __setup("ssl-non-raw", ssl_non_raw_setup); 202 - __channel_help(ssl_non_raw_setup, "set serial lines to non-raw mode"); 202 + __uml_help(ssl_non_raw_setup, 203 + "ssl-non-raw\n" 204 + " Set serial lines to non-raw mode.\n\n" 205 + );
+1 -1
arch/um/drivers/ubd_kern.c
··· 370 370 " useful when a unique number should be given to the device. Note when\n" 371 371 " specifying a label, the filename2 must be also presented. It can be\n" 372 372 " an empty string, in which case the backing file is not used:\n" 373 - " ubd0=File,,Serial\n" 373 + " ubd0=File,,Serial\n\n" 374 374 ); 375 375 376 376 static int udb_setup(char *str)
+1 -1
arch/um/drivers/vector_kern.c
··· 1721 1721 __setup("vec", vector_setup); 1722 1722 __uml_help(vector_setup, 1723 1723 "vec[0-9]+:<option>=<value>,<option>=<value>\n" 1724 - " Configure a vector io network device.\n\n" 1724 + " Configure a vector io network device.\n\n" 1725 1725 ); 1726 1726 1727 1727 late_initcall(vector_init);
+6
arch/um/drivers/virtio_pcidev.c
··· 598 598 kfree(dev); 599 599 } 600 600 601 + static void virtio_pcidev_virtio_shutdown(struct virtio_device *vdev) 602 + { 603 + /* nothing to do, we just don't want queue shutdown */ 604 + } 605 + 601 606 static struct virtio_device_id id_table[] = { 602 607 { CONFIG_UML_PCI_OVER_VIRTIO_DEVICE_ID, VIRTIO_DEV_ANY_ID }, 603 608 { 0 }, ··· 614 609 .id_table = id_table, 615 610 .probe = virtio_pcidev_virtio_probe, 616 611 .remove = virtio_pcidev_virtio_remove, 612 + .shutdown = virtio_pcidev_virtio_shutdown, 617 613 }; 618 614 619 615 static int __init virtio_pcidev_init(void)
-11
arch/um/include/asm/mmu_context.h
··· 13 13 #include <asm/mm_hooks.h> 14 14 #include <asm/mmu.h> 15 15 16 - #define activate_mm activate_mm 17 - static inline void activate_mm(struct mm_struct *old, struct mm_struct *new) 18 - { 19 - } 20 - 21 16 static inline void switch_mm(struct mm_struct *prev, struct mm_struct *next, 22 17 struct task_struct *tsk) 23 18 { 24 - unsigned cpu = smp_processor_id(); 25 - 26 - if (prev != next) { 27 - cpumask_clear_cpu(cpu, mm_cpumask(prev)); 28 - cpumask_set_cpu(cpu, mm_cpumask(next)); 29 - } 30 19 } 31 20 32 21 #define init_new_context init_new_context
-3
arch/um/include/asm/processor-generic.h
··· 71 71 72 72 struct cpuinfo_um { 73 73 unsigned long loops_per_jiffy; 74 - int ipi_pipe[2]; 75 74 int cache_alignment; 76 75 union { 77 76 __u32 x86_capability[NCAPINTS + NBUGINTS]; ··· 80 81 81 82 extern struct cpuinfo_um boot_cpu_data; 82 83 83 - #define cpu_data(cpu) boot_cpu_data 84 - #define current_cpu_data boot_cpu_data 85 84 #define cache_line_size() (boot_cpu_data.cache_alignment) 86 85 87 86 #define KSTK_REG(tsk, reg) get_thread_reg(reg, &tsk->thread.switch_buf)
+3 -2
arch/um/include/shared/as-layout.h
··· 23 23 #define STUB_START stub_start 24 24 #define STUB_CODE STUB_START 25 25 #define STUB_DATA (STUB_CODE + UM_KERN_PAGE_SIZE) 26 - #define STUB_DATA_PAGES 2 /* must be a power of two */ 27 - #define STUB_END (STUB_DATA + STUB_DATA_PAGES * UM_KERN_PAGE_SIZE) 26 + #define STUB_DATA_PAGES 2 27 + #define STUB_SIZE ((1 + STUB_DATA_PAGES) * UM_KERN_PAGE_SIZE) 28 + #define STUB_END (STUB_START + STUB_SIZE) 28 29 29 30 #ifndef __ASSEMBLER__ 30 31
+1 -2
arch/um/include/shared/skas/stub-data.h
··· 53 53 }; 54 54 55 55 struct stub_data { 56 - unsigned long offset; 57 - long err, child_err; 56 + long err; 58 57 59 58 int syscall_data_len; 60 59 /* 128 leaves enough room for additional fields in the struct */
+1 -1
arch/um/kernel/dtb.c
··· 38 38 39 39 __uml_setup("dtb=", uml_dtb_setup, 40 40 "dtb=<file>\n" 41 - " Boot the kernel with the devicetree blob from the specified file.\n" 41 + " Boot the kernel with the devicetree blob from the specified file.\n\n" 42 42 );
+5
arch/um/kernel/irq.c
··· 691 691 os_setup_epoll(); 692 692 } 693 693 694 + int __init arch_probe_nr_irqs(void) 695 + { 696 + return NR_IRQS; 697 + } 698 + 694 699 void sigchld_handler(int sig, struct siginfo *unused_si, 695 700 struct uml_pt_regs *regs, void *mc) 696 701 {
+19 -18
arch/um/kernel/time.c
··· 986 986 __setup("time-travel", setup_time_travel); 987 987 __uml_help(setup_time_travel, 988 988 "time-travel\n" 989 - "This option just enables basic time travel mode, in which the clock/timers\n" 990 - "inside the UML instance skip forward when there's nothing to do, rather than\n" 991 - "waiting for real time to elapse. However, instance CPU speed is limited by\n" 992 - "the real CPU speed, so e.g. a 10ms timer will always fire after ~10ms wall\n" 993 - "clock (but quicker when there's nothing to do).\n" 989 + " This option just enables basic time travel mode, in which the clock/timers\n" 990 + " inside the UML instance skip forward when there's nothing to do, rather than\n" 991 + " waiting for real time to elapse. However, instance CPU speed is limited by\n" 992 + " the real CPU speed, so e.g. a 10ms timer will always fire after ~10ms wall\n" 993 + " clock (but quicker when there's nothing to do).\n" 994 994 "\n" 995 995 "time-travel=inf-cpu\n" 996 - "This enables time travel mode with infinite processing power, in which there\n" 997 - "are no wall clock timers, and any CPU processing happens - as seen from the\n" 998 - "guest - instantly. This can be useful for accurate simulation regardless of\n" 999 - "debug overhead, physical CPU speed, etc. but is somewhat dangerous as it can\n" 1000 - "easily lead to getting stuck (e.g. if anything in the system busy loops).\n" 996 + " This enables time travel mode with infinite processing power, in which there\n" 997 + " are no wall clock timers, and any CPU processing happens - as seen from the\n" 998 + " guest - instantly. This can be useful for accurate simulation regardless of\n" 999 + " debug overhead, physical CPU speed, etc. but is somewhat dangerous as it can\n" 1000 + " easily lead to getting stuck (e.g. if anything in the system busy loops).\n" 1001 1001 "\n" 1002 1002 "time-travel=ext:[ID:]/path/to/socket\n" 1003 - "This enables time travel mode similar to =inf-cpu, except the system will\n" 1004 - "use the given socket to coordinate with a central scheduler, in order to\n" 1005 - "have more than one system simultaneously be on simulated time. The virtio\n" 1006 - "driver code in UML knows about this so you can also simulate networks and\n" 1007 - "devices using it, assuming the device has the right capabilities.\n" 1008 - "The optional ID is a 64-bit integer that's sent to the central scheduler.\n"); 1003 + " This enables time travel mode similar to =inf-cpu, except the system will\n" 1004 + " use the given socket to coordinate with a central scheduler, in order to\n" 1005 + " have more than one system simultaneously be on simulated time. The virtio\n" 1006 + " driver code in UML knows about this so you can also simulate networks and\n" 1007 + " devices using it, assuming the device has the right capabilities.\n" 1008 + " The optional ID is a 64-bit integer that's sent to the central scheduler.\n\n"); 1009 1009 1010 1010 static int setup_time_travel_start(char *str) 1011 1011 { ··· 1022 1022 __setup("time-travel-start=", setup_time_travel_start); 1023 1023 __uml_help(setup_time_travel_start, 1024 1024 "time-travel-start=<nanoseconds>\n" 1025 - "Configure the UML instance's wall clock to start at this value rather than\n" 1026 - "the host's wall clock at the time of UML boot.\n"); 1025 + " Configure the UML instance's wall clock to start at this value rather than\n" 1026 + " the host's wall clock at the time of UML boot.\n\n"); 1027 + 1027 1028 static struct kobject *bc_time_kobject; 1028 1029 1029 1030 static ssize_t bc_show(struct kobject *kobj, struct kobj_attribute *attr, char *buf)
+1 -6
arch/um/kernel/um_arch.c
··· 54 54 55 55 /* 56 56 * These fields are initialized at boot time and not changed. 57 - * XXX This structure is used only in the non-SMP case. Maybe this 58 - * should be moved to smp.c. 59 57 */ 60 58 struct cpuinfo_um boot_cpu_data = { 61 59 .loops_per_jiffy = 0, 62 - .ipi_pipe = { -1, -1 }, 63 60 .cache_alignment = L1_CACHE_BYTES, 64 61 .x86_capability = { 0 } 65 62 }; ··· 328 331 329 332 host_task_size = get_top_address(envp); 330 333 /* reserve a few pages for the stubs */ 331 - stub_start = host_task_size - STUB_DATA_PAGES * PAGE_SIZE; 332 - /* another page for the code portion */ 333 - stub_start -= PAGE_SIZE; 334 + stub_start = host_task_size - STUB_SIZE; 334 335 host_task_size = stub_start; 335 336 336 337 /* Limit TASK_SIZE to what is addressable by the page table */
+1 -1
arch/um/os-Linux/skas/process.c
··· 895 895 "noreboot\n" 896 896 " Rather than rebooting, exit always, akin to QEMU's -no-reboot option.\n" 897 897 " This is useful if you're using CONFIG_PANIC_TIMEOUT in order to catch\n" 898 - " crashes in CI\n"); 898 + " crashes in CI\n\n"); 899 899 900 900 void reboot_skas(void) 901 901 {
+1 -1
arch/x86/um/shared/sysdep/stub_32.h
··· 129 129 "subl %0,%%esp ;" \ 130 130 "movl %1, %%eax ; " \ 131 131 "call *%%eax ;" \ 132 - :: "i" ((1 + STUB_DATA_PAGES) * UM_KERN_PAGE_SIZE), \ 132 + :: "i" (STUB_SIZE), \ 133 133 "i" (&fn)) 134 134 135 135 static __always_inline void
+1 -1
arch/x86/um/shared/sysdep/stub_64.h
··· 133 133 "subq %0,%%rsp ;" \ 134 134 "movq %1,%%rax ;" \ 135 135 "call *%%rax ;" \ 136 - :: "i" ((1 + STUB_DATA_PAGES) * UM_KERN_PAGE_SIZE), \ 136 + :: "i" (STUB_SIZE), \ 137 137 "i" (&fn)) 138 138 139 139 static __always_inline void