xen: fixes for 4.20-rc1

-----BEGIN PGP SIGNATURE-----
 
 iHUEABYIAB0WIQRTLbB6QfY48x44uB6AXGG7T9hjvgUCW9gK6gAKCRCAXGG7T9hj
 vvrrAP42oa7I9lPFNhN4UA7tb26G7r5u3eL6icbeFOhbWaic1AD+IEXJjF0x6rOc
 cbqIBv+dL7FXpfPkgaMuoRdIKsd0zgs=
 =DsRi
 -----END PGP SIGNATURE-----

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

Pull xen fixes from Juergen Gross:
 "Only several small fixes and cleanups this time"

* tag 'for-linus-4.20a-rc1-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/xen/tip:
  xen: drop writing error messages to xenstore
  xen/pvh: don't try to unplug emulated devices
  add myself as reviewer for Xen support in Linux
  xen: remove redundant 'default n' from Kconfig
  xen/balloon: Support xend-based toolstack
  xen/pvh: increase early stack size
  xen: make xen_qlock_wait() nestable
  xen: fix race in xen_qlock_wait()
  xen/balloon: Grammar s/Is it/It is/
  xen: Make XEN_BACKEND selectable by DomU
This commit is contained in:
Linus Torvalds 2018-10-30 09:31:07 -07:00
commit 5b4c0d87de
7 changed files with 30 additions and 42 deletions

View File

@ -16317,6 +16317,7 @@ F: arch/arm64/include/asm/xen/
XEN HYPERVISOR INTERFACE XEN HYPERVISOR INTERFACE
M: Boris Ostrovsky <boris.ostrovsky@oracle.com> M: Boris Ostrovsky <boris.ostrovsky@oracle.com>
M: Juergen Gross <jgross@suse.com> M: Juergen Gross <jgross@suse.com>
R: Stefano Stabellini <sstabellini@kernel.org>
L: xen-devel@lists.xenproject.org (moderated for non-subscribers) L: xen-devel@lists.xenproject.org (moderated for non-subscribers)
T: git git://git.kernel.org/pub/scm/linux/kernel/git/xen/tip.git T: git git://git.kernel.org/pub/scm/linux/kernel/git/xen/tip.git
S: Supported S: Supported

View File

