Commit e8b767f5 authored by Linus Torvalds's avatar Linus Torvalds
Browse files

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

Pull UML updates from Richard Weinberger:

 - Devicetree support (for testing)

 - Various cleanups and fixes: UBD, port_user, uml_mconsole

 - Maintainer update

* tag 'for-linus-5.18-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rw/uml:
  um: run_helper: Write error message to kernel log on exec failure on host
  um: port_user: Improve error handling when port-helper is not found
  um: port_user: Allow setting path to port-helper using UML_PORT_HELPER envvar
  um: port_user: Search for in.telnetd in PATH
  um: clang: Strip out -mno-global-merge from USER_CFLAGS
  docs: UML: Mention telnetd for port channel
  um: Remove unused timeval_to_ns() function
  um: Fix uml_mconsole stop/go
  um: Cleanup syscall_handler_t definition/cast, fix warning
  uml: net: vector: fix const issue
  um: Fix WRITE_ZEROES in the UBD Driver
  um: Migrate vector drivers to NAPI
  um: Fix order of dtb unflatten/early init
  um: fix and optimize xor select template for CONFIG64 and timetravel mode
  um: Document dtb command line option
  lib/logic_iomem: correct fallback config references
  um: Remove duplicated include in syscalls_64.c
  MAINTAINERS: Update UserModeLinux entry
parents a87a08e3 82017457
Loading
Loading
Loading
Loading
+20 −0
Original line number Diff line number Diff line
@@ -1193,6 +1193,26 @@ E.g. ``os_close_file()`` is just a wrapper around ``close()``
which ensures that the userspace function close does not clash
with similarly named function(s) in the kernel part.

Using UML as a Test Platform
============================

UML is an excellent test platform for device driver development. As
with most things UML, "some user assembly may be required". It is
up to the user to build their emulation environment. UML at present
provides only the kernel infrastructure.

Part of this infrastructure is the ability to load and parse fdt
device tree blobs as used in Arm or Open Firmware platforms. These
are supplied as an optional extra argument to the kernel command
line::

    dtb=filename

The device tree is loaded and parsed at boottime and is accessible by
drivers which query it. At this moment in time this facility is
intended solely for development purposes. UML's own devices do not
query the device tree.

Security Considerations
-----------------------

+3 −2
Original line number Diff line number Diff line
@@ -20539,14 +20539,15 @@ F: Documentation/admin-guide/media/zr364xx*
F:	drivers/media/usb/zr364xx/
USER-MODE LINUX (UML)
M:	Jeff Dike <jdike@addtoit.com>
M:	Richard Weinberger <richard@nod.at>
M:	Anton Ivanov <anton.ivanov@cambridgegreys.com>
M:	Johannes Berg <johannes@sipsolutions.net>
L:	linux-um@lists.infradead.org
S:	Maintained
W:	http://user-mode-linux.sourceforge.net
Q:	https://patchwork.ozlabs.org/project/linux-um/list/
T:	git git://git.kernel.org/pub/scm/linux/kernel/git/rw/uml.git
T:	git git://git.kernel.org/pub/scm/linux/kernel/git/uml/linux.git next
T:	git git://git.kernel.org/pub/scm/linux/kernel/git/uml/linux.git fixes
F:	Documentation/virt/uml/
F:	arch/um/
F:	arch/x86/um/
+4 −0
Original line number Diff line number Diff line
@@ -75,6 +75,10 @@ USER_CFLAGS = $(patsubst $(KERNEL_DEFINES),,$(patsubst -I%,,$(KBUILD_CFLAGS))) \
		-D_FILE_OFFSET_BITS=64 -idirafter $(srctree)/include \
		-idirafter $(objtree)/include -D__KERNEL__ -D__UM_HOST__

ifdef CONFIG_CC_IS_CLANG
USER_CFLAGS := $(patsubst -mno-global-merge,,$(USER_CFLAGS))
endif

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

+2 −1
Original line number Diff line number Diff line
@@ -224,7 +224,7 @@ void mconsole_go(struct mc_request *req)

void mconsole_stop(struct mc_request *req)
{
	deactivate_fd(req->originating_fd, MCONSOLE_IRQ);
	block_signals();
	os_set_fd_block(req->originating_fd, 1);
	mconsole_reply(req, "stopped", 0, 0);
	for (;;) {
@@ -247,6 +247,7 @@ void mconsole_stop(struct mc_request *req)
	}
	os_set_fd_block(req->originating_fd, 0);
	mconsole_reply(req, "", 0, 0);
	unblock_signals();
}

static DEFINE_SPINLOCK(mc_devices_lock);
+17 −1
Original line number Diff line number Diff line
@@ -5,6 +5,7 @@

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <errno.h>
#include <termios.h>
#include <unistd.h>
@@ -167,14 +168,29 @@ static void port_pre_exec(void *arg)
int port_connection(int fd, int *socket, int *pid_out)
{
	int new, err;
	char *argv[] = { "/usr/sbin/in.telnetd", "-L",
	char *env;
	char *argv[] = { "in.telnetd", "-L",
			 OS_LIB_PATH "/uml/port-helper", NULL };
	struct port_pre_exec_data data;

	if ((env = getenv("UML_PORT_HELPER")))
		argv[2] = env;

	new = accept(fd, NULL, 0);
	if (new < 0)
		return -errno;

	err = os_access(argv[2], X_OK);
	if (err < 0) {
		printk(UM_KERN_ERR "port_connection : error accessing port-helper "
		       "executable at %s: %s\n", argv[2], strerror(-err));
		if (env == NULL)
			printk(UM_KERN_ERR "Set UML_PORT_HELPER environment "
				"variable to path to uml-utilities port-helper "
				"binary\n");
		goto out_close;
	}

	err = os_pipe(socket, 0, 0);
	if (err < 0)
		goto out_close;
Loading