Skip to content

Commit 831c192

Browse files
committed
Merge tag 'uml-for-linus-6.13-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/uml/linux
Pull UML updates from Richard Weinberger: - Lots of cleanups, mostly from Benjamin Berg and Tiwei Bie - Removal of unused code - Fix for sparse warnings - Cleanup around stub_exe() * tag 'uml-for-linus-6.13-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/uml/linux: (68 commits) hostfs: Fix the NULL vs IS_ERR() bug for __filemap_get_folio() um: move thread info into task um: Always dump trace for specified task in show_stack um: vector: Do not use drvdata in release um: net: Do not use drvdata in release um: ubd: Do not use drvdata in release um: ubd: Initialize ubd's disk pointer in ubd_add um: virtio_uml: query the number of vqs if supported um: virtio_uml: fix call_fd IRQ allocation um: virtio_uml: send SET_MEM_TABLE message with the exact size um: remove broken double fault detection um: remove duplicate UM_NSEC_PER_SEC definition um: remove file sync for stub data um: always include kconfig.h and compiler-version.h um: set DONTDUMP and DONTFORK flags on KASAN shadow memory um: fix sparse warnings in signal code um: fix sparse warnings from regset refactor um: Remove double zero check um: fix stub exe build with CONFIG_GCOV um: Use os_set_pdeathsig helper in winch thread/process ...
2 parents 04b43ea + bed2cc4 commit 831c192

Some content is hidden

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

83 files changed

+1227
-1394
lines changed

arch/um/Kconfig

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ menu "UML-specific options"
55
config UML
66
bool
77
default y
8+
select ARCH_WANTS_DYNAMIC_TASK_STRUCT
89
select ARCH_HAS_CPU_FINALIZE_INIT
910
select ARCH_HAS_FORTIFY_SOURCE
1011
select ARCH_HAS_GCOV_PROFILE_ALL
@@ -32,6 +33,8 @@ config UML
3233
select HAVE_ARCH_VMAP_STACK
3334
select HAVE_RUST
3435
select ARCH_HAS_UBSAN
36+
select HAVE_ARCH_TRACEHOOK
37+
select THREAD_INFO_IN_TASK
3538

3639
config MMU
3740
bool
@@ -94,7 +97,7 @@ config MAY_HAVE_RUNTIME_DEPS
9497

9598
config STATIC_LINK
9699
bool "Force a static link"
97-
depends on CC_CAN_LINK_STATIC_NO_RUNTIME_DEPS || !MAY_HAVE_RUNTIME_DEPS
100+
depends on !MAY_HAVE_RUNTIME_DEPS
98101
help
99102
This option gives you the ability to force a static link of UML.
100103
Normally, UML is linked as a shared binary. This is inconvenient for
@@ -209,8 +212,8 @@ config MMAPPER
209212

210213
config PGTABLE_LEVELS
211214
int
212-
default 3 if 3_LEVEL_PGTABLES
213-
default 2
215+
default 4 if 64BIT
216+
default 2 if !64BIT
214217

215218
config UML_TIME_TRAVEL_SUPPORT
216219
bool
@@ -227,6 +230,21 @@ config UML_TIME_TRAVEL_SUPPORT
227230

228231
It is safe to say Y, but you probably don't need this.
229232

233+
config UML_MAX_USERSPACE_ITERATIONS
234+
int
235+
prompt "Maximum number of unscheduled userspace iterations"
236+
default 10000
237+
depends on UML_TIME_TRAVEL_SUPPORT
238+
help
239+
In UML inf-cpu and ext time-travel mode userspace can run without being
240+
interrupted. This will eventually overwhelm the kernel and create OOM
241+
situations (mainly RCU not running). This setting specifies the number
242+
of kernel/userspace switches (minor/major page fault, signal or syscall)
243+
for the same userspace thread before the sched_clock is advanced by a
244+
jiffie to trigger scheduling.
245+
246+
Setting it to zero disables the feature.
247+
230248
config KASAN_SHADOW_OFFSET
231249
hex
232250
depends on KASAN