@ -134,6 +134,10 @@ void xen_unplug_emulated_devices(void)
{ {
int r; int r;
/* PVH guests don't have emulated devices. */
if (xen_pvh_domain())
return;
/* user explicitly requested no unplug */ /* user explicitly requested no unplug */
if (xen_emul_unplug & XEN_UNPLUG_NEVER) if (xen_emul_unplug & XEN_UNPLUG_NEVER)
return; return;

View File

@ -39,34 +39,25 @@ static void xen_qlock_kick(int cpu)
*/ */
static void xen_qlock_wait(u8 *byte, u8 val) static void xen_qlock_wait(u8 *byte, u8 val)
{ {
unsigned long flags;
int irq = __this_cpu_read(lock_kicker_irq); int irq = __this_cpu_read(lock_kicker_irq);
/* If kicker interrupts not initialized yet, just spin */ /* If kicker interrupts not initialized yet, just spin */
if (irq == -1) if (irq == -1 || in_nmi())
return; return;
/* clear pending */ /* Guard against reentry. */
xen_clear_irq_pending(irq); local_irq_save(flags);
barrier();
/* /* If irq pending already clear it. */
* We check the byte value after clearing pending IRQ to make sure if (xen_test_irq_pending(irq)) {
* that we won't miss a wakeup event because of the clearing. xen_clear_irq_pending(irq);
* } else if (READ_ONCE(*byte) == val) {
* The sync_clear_bit() call in xen_clear_irq_pending() is atomic. /* Block until irq becomes pending (or a spurious wakeup) */
* So it is effectively a memory barrier for x86. xen_poll_irq(irq);
*/ }
if (READ_ONCE(*byte) != val)
return;
/* local_irq_restore(flags);
* If an interrupt happens here, it will leave the wakeup irq
* pending, which will cause xen_poll_irq() to return
* immediately.
*/
/* Block until irq becomes pending (or perhaps a spurious wakeup) */
xen_poll_irq(irq);
} }
static irqreturn_t dummy_handler(int irq, void *dev_id) static irqreturn_t dummy_handler(int irq, void *dev_id)

View File

@ -170,7 +170,7 @@ canary:
.fill 48, 1, 0 .fill 48, 1, 0
early_stack: early_stack:
.fill 256, 1, 0 .fill BOOT_STACK_SIZE, 1, 0
early_stack_end: early_stack_end:
ELFNOTE(Xen, XEN_ELFNOTE_PHYS32_ENTRY, ELFNOTE(Xen, XEN_ELFNOTE_PHYS32_ENTRY,

View File

@ -12,7 +12,6 @@ config XEN_BALLOON
config XEN_SELFBALLOONING config XEN_SELFBALLOONING
bool "Dynamically self-balloon kernel memory to target" bool "Dynamically self-balloon kernel memory to target"
depends on XEN && XEN_BALLOON && CLEANCACHE && SWAP && XEN_TMEM depends on XEN && XEN_BALLOON && CLEANCACHE && SWAP && XEN_TMEM
default n
help help
Self-ballooning dynamically balloons available kernel memory driven Self-ballooning dynamically balloons available kernel memory driven
by the current usage of anonymous memory ("committed AS") and by the current usage of anonymous memory ("committed AS") and
@ -27,7 +26,6 @@ config XEN_SELFBALLOONING
config XEN_BALLOON_MEMORY_HOTPLUG config XEN_BALLOON_MEMORY_HOTPLUG
bool "Memory hotplug support for Xen balloon driver" bool "Memory hotplug support for Xen balloon driver"
default n
depends on XEN_BALLOON && MEMORY_HOTPLUG depends on XEN_BALLOON && MEMORY_HOTPLUG
help help
Memory hotplug support for Xen balloon driver allows expanding memory Memory hotplug support for Xen balloon driver allows expanding memory
@ -86,7 +84,7 @@ config XEN_SCRUB_PAGES_DEFAULT
help help
Scrub pages before returning them to the system for reuse by Scrub pages before returning them to the system for reuse by
other domains. This makes sure that any confidential data other domains. This makes sure that any confidential data
is not accidentally visible to other domains. Is it more is not accidentally visible to other domains. It is more
secure, but slightly less efficient. This can be controlled with secure, but slightly less efficient. This can be controlled with
xen_scrub_pages=0 parameter and xen_scrub_pages=0 parameter and
/sys/devices/system/xen_memory/xen_memory0/scrub_pages. /sys/devices/system/xen_memory/xen_memory0/scrub_pages.
@ -105,8 +103,7 @@ config XEN_DEV_EVTCHN
config XEN_BACKEND config XEN_BACKEND
bool "Backend driver support" bool "Backend driver support"
depends on XEN_DOM0 default XEN_DOM0
default y
help help
Support for backend device drivers that provide I/O services Support for backend device drivers that provide I/O services
to other virtual machines. to other virtual machines.
@ -227,7 +224,6 @@ config XEN_PCIDEV_BACKEND
config XEN_PVCALLS_FRONTEND config XEN_PVCALLS_FRONTEND
tristate "XEN PV Calls frontend driver" tristate "XEN PV Calls frontend driver"
depends on INET && XEN depends on INET && XEN
default n
select XEN_XENBUS_FRONTEND select XEN_XENBUS_FRONTEND
help help
Experimental frontend for the Xen PV Calls protocol Experimental frontend for the Xen PV Calls protocol
@ -238,7 +234,6 @@ config XEN_PVCALLS_FRONTEND
config XEN_PVCALLS_BACKEND config XEN_PVCALLS_BACKEND
bool "XEN PV Calls backend driver" bool "XEN PV Calls backend driver"
depends on INET && XEN && XEN_BACKEND depends on INET && XEN && XEN_BACKEND
default n
help help
Experimental backend for the Xen PV Calls protocol Experimental backend for the Xen PV Calls protocol
(https://xenbits.xen.org/docs/unstable/misc/pvcalls.html). It (https://xenbits.xen.org/docs/unstable/misc/pvcalls.html). It
@ -264,7 +259,6 @@ config XEN_PRIVCMD
config XEN_STUB config XEN_STUB
bool "Xen stub drivers" bool "Xen stub drivers"
depends on XEN && X86_64 && BROKEN depends on XEN && X86_64 && BROKEN
default n
help help
Allow kernel to install stub drivers, to reserve space for Xen drivers, Allow kernel to install stub drivers, to reserve space for Xen drivers,
i.e. memory hotplug and cpu hotplug, and to block native drivers loaded, i.e. memory hotplug and cpu hotplug, and to block native drivers loaded,
@ -275,7 +269,6 @@ config XEN_STUB
config XEN_ACPI_HOTPLUG_MEMORY config XEN_ACPI_HOTPLUG_MEMORY
tristate "Xen ACPI memory hotplug" tristate "Xen ACPI memory hotplug"
depends on XEN_DOM0 && XEN_STUB && ACPI depends on XEN_DOM0 && XEN_STUB && ACPI
default n
help help
This is Xen ACPI memory hotplug. This is Xen ACPI memory hotplug.
@ -287,7 +280,6 @@ config XEN_ACPI_HOTPLUG_CPU
tristate "Xen ACPI cpu hotplug" tristate "Xen ACPI cpu hotplug"
depends on XEN_DOM0 && XEN_STUB && ACPI depends on XEN_DOM0 && XEN_STUB && ACPI
select ACPI_CONTAINER select ACPI_CONTAINER
default n
help help
Xen ACPI cpu enumerating and hotplugging Xen ACPI cpu enumerating and hotplugging
@ -316,7 +308,6 @@ config XEN_ACPI_PROCESSOR
config XEN_MCE_LOG config XEN_MCE_LOG
bool "Xen platform mcelog" bool "Xen platform mcelog"
depends on XEN_DOM0 && X86_64 && X86_MCE depends on XEN_DOM0 && X86_64 && X86_MCE
default n
help help
Allow kernel fetching MCE error from Xen platform and Allow kernel fetching MCE error from Xen platform and
converting it into Linux mcelog format for mcelog tools converting it into Linux mcelog format for mcelog tools

View File

@ -76,12 +76,15 @@ static void watch_target(struct xenbus_watch *watch,
if (!watch_fired) { if (!watch_fired) {
watch_fired = true; watch_fired = true;
err = xenbus_scanf(XBT_NIL, "memory", "static-max", "%llu",
&static_max); if ((xenbus_scanf(XBT_NIL, "memory", "static-max",
if (err != 1) "%llu", &static_max) == 1) ||
static_max = new_target; (xenbus_scanf(XBT_NIL, "memory", "memory_static_max",
else "%llu", &static_max) == 1))
static_max >>= PAGE_SHIFT - 10; static_max >>= PAGE_SHIFT - 10;
else
static_max = new_target;
target_diff = (xen_pv_domain() || xen_initial_domain()) ? 0 target_diff = (xen_pv_domain() || xen_initial_domain()) ? 0
: static_max - balloon_stats.target_pages; : static_max - balloon_stats.target_pages;
} }

View File

@ -278,10 +278,8 @@ static void xenbus_va_dev_error(struct xenbus_device *dev, int err,
dev_err(&dev->dev, "%s\n", printf_buffer); dev_err(&dev->dev, "%s\n", printf_buffer);
path_buffer = kasprintf(GFP_KERNEL, "error/%s", dev->nodename); path_buffer = kasprintf(GFP_KERNEL, "error/%s", dev->nodename);
if (!path_buffer || if (path_buffer)
xenbus_write(XBT_NIL, path_buffer, "error", printf_buffer)) xenbus_write(XBT_NIL, path_buffer, "error", printf_buffer);
dev_err(&dev->dev, "failed to write error node for %s (%s)\n",
dev->nodename, printf_buffer);
kfree(printf_buffer); kfree(printf_buffer);
kfree(path_buffer); kfree(path_buffer);