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

Merge tag 'for-linus-7.1-rc1-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/xen/tip

Pull xen updates from Juergen Gross:

 - fix an error path in drivers/xen/manage.c

 - fix the Xen console driver solving a boot hangup when the console
   backend isn't yet running

 - comment fix in the Xen swiotlb driver

 - hardening for Xen on Arm adding a more thorough validation

 - cleanup of the Xen grant table code hiding suspend/resume code for
   the case if CONFIG_HIBERNATE_CALLBACKS isn't defined

* tag 'for-linus-7.1-rc1-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/xen/tip:
  xen/grant-table: guard gnttab_suspend/resume with CONFIG_HIBERNATE_CALLBACKS
  hvc/xen: Check console connection flag
  xen/swiotlb: fix stale reference to swiotlb_unmap_page()
  xen/manage: unwind partial shutdown watcher setup on error
  ARM: xen: validate hypervisor compatible before parsing its version
parents a5f99809 3f100dd6
Loading
Loading
Loading
Loading
+6 −4
Original line number Diff line number Diff line
@@ -218,8 +218,9 @@ static __initdata struct {
static int __init fdt_find_hyper_node(unsigned long node, const char *uname,
				      int depth, void *data)
{
	const void *s = NULL;
	const char *s = NULL;
	int len;
	size_t prefix_len = strlen(hyper_node.prefix);

	if (depth != 1 || strcmp(uname, "hypervisor") != 0)
		return 0;
@@ -228,9 +229,10 @@ static int __init fdt_find_hyper_node(unsigned long node, const char *uname,
		hyper_node.found = true;

	s = of_get_flat_dt_prop(node, "compatible", &len);
	if (strlen(hyper_node.prefix) + 3  < len &&
	    !strncmp(hyper_node.prefix, s, strlen(hyper_node.prefix)))
		hyper_node.version = s + strlen(hyper_node.prefix);
	if (s && len > 0 && strnlen(s, len) < len &&
	    len > prefix_len + 3 &&
	    !strncmp(hyper_node.prefix, s, prefix_len))
		hyper_node.version = s + prefix_len;

	/*
	 * Check if Xen supports EFI by checking whether there is the
+3 −0
Original line number Diff line number Diff line
@@ -139,6 +139,9 @@ static ssize_t domU_write_console(uint32_t vtermno, const u8 *data, size_t len)
	if (cons == NULL)
		return -EINVAL;

	if (cons->intf->connection == XENCONSOLE_DISCONNECTED)
		return -ENOTCONN;

	/*
	 * Make sure the whole buffer is emitted, polling if
	 * necessary.  We don't ever want to rely on the hvc daemon
+2 −1
Original line number Diff line number Diff line
@@ -1579,7 +1579,7 @@ static int gnttab_setup(void)
	}
	return gnttab_map(0, nr_grant_frames - 1);
}

#ifdef CONFIG_HIBERNATE_CALLBACKS
int gnttab_resume(void)
{
	gnttab_request_version();
@@ -1592,6 +1592,7 @@ int gnttab_suspend(void)
		gnttab_interface->unmap_frames();
	return 0;
}
#endif

static int gnttab_expand(unsigned int req_entries)
{
+17 −3
Original line number Diff line number Diff line
@@ -343,12 +343,11 @@ static int setup_shutdown_watcher(void)
		return err;
	}


#ifdef CONFIG_MAGIC_SYSRQ
	err = register_xenbus_watch(&sysrq_watch);
	if (err) {
		pr_err("Failed to set sysrq watcher\n");
		return err;
		goto err_unregister_shutdown;
	}
#endif

@@ -361,11 +360,26 @@ static int setup_shutdown_watcher(void)
		if (err) {
			pr_err("%s: Error %d writing %s\n", __func__,
				err, node);
			return err;
			goto err_remove_features;
		}
	}

	return 0;

err_remove_features:
	while (--idx >= 0) {
		if (!shutdown_handlers[idx].flag)
			continue;
		snprintf(node, FEATURE_PATH_SIZE, "feature-%s",
			 shutdown_handlers[idx].command);
		xenbus_rm(XBT_NIL, "control", node);
	}
#ifdef CONFIG_MAGIC_SYSRQ
	unregister_xenbus_watch(&sysrq_watch);
err_unregister_shutdown:
#endif
	unregister_xenbus_watch(&shutdown_watch);
	return err;
}

static int shutdown_event(struct notifier_block *notifier,
+1 −1
Original line number Diff line number Diff line
@@ -340,7 +340,7 @@ xen_swiotlb_sync_single_for_device(struct device *dev, dma_addr_t dma_addr,

/*
 * Unmap a set of streaming mode DMA translations.  Again, cpu read rules
 * concerning calls here are the same as for swiotlb_unmap_phys() above.
 * concerning calls here are the same as for xen_swiotlb_unmap_phys() above.
 */
static void
xen_swiotlb_unmap_sg(struct device *hwdev, struct scatterlist *sgl, int nelems,
Loading