Skip to content

Commit

Permalink
Merge tag 'for-linus-5.8b-rc1-tag' of git://git.kernel.org/pub/scm/li…
Browse files Browse the repository at this point in the history
…nux/kernel/git/xen/tip

Pull xen updates from Juergen Gross:

 - several smaller cleanups

 - a fix for a Xen guest regression with CPU offlining

 - a small fix in the xen pvcalls backend driver

 - an update of MAINTAINERS

* tag 'for-linus-5.8b-rc1-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/xen/tip:
  MAINTAINERS: Update PARAVIRT_OPS_INTERFACE and VMWARE_HYPERVISOR_INTERFACE
  xen/pci: Get rid of verbose_request and use dev_dbg() instead
  xenbus: Use dev_printk() when possible
  xen-pciback: Use dev_printk() when possible
  xen: enable BALLOON_MEMORY_HOTPLUG by default
  xen: expand BALLOON_MEMORY_HOTPLUG description
  xen/pvcalls: Make pvcalls_back_global static
  xen/cpuhotplug: Fix initial CPU offlining for PV(H) guests
  xen-platform: Constify dev_pm_ops
  xen/pvcalls-back: test for errors when calling backend_connect()
  • Loading branch information
torvalds committed Jun 12, 2020
2 parents b791d1b + a952f64 commit d2d5439
Show file tree
Hide file tree
Showing 14 changed files with 90 additions and 142 deletions.
4 changes: 2 additions & 2 deletions MAINTAINERS
Original file line number Diff line number Diff line change
Expand Up @@ -12911,7 +12911,7 @@ F: include/uapi/linux/ppdev.h

PARAVIRT_OPS INTERFACE
M: Juergen Gross <[email protected]>
M: Thomas Hellstrom <thellstrom@vmware.com>
M: Deep Shah <sdeep@vmware.com>
M: "VMware, Inc." <[email protected]>
L: [email protected]
S: Supported
Expand Down Expand Up @@ -18287,7 +18287,7 @@ S: Maintained
F: drivers/misc/vmw_balloon.c

