Skip to content

Commit dcf3c93

Browse files
committed
Merge tag 'for-linus-5.14-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rw/uml
Pull UML updates from Richard Weinberger: - Support for optimized routines based on the host CPU - Support for PCI via virtio - Various fixes * tag 'for-linus-5.14-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rw/uml: um: remove unneeded semicolon in um_arch.c um: Remove the repeated declaration um: fix error return code in winch_tramp() um: fix error return code in slip_open() um: Fix stack pointer alignment um: implement flush_cache_vmap/flush_cache_vunmap um: add a UML specific futex implementation um: enable the use of optimized xor routines in UML um: Add support for host CPU flags and alignment um: allow not setting extra rpaths in the linux binary um: virtio/pci: enable suspend/resume um: add PCI over virtio emulation driver um: irqs: allow invoking time-travel handler multiple times um: time-travel/signals: fix ndelay() in interrupt um: expose time-travel mode to userspace side um: export signals_enabled directly um: remove unused smp_sigio_handler() declaration lib: add iomem emulation (logic_iomem) um: allow disabling NO_IOMEM
2 parents 7a400bf + 1aee020 commit dcf3c93

53 files changed

Lines changed: 2211 additions & 111 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

arch/um/Kconfig

Lines changed: 32 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ config UML
1515
select HAVE_FUTEX_CMPXCHG if FUTEX
1616
select HAVE_DEBUG_KMEMLEAK
1717
select HAVE_DEBUG_BUGVERBOSE
18-
select NO_DMA
18+
select NO_DMA if !UML_DMA_EMULATION
1919
select GENERIC_IRQ_SHOW
2020
select GENERIC_CPU_DEVICES
2121
select HAVE_GCC_PLUGINS
@@ -26,7 +26,22 @@ config MMU
2626
bool
2727
default y
2828

29+
config UML_DMA_EMULATION
30+
bool
31+
2932
config NO_IOMEM
33+
bool "disable IOMEM" if EXPERT
34+
depends on !INDIRECT_IOMEM
35+
default y
36+
37+
config UML_IOMEM_EMULATION
38+
bool
39+
select INDIRECT_IOMEM
40+
select GENERIC_PCI_IOMAP
41+
select GENERIC_IOMAP
42+
select NO_GENERIC_PCI_IOPORT_MAP
43+
44+
config NO_IOPORT_MAP
3045
def_bool y
3146

3247
config ISA
@@ -61,6 +76,9 @@ config NR_CPUS
6176
range 1 1
6277
default 1
6378

79+
config ARCH_HAS_CACHE_LINE_SIZE
80+
def_bool y
81+
6482
source "arch/$(HEADER_ARCH)/um/Kconfig"
6583

6684
config MAY_HAVE_RUNTIME_DEPS
@@ -91,6 +109,19 @@ config LD_SCRIPT_DYN
91109
depends on !LD_SCRIPT_STATIC
92110
select MODULE_REL_CRCS if MODVERSIONS
93111

112+
config LD_SCRIPT_DYN_RPATH
113+
bool "set rpath in the binary" if EXPERT
114+
default y
115+
depends on LD_SCRIPT_DYN
116+
help
117+
Add /lib (and /lib64 for 64-bit) to the linux binary's rpath
118+
explicitly.
119+
120+
You may need to turn this off if compiling for nix systems
121+
that have their libraries in random /nix directories and
122+
might otherwise unexpected use libraries from /lib or /lib64
123+
instead of the desired ones.
124+
94125
config HOSTFS
95126
tristate "Host filesystem"
96127
help

arch/um/Makefile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,8 @@ archprepare:
118118
$(Q)$(MAKE) $(build)=$(HOST_DIR)/um include/generated/user_constants.h
119119

120120
LINK-$(CONFIG_LD_SCRIPT_STATIC) += -static
121-
LINK-$(CONFIG_LD_SCRIPT_DYN) += -Wl,-rpath,/lib $(call cc-option, -no-pie)
121+
LINK-$(CONFIG_LD_SCRIPT_DYN) += $(call cc-option, -no-pie)
122+
LINK-$(CONFIG_LD_SCRIPT_DYN_RPATH) += -Wl,-rpath,/lib
122123

123124
CFLAGS_NO_HARDENING := $(call cc-option, -fno-PIC,) $(call cc-option, -fno-pic,) \
124125
-fno-stack-protector $(call cc-option, -fno-stack-protector-all)

arch/um/drivers/Kconfig

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -357,3 +357,23 @@ config UML_RTC
357357
rtcwake, especially in time-travel mode. This driver enables that
358358
by providing a fake RTC clock that causes a wakeup at the right
359359
time.
360+
361+
config UML_PCI_OVER_VIRTIO
362+
bool "Enable PCI over VIRTIO device simulation"
363+
# in theory, just VIRTIO is enough, but that causes recursion
364+
depends on VIRTIO_UML
365+
select FORCE_PCI
366+
select UML_IOMEM_EMULATION
367+
select UML_DMA_EMULATION
368+
select PCI_MSI
369+
select PCI_MSI_IRQ_DOMAIN
370+
select PCI_LOCKLESS_CONFIG
371+
372+
config UML_PCI_OVER_VIRTIO_DEVICE_ID
373+
int "set the virtio device ID for PCI emulation"
374+
default -1
375+
depends on UML_PCI_OVER_VIRTIO
376+
help
377+
There's no official device ID assigned (yet), set the one you
378+
wish to use for experimentation here. The default of -1 is
379+
not valid and will cause the driver to fail at probe.

arch/um/drivers/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ obj-$(CONFIG_BLK_DEV_COW_COMMON) += cow_user.o
6464
obj-$(CONFIG_UML_RANDOM) += random.o
6565
obj-$(CONFIG_VIRTIO_UML) += virtio_uml.o
6666
obj-$(CONFIG_UML_RTC) += rtc.o
67+
obj-$(CONFIG_UML_PCI_OVER_VIRTIO) += virt-pci.o
6768

6869
# pcap_user.o must be added explicitly.
6970
USER_OBJS := fd.o null.o pty.o tty.o xterm.o slip_common.o pcap_user.o vde_user.o vector_user.o

arch/um/drivers/chan_user.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,8 @@ static int winch_tramp(int fd, struct tty_port *port, int *fd_out,
256256
goto out_close;
257257
}
258258

259-
if (os_set_fd_block(*fd_out, 0)) {
259+
err = os_set_fd_block(*fd_out, 0);
260+
if (err) {
260261
printk(UM_KERN_ERR "winch_tramp: failed to set thread_fd "
261262
"non-blocking.\n");
262263
goto out_close;

arch/um/drivers/slip_user.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,8 @@ static int slip_open(void *data)
145145
}
146146
sfd = err;
147147

148-
if (set_up_tty(sfd))
148+
err = set_up_tty(sfd);
149+
if (err)
149150
goto out_close2;
150151

151152
pri->slave = sfd;

arch/um/drivers/ubd_kern.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1242,8 +1242,7 @@ static int __init ubd_driver_init(void){
12421242
* enough. So use anyway the io thread. */
12431243
}
12441244
stack = alloc_stack(0, 0);
1245-
io_pid = start_io_thread(stack + PAGE_SIZE - sizeof(void *),
1246-
&thread_fd);
1245+
io_pid = start_io_thread(stack + PAGE_SIZE, &thread_fd);
12471246
if(io_pid < 0){
12481247
printk(KERN_ERR
12491248
"ubd : Failed to start I/O thread (errno = %d) - "

0 commit comments

Comments
 (0)