arch/um/Makefile

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,8 @@ KBUILD_CFLAGS += $(CFLAGS) $(CFLAGS-y) -D__arch_um__ \
6161
$(ARCH_INCLUDE) $(MODE_INCLUDE) -Dvmap=kernel_vmap \
6262
-Dlongjmp=kernel_longjmp -Dsetjmp=kernel_setjmp \
6363
-Din6addr_loopback=kernel_in6addr_loopback \
64-
-Din6addr_any=kernel_in6addr_any -Dstrrchr=kernel_strrchr
64+
-Din6addr_any=kernel_in6addr_any -Dstrrchr=kernel_strrchr \
65+
-D__close_range=kernel__close_range
6566

6667
KBUILD_RUSTFLAGS += -Crelocation-model=pie
6768

@@ -70,7 +71,9 @@ KBUILD_AFLAGS += $(ARCH_INCLUDE)
7071
USER_CFLAGS = $(patsubst $(KERNEL_DEFINES),,$(patsubst -I%,,$(KBUILD_CFLAGS))) \
7172
$(ARCH_INCLUDE) $(MODE_INCLUDE) $(filter -I%,$(CFLAGS)) \
7273
-D_FILE_OFFSET_BITS=64 -idirafter $(srctree)/include \
73-
-idirafter $(objtree)/include -D__KERNEL__ -D__UM_HOST__
74+
-idirafter $(objtree)/include -D__KERNEL__ -D__UM_HOST__ \
75+
-include $(srctree)/include/linux/compiler-version.h \
76+
-include $(srctree)/include/linux/kconfig.h
7477

7578
#This will adjust *FLAGS accordingly to the platform.
7679
include $(srctree)/$(ARCH_DIR)/Makefile-os-Linux

arch/um/Makefile-skas

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,15 @@
33
# Licensed under the GPL
44
#
55

6-
GPROF_OPT += -pg
6+
export UM_GPROF_OPT += -pg
77

88
ifdef CONFIG_CC_IS_CLANG
9-
GCOV_OPT += -fprofile-instr-generate -fcoverage-mapping
9+
export UM_GCOV_OPT += -fprofile-instr-generate -fcoverage-mapping
1010
else
11-
GCOV_OPT += -fprofile-arcs -ftest-coverage
11+
export UM_GCOV_OPT += -fprofile-arcs -ftest-coverage
1212
endif
1313

14-
CFLAGS-$(CONFIG_GCOV) += $(GCOV_OPT)
15-
CFLAGS-$(CONFIG_GPROF) += $(GPROF_OPT)
16-
LINK-$(CONFIG_GCOV) += $(GCOV_OPT)
17-
LINK-$(CONFIG_GPROF) += $(GPROF_OPT)
14+
CFLAGS-$(CONFIG_GCOV) += $(UM_GCOV_OPT)
15+
CFLAGS-$(CONFIG_GPROF) += $(UM_GPROF_OPT)
16+
LINK-$(CONFIG_GCOV) += $(UM_GCOV_OPT)
17+
LINK-$(CONFIG_GPROF) += $(UM_GPROF_OPT)

arch/um/configs/i386_defconfig

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
CONFIG_3_LEVEL_PGTABLES=y
21
# CONFIG_COMPACTION is not set
32
CONFIG_BINFMT_MISC=m
43
CONFIG_HOSTFS=y

arch/um/drivers/chan_user.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,8 @@ static __noreturn int winch_thread(void *arg)
161161
int count;
162162
char c = 1;
163163

164+
os_set_pdeathsig();
165+
164166
pty_fd = data->pty_fd;
165167
pipe_fd = data->pipe_fd;
166168
count = write(pipe_fd, &c, sizeof(c));

