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

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

Pull UML updates from Richard Weinberger:

 - set_fs removal

 - Devicetree support

 - Many cleanups from Al

 - Various virtio and build related fixes

* tag 'for-linus-5.17-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rw/uml: (31 commits)
  um: virtio_uml: Allow probing from devicetree
  um: Add devicetree support
  um: Extract load file helper from initrd.c
  um: remove set_fs
  hostfs: Fix writeback of dirty pages
  um: Use swap() to make code cleaner
  um: header debriding - sigio.h
  um: header debriding - os.h
  um: header debriding - net_*.h
  um: header debriding - mem_user.h
  um: header debriding - activate_ipi()
  um: common-offsets.h debriding...
  um, x86: bury crypto_tfm_ctx_offset
  um: unexport handle_page_fault()
  um: remove a dangling extern of syscall_trace()
  um: kill unused cpu()
  uml/i386: missing include in barrier.h
  um: stop polluting the namespace with registers.h contents
  logic_io instance of iounmap() needs volatile on argument
  um: move amd64 variant of mmap(2) to arch/x86/um/syscalls_64.c
  ...
parents 5672cdfb db0dd9ce
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -2,3 +2,4 @@
kernel/config.c
kernel/config.tmp
kernel/vmlinux.lds
kernel/capflags.c
+1 −1
Original line number Diff line number Diff line
@@ -18,10 +18,10 @@ config UML
	select HAVE_DEBUG_KMEMLEAK
	select HAVE_DEBUG_BUGVERBOSE
	select NO_DMA if !UML_DMA_EMULATION
	select OF_EARLY_FLATTREE if OF
	select GENERIC_IRQ_SHOW
	select GENERIC_CPU_DEVICES
	select HAVE_GCC_PLUGINS
	select SET_FS
	select TRACE_IRQFLAGS_SUPPORT
	select TTY # Needed for line.c
	select HAVE_ARCH_VMAP_STACK
+4 −4
Original line number Diff line number Diff line
@@ -181,15 +181,15 @@ static unsigned long um_pci_cfgspace_read(void *priv, unsigned int offset,
	/* buf->data is maximum size - we may only use parts of it */
	struct um_pci_message_buffer *buf;
	u8 *data;
	unsigned long ret = ~0ULL;
	unsigned long ret = ULONG_MAX;

	if (!dev)
		return ~0ULL;
		return ULONG_MAX;

	buf = get_cpu_var(um_pci_msg_bufs);
	data = buf->data;

	memset(data, 0xff, sizeof(data));
	memset(buf->data, 0xff, sizeof(buf->data));

	switch (size) {
	case 1:
@@ -304,7 +304,7 @@ static unsigned long um_pci_bar_read(void *priv, unsigned int offset,
	/* buf->data is maximum size - we may only use parts of it */
	struct um_pci_message_buffer *buf;
	u8 *data;
	unsigned long ret = ~0ULL;
	unsigned long ret = ULONG_MAX;

	buf = get_cpu_var(um_pci_msg_bufs);
	data = buf->data;
+51 −3
Original line number Diff line number Diff line
@@ -21,6 +21,7 @@
 * Based on Virtio MMIO driver by Pawel Moll, copyright 2011-2014, ARM Ltd.
 */
#include <linux/module.h>
#include <linux/of.h>
#include <linux/platform_device.h>
#include <linux/slab.h>
#include <linux/virtio.h>
@@ -49,6 +50,7 @@ struct virtio_uml_platform_data {
struct virtio_uml_device {
	struct virtio_device vdev;
	struct platform_device *pdev;
	struct virtio_uml_platform_data *pdata;

	spinlock_t sock_lock;
	int sock, req_fd, irq;
@@ -149,7 +151,7 @@ static int vhost_user_recv(struct virtio_uml_device *vu_dev,
	if (rc == -ECONNRESET && vu_dev->registered) {
		struct virtio_uml_platform_data *pdata;

		pdata = vu_dev->pdev->dev.platform_data;
		pdata = vu_dev->pdata;

		virtio_break_device(&vu_dev->vdev);
		schedule_work(&pdata->conn_broken_wk);
@@ -1090,6 +1092,8 @@ static void virtio_uml_release_dev(struct device *d)
			container_of(d, struct virtio_device, dev);
	struct virtio_uml_device *vu_dev = to_virtio_uml_device(vdev);

	time_travel_propagate_time();

	/* might not have been opened due to not negotiating the feature */
	if (vu_dev->req_fd >= 0) {
		um_free_irq(vu_dev->irq, vu_dev);
@@ -1113,21 +1117,63 @@ void virtio_uml_set_no_vq_suspend(struct virtio_device *vdev,
		 no_vq_suspend ? "dis" : "en");
}

static void vu_of_conn_broken(struct work_struct *wk)
{
	/*
	 * We can't remove the device from the devicetree so the only thing we
	 * can do is warn.
	 */
	WARN_ON(1);
}

/* Platform device */

static struct virtio_uml_platform_data *
virtio_uml_create_pdata(struct platform_device *pdev)
{
	struct device_node *np = pdev->dev.of_node;
	struct virtio_uml_platform_data *pdata;
	int ret;

	if (!np)
		return ERR_PTR(-EINVAL);

	pdata = devm_kzalloc(&pdev->dev, sizeof(*pdata), GFP_KERNEL);
	if (!pdata)
		return ERR_PTR(-ENOMEM);

	INIT_WORK(&pdata->conn_broken_wk, vu_of_conn_broken);
	pdata->pdev = pdev;

	ret = of_property_read_string(np, "socket-path", &pdata->socket_path);
	if (ret)
		return ERR_PTR(ret);

	ret = of_property_read_u32(np, "virtio-device-id",
				   &pdata->virtio_device_id);
	if (ret)
		return ERR_PTR(ret);

	return pdata;
}

static int virtio_uml_probe(struct platform_device *pdev)
{
	struct virtio_uml_platform_data *pdata = pdev->dev.platform_data;
	struct virtio_uml_device *vu_dev;
	int rc;

	if (!pdata)
		return -EINVAL;
	if (!pdata) {
		pdata = virtio_uml_create_pdata(pdev);
		if (IS_ERR(pdata))
			return PTR_ERR(pdata);
	}

	vu_dev = kzalloc(sizeof(*vu_dev), GFP_KERNEL);
	if (!vu_dev)
		return -ENOMEM;

	vu_dev->pdata = pdata;
	vu_dev->vdev.dev.parent = &pdev->dev;
	vu_dev->vdev.dev.release = virtio_uml_release_dev;
	vu_dev->vdev.config = &virtio_uml_config_ops;
@@ -1136,6 +1182,8 @@ static int virtio_uml_probe(struct platform_device *pdev)
	vu_dev->pdev = pdev;
	vu_dev->req_fd = -1;

	time_travel_propagate_time();

	do {
		rc = os_connect_socket(pdata->socket_path);
	} while (rc == -EINTR);
+2 −2
Original line number Diff line number Diff line
@@ -14,7 +14,7 @@ static inline void um_ndelay(unsigned long nsecs)
	ndelay(nsecs);
}
#undef ndelay
#define ndelay um_ndelay
#define ndelay(n) um_ndelay(n)

static inline void um_udelay(unsigned long usecs)
{
@@ -26,5 +26,5 @@ static inline void um_udelay(unsigned long usecs)
	udelay(usecs);
}
#undef udelay
#define udelay um_udelay
#define udelay(n) um_udelay(n)
#endif /* __UM_DELAY_H */
Loading