VMWARE HYPERVISOR INTERFACE
M: Thomas Hellstrom <thellstrom@vmware.com>
M: Deep Shah <sdeep@vmware.com>
M: "VMware, Inc." <[email protected]>
L: [email protected]
S: Supported
Expand Down
27 changes: 10 additions & 17 deletions drivers/pci/xen-pcifront.c
Original file line number Diff line number Diff line change
Expand Up @@ -77,9 +77,6 @@ static inline void pcifront_init_sd(struct pcifront_sd *sd,
static DEFINE_SPINLOCK(pcifront_dev_lock);
static struct pcifront_device *pcifront_dev;

static int verbose_request;
module_param(verbose_request, int, 0644);

static int errno_to_pcibios_err(int errno)
{
switch (errno) {
Expand Down Expand Up @@ -190,18 +187,16 @@ static int pcifront_bus_read(struct pci_bus *bus, unsigned int devfn,
struct pcifront_sd *sd = bus->sysdata;
struct pcifront_device *pdev = pcifront_get_pdev(sd);

if (verbose_request)
dev_info(&pdev->xdev->dev,
"read dev=%04x:%02x:%02x.%d - offset %x size %d\n",
pci_domain_nr(bus), bus->number, PCI_SLOT(devfn),
PCI_FUNC(devfn), where, size);
dev_dbg(&pdev->xdev->dev,
"read dev=%04x:%02x:%02x.%d - offset %x size %d\n",
pci_domain_nr(bus), bus->number, PCI_SLOT(devfn),
PCI_FUNC(devfn), where, size);

err = do_pci_op(pdev, &op);

if (likely(!err)) {
if (verbose_request)
dev_info(&pdev->xdev->dev, "read got back value %x\n",
op.value);
dev_dbg(&pdev->xdev->dev, "read got back value %x\n",
op.value);

*val = op.value;
} else if (err == -ENODEV) {
Expand Down Expand Up @@ -229,12 +224,10 @@ static int pcifront_bus_write(struct pci_bus *bus, unsigned int devfn,
struct pcifront_sd *sd = bus->sysdata;
struct pcifront_device *pdev = pcifront_get_pdev(sd);

if (verbose_request)
dev_info(&pdev->xdev->dev,
"write dev=%04x:%02x:%02x.%d - "
"offset %x size %d val %x\n",
pci_domain_nr(bus), bus->number,
PCI_SLOT(devfn), PCI_FUNC(devfn), where, size, val);
dev_dbg(&pdev->xdev->dev,
"write dev=%04x:%02x:%02x.%d - offset %x size %d val %x\n",
pci_domain_nr(bus), bus->number,
PCI_SLOT(devfn), PCI_FUNC(devfn), where, size, val);

return errno_to_pcibios_err(do_pci_op(pdev, &op));
}
Expand Down
4 changes: 4 additions & 0 deletions drivers/xen/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,16 @@ config XEN_BALLOON
config XEN_BALLOON_MEMORY_HOTPLUG
bool "Memory hotplug support for Xen balloon driver"
depends on XEN_BALLOON && MEMORY_HOTPLUG
default y
help
Memory hotplug support for Xen balloon driver allows expanding memory
available for the system above limit declared at system startup.
It is very useful on critical systems which require long
run without rebooting.

It's also very useful for non PV domains to obtain unpopulated physical
memory ranges to use in order to map foreign memory or grants.

Memory could be hotplugged in following steps:

1) target domain: ensure that memory auto online policy is in
Expand Down
8 changes: 3 additions & 5 deletions drivers/xen/cpu_hotplug.c
Original file line number Diff line number Diff line change
Expand Up @@ -93,10 +93,8 @@ static int setup_cpu_watcher(struct notifier_block *notifier,
(void)register_xenbus_watch(&cpu_watch);

for_each_possible_cpu(cpu) {
if (vcpu_online(cpu) == 0) {
device_offline(get_cpu_device(cpu));
set_cpu_present(cpu, false);
}
if (vcpu_online(cpu) == 0)
disable_hotplug_cpu(cpu);
}

return NOTIFY_DONE;
Expand All @@ -119,5 +117,5 @@ static int __init setup_vcpu_hotplug_event(void)
return 0;
}

arch_initcall(setup_vcpu_hotplug_event);
late_initcall(setup_vcpu_hotplug_event);

2 changes: 1 addition & 1 deletion drivers/xen/platform-pci.c
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ static const struct pci_device_id platform_pci_tbl[] = {
{0,}
};

static struct dev_pm_ops platform_pm_ops = {
static const struct dev_pm_ops platform_pm_ops = {
.resume_noirq = platform_pci_resume,
};

Expand Down
5 changes: 3 additions & 2 deletions drivers/xen/pvcalls-back.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
#define PVCALLS_VERSIONS "1"
#define MAX_RING_ORDER XENBUS_MAX_RING_GRANT_ORDER

struct pvcalls_back_global {
static struct pvcalls_back_global {
struct list_head frontends;
struct semaphore frontends_lock;
} pvcalls_back_global;
Expand Down Expand Up @@ -1088,7 +1088,8 @@ static void set_backend_state(struct xenbus_device *dev,
case XenbusStateInitialised:
switch (state) {
case XenbusStateConnected:
backend_connect(dev);
if (backend_connect(dev))
return;
xenbus_switch_state(dev, XenbusStateConnected);
break;
case XenbusStateClosing:
Expand Down
16 changes: 6 additions & 10 deletions drivers/xen/xen-pciback/conf_space.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
* Author: Ryan Wilson <[email protected]>
*/

#define dev_fmt(fmt) DRV_NAME ": " fmt

#include <linux/kernel.h>
#include <linux/moduleparam.h>
#include <linux/pci.h>
Expand Down Expand Up @@ -154,9 +156,7 @@ int xen_pcibk_config_read(struct pci_dev *dev, int offset, int size,
* (as if device didn't respond) */
u32 value = 0, tmp_val;

if (unlikely(verbose_request))
printk(KERN_DEBUG DRV_NAME ": %s: read %d bytes at 0x%x\n",
pci_name(dev), size, offset);
dev_dbg(&dev->dev, "read %d bytes at 0x%x\n", size, offset);

if (!valid_request(offset, size)) {
err = XEN_PCI_ERR_invalid_offset;
Expand Down Expand Up @@ -195,9 +195,7 @@ int xen_pcibk_config_read(struct pci_dev *dev, int offset, int size,
}

out:
if (unlikely(verbose_request))
printk(KERN_DEBUG DRV_NAME ": %s: read %d bytes at 0x%x = %x\n",
pci_name(dev), size, offset, value);
dev_dbg(&dev->dev, "read %d bytes at 0x%x = %x\n", size, offset, value);

*ret_val = value;
return xen_pcibios_err_to_errno(err);
Expand All @@ -212,10 +210,8 @@ int xen_pcibk_config_write(struct pci_dev *dev, int offset, int size, u32 value)
u32 tmp_val;
int field_start, field_end;

if (unlikely(verbose_request))
printk(KERN_DEBUG
DRV_NAME ": %s: write request %d bytes at 0x%x = %x\n",
pci_name(dev), size, offset, value);
dev_dbg(&dev->dev, "write request %d bytes at 0x%x = %x\n",
size, offset, value);

if (!valid_request(offset, size))
return XEN_PCI_ERR_invalid_offset;
Expand Down
44 changes: 14 additions & 30 deletions drivers/xen/xen-pciback/conf_space_header.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
*/

#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
#define dev_fmt pr_fmt

#include <linux/kernel.h>
#include <linux/pci.h>
Expand Down Expand Up @@ -67,53 +68,39 @@ static int command_write(struct pci_dev *dev, int offset, u16 value, void *data)

dev_data = pci_get_drvdata(dev);
if (!pci_is_enabled(dev) && is_enable_cmd(value)) {
if (unlikely(verbose_request))
printk(KERN_DEBUG DRV_NAME ": %s: enable\n",
pci_name(dev));
dev_dbg(&dev->dev, "enable\n");
err = pci_enable_device(dev);
if (err)
return err;
if (dev_data)
dev_data->enable_intx = 1;
} else if (pci_is_enabled(dev) && !is_enable_cmd(value)) {
if (unlikely(verbose_request))
printk(KERN_DEBUG DRV_NAME ": %s: disable\n",
pci_name(dev));
dev_dbg(&dev->dev, "disable\n");
pci_disable_device(dev);
if (dev_data)
dev_data->enable_intx = 0;
}

if (!dev->is_busmaster && is_master_cmd(value)) {
if (unlikely(verbose_request))
printk(KERN_DEBUG DRV_NAME ": %s: set bus master\n",
pci_name(dev));
dev_dbg(&dev->dev, "set bus master\n");
pci_set_master(dev);
} else if (dev->is_busmaster && !is_master_cmd(value)) {
if (unlikely(verbose_request))
printk(KERN_DEBUG DRV_NAME ": %s: clear bus master\n",
pci_name(dev));
dev_dbg(&dev->dev, "clear bus master\n");
pci_clear_master(dev);
}

if (!(cmd->val & PCI_COMMAND_INVALIDATE) &&
(value & PCI_COMMAND_INVALIDATE)) {
if (unlikely(verbose_request))
printk(KERN_DEBUG
DRV_NAME ": %s: enable memory-write-invalidate\n",
pci_name(dev));
dev_dbg(&dev->dev, "enable memory-write-invalidate\n");
err = pci_set_mwi(dev);
if (err) {
pr_warn("%s: cannot enable memory-write-invalidate (%d)\n",
pci_name(dev), err);
dev_warn(&dev->dev, "cannot enable memory-write-invalidate (%d)\n",
err);
value &= ~PCI_COMMAND_INVALIDATE;
}
} else if ((cmd->val & PCI_COMMAND_INVALIDATE) &&
!(value & PCI_COMMAND_INVALIDATE)) {
if (unlikely(verbose_request))
printk(KERN_DEBUG
DRV_NAME ": %s: disable memory-write-invalidate\n",
pci_name(dev));
dev_dbg(&dev->dev, "disable memory-write-invalidate\n");
pci_clear_mwi(dev);
}

Expand Down Expand Up @@ -157,8 +144,7 @@ static int rom_write(struct pci_dev *dev, int offset, u32 value, void *data)
struct pci_bar_info *bar = data;

if (unlikely(!bar)) {
pr_warn(DRV_NAME ": driver data not found for %s\n",
pci_name(dev));
dev_warn(&dev->dev, "driver data not found\n");
return XEN_PCI_ERR_op_failed;
}

Expand Down Expand Up @@ -194,8 +180,7 @@ static int bar_write(struct pci_dev *dev, int offset, u32 value, void *data)
u32 mask;

if (unlikely(!bar)) {
pr_warn(DRV_NAME ": driver data not found for %s\n",
pci_name(dev));
dev_warn(&dev->dev, "driver data not found\n");
return XEN_PCI_ERR_op_failed;
}

Expand Down Expand Up @@ -228,8 +213,7 @@ static int bar_read(struct pci_dev *dev, int offset, u32 * value, void *data)
struct pci_bar_info *bar = data;

if (unlikely(!bar)) {
pr_warn(DRV_NAME ": driver data not found for %s\n",
pci_name(dev));
dev_warn(&dev->dev, "driver data not found\n");
return XEN_PCI_ERR_op_failed;
}

Expand Down Expand Up @@ -433,8 +417,8 @@ int xen_pcibk_config_header_add_fields(struct pci_dev *dev)

default:
err = -EINVAL;
pr_err("%s: Unsupported header type %d!\n",
pci_name(dev), dev->hdr_type);
dev_err(&dev->dev, "Unsupported header type %d!\n",
dev->hdr_type);
break;
}

Expand Down
6 changes: 4 additions & 2 deletions drivers/xen/xen-pciback/conf_space_quirks.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
* Author: Chris Bookholt <[email protected]>
*/

#define dev_fmt(fmt) DRV_NAME ": " fmt

#include <linux/kernel.h>
#include <linux/pci.h>
#include "pciback.h"
Expand Down Expand Up @@ -35,8 +37,8 @@ static struct xen_pcibk_config_quirk *xen_pcibk_find_quirk(struct pci_dev *dev)
if (match_one_device(&tmp_quirk->devid, dev) != NULL)
goto out;
tmp_quirk = NULL;
printk(KERN_DEBUG DRV_NAME
": quirk didn't match any device known\n");
dev_printk(KERN_DEBUG, &dev->dev,
"quirk didn't match any device known\n");
out:
return tmp_quirk;
}
Expand Down
Loading

0 comments on commit d2d5439

Please sign in to comment.