arch/um/drivers/hostaudio_kern.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ MODULE_PARM_DESC(mixer, MIXER_HELP);
4848
#ifndef MODULE
4949
static int set_dsp(char *name, int *add)
5050
{
51+
*add = 0;
5152
dsp = name;
5253
return 0;
5354
}
@@ -56,6 +57,7 @@ __uml_setup("dsp=", set_dsp, "dsp=<dsp device>\n" DSP_HELP);
5657

5758
static int set_mixer(char *name, int *add)
5859
{
60+
*add = 0;
5961
mixer = name;
6062
return 0;
6163
}

arch/um/drivers/net_kern.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -336,7 +336,7 @@ static struct platform_driver uml_net_driver = {
336336

337337
static void net_device_release(struct device *dev)
338338
{
339-
struct uml_net *device = dev_get_drvdata(dev);
339+
struct uml_net *device = container_of(dev, struct uml_net, pdev.dev);
340340
struct net_device *netdev = device->dev;
341341
struct uml_net_private *lp = netdev_priv(netdev);
342342

arch/um/drivers/ubd_kern.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -779,7 +779,7 @@ static int ubd_open_dev(struct ubd *ubd_dev)
779779

780780
static void ubd_device_release(struct device *dev)
781781
{
782-
struct ubd *ubd_dev = dev_get_drvdata(dev);
782+
struct ubd *ubd_dev = container_of(dev, struct ubd, pdev.dev);
783783

784784
blk_mq_free_tag_set(&ubd_dev->tag_set);
785785
*ubd_dev = ((struct ubd) DEFAULT_UBD);
@@ -898,6 +898,8 @@ static int ubd_add(int n, char **error_out)
898898
if (err)
899899
goto out_cleanup_disk;
900900

901+
ubd_dev->disk = disk;
902+
901903
return 0;
902904

903905
out_cleanup_disk:
@@ -1499,6 +1501,7 @@ int io_thread(void *arg)
14991501
{
15001502
int n, count, written, res;
15011503

1504+
os_set_pdeathsig();
15021505
os_fix_helper_signals();
15031506

15041507
while(1){

arch/um/drivers/vector_kern.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -815,7 +815,8 @@ static struct platform_driver uml_net_driver = {
815815

816816
static void vector_device_release(struct device *dev)
817817
{
818-
struct vector_device *device = dev_get_drvdata(dev);
818+
struct vector_device *device =
819+
container_of(dev, struct vector_device, pdev.dev);
819820
struct net_device *netdev = device->dev;
820821

821822
list_del(&device->list);

arch/um/drivers/vhost_user.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
/* Feature bits */
1111
#define VHOST_USER_F_PROTOCOL_FEATURES 30
1212
/* Protocol feature bits */
13+
#define VHOST_USER_PROTOCOL_F_MQ 0
1314
#define VHOST_USER_PROTOCOL_F_REPLY_ACK 3
1415
#define VHOST_USER_PROTOCOL_F_SLAVE_REQ 5
1516
#define VHOST_USER_PROTOCOL_F_CONFIG 9
@@ -23,7 +24,8 @@
2324
/* Supported transport features */
2425
#define VHOST_USER_SUPPORTED_F BIT_ULL(VHOST_USER_F_PROTOCOL_FEATURES)
2526
/* Supported protocol features */
26-
#define VHOST_USER_SUPPORTED_PROTOCOL_F (BIT_ULL(VHOST_USER_PROTOCOL_F_REPLY_ACK) | \
27+
#define VHOST_USER_SUPPORTED_PROTOCOL_F (BIT_ULL(VHOST_USER_PROTOCOL_F_MQ) | \
28+
BIT_ULL(VHOST_USER_PROTOCOL_F_REPLY_ACK) | \
2729
BIT_ULL(VHOST_USER_PROTOCOL_F_SLAVE_REQ) | \
2830
BIT_ULL(VHOST_USER_PROTOCOL_F_CONFIG) | \
2931
BIT_ULL(VHOST_USER_PROTOCOL_F_INBAND_NOTIFICATIONS))

0 commit comments

Comments
 (0)