Commit d2d5439d authored by Linus Torvalds's avatar Linus Torvalds

Merge tag 'for-linus-5.8b-rc1-tag' of git://git.kernel.org/pub/scm/linux/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()
parents b791d1bd a952f64d
...@@ -12911,7 +12911,7 @@ F: include/uapi/linux/ppdev.h ...@@ -12911,7 +12911,7 @@ F: include/uapi/linux/ppdev.h
PARAVIRT_OPS INTERFACE PARAVIRT_OPS INTERFACE
M: Juergen Gross <jgross@suse.com> M: Juergen Gross <jgross@suse.com>
M: Thomas Hellstrom <thellstrom@vmware.com> M: Deep Shah <sdeep@vmware.com>
M: "VMware, Inc." <pv-drivers@vmware.com> M: "VMware, Inc." <pv-drivers@vmware.com>
L: virtualization@lists.linux-foundation.org L: virtualization@lists.linux-foundation.org
S: Supported S: Supported
...@@ -18287,7 +18287,7 @@ S: Maintained ...@@ -18287,7 +18287,7 @@ S: Maintained
F: drivers/misc/vmw_balloon.c F: drivers/misc/vmw_balloon.c
VMWARE HYPERVISOR INTERFACE VMWARE HYPERVISOR INTERFACE
M: Thomas Hellstrom <thellstrom@vmware.com> M: Deep Shah <sdeep@vmware.com>
M: "VMware, Inc." <pv-drivers@vmware.com> M: "VMware, Inc." <pv-drivers@vmware.com>
L: virtualization@lists.linux-foundation.org L: virtualization@lists.linux-foundation.org
S: Supported S: Supported
......
...@@ -77,9 +77,6 @@ static inline void pcifront_init_sd(struct pcifront_sd *sd, ...@@ -77,9 +77,6 @@ static inline void pcifront_init_sd(struct pcifront_sd *sd,
static DEFINE_SPINLOCK(pcifront_dev_lock); static DEFINE_SPINLOCK(pcifront_dev_lock);
static struct pcifront_device *pcifront_dev; static struct pcifront_device *pcifront_dev;
static int verbose_request;
module_param(verbose_request, int, 0644);
static int errno_to_pcibios_err(int errno) static int errno_to_pcibios_err(int errno)
{ {
switch (errno) { switch (errno) {
...@@ -190,8 +187,7 @@ static int pcifront_bus_read(struct pci_bus *bus, unsigned int devfn, ...@@ -190,8 +187,7 @@ static int pcifront_bus_read(struct pci_bus *bus, unsigned int devfn,
struct pcifront_sd *sd = bus->sysdata; struct pcifront_sd *sd = bus->sysdata;
struct pcifront_device *pdev = pcifront_get_pdev(sd); struct pcifront_device *pdev = pcifront_get_pdev(sd);
if (verbose_request) dev_dbg(&pdev->xdev->dev,
dev_info(&pdev->xdev->dev,
"read dev=%04x:%02x:%02x.%d - offset %x size %d\n", "read dev=%04x:%02x:%02x.%d - offset %x size %d\n",
pci_domain_nr(bus), bus->number, PCI_SLOT(devfn), pci_domain_nr(bus), bus->number, PCI_SLOT(devfn),
PCI_FUNC(devfn), where, size); PCI_FUNC(devfn), where, size);
...@@ -199,8 +195,7 @@ static int pcifront_bus_read(struct pci_bus *bus, unsigned int devfn, ...@@ -199,8 +195,7 @@ static int pcifront_bus_read(struct pci_bus *bus, unsigned int devfn,
err = do_pci_op(pdev, &op); err = do_pci_op(pdev, &op);
if (likely(!err)) { if (likely(!err)) {
if (verbose_request) dev_dbg(&pdev->xdev->dev, "read got back value %x\n",
dev_info(&pdev->xdev->dev, "read got back value %x\n",
op.value); op.value);
*val = op.value; *val = op.value;
...@@ -229,10 +224,8 @@ static int pcifront_bus_write(struct pci_bus *bus, unsigned int devfn, ...@@ -229,10 +224,8 @@ static int pcifront_bus_write(struct pci_bus *bus, unsigned int devfn,
struct pcifront_sd *sd = bus->sysdata; struct pcifront_sd *sd = bus->sysdata;
struct pcifront_device *pdev = pcifront_get_pdev(sd); struct pcifront_device *pdev = pcifront_get_pdev(sd);
if (verbose_request) dev_dbg(&pdev->xdev->dev,
dev_info(&pdev->xdev->dev, "write dev=%04x:%02x:%02x.%d - offset %x size %d val %x\n",
"write dev=%04x:%02x:%02x.%d - "
"offset %x size %d val %x\n",
pci_domain_nr(bus), bus->number, pci_domain_nr(bus), bus->number,
PCI_SLOT(devfn), PCI_FUNC(devfn), where, size, val); PCI_SLOT(devfn), PCI_FUNC(devfn), where, size, val);
......
...@@ -13,12 +13,16 @@ config XEN_BALLOON ...@@ -13,12 +13,16 @@ config XEN_BALLOON
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"
depends on XEN_BALLOON && MEMORY_HOTPLUG depends on XEN_BALLOON && MEMORY_HOTPLUG
default y
help help
Memory hotplug support for Xen balloon driver allows expanding memory Memory hotplug support for Xen balloon driver allows expanding memory
available for the system above limit declared at system startup. available for the system above limit declared at system startup.
It is very useful on critical systems which require long It is very useful on critical systems which require long
run without rebooting. 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: Memory could be hotplugged in following steps:
1) target domain: ensure that memory auto online policy is in 1) target domain: ensure that memory auto online policy is in
......
...@@ -93,10 +93,8 @@ static int setup_cpu_watcher(struct notifier_block *notifier, ...@@ -93,10 +93,8 @@ static int setup_cpu_watcher(struct notifier_block *notifier,
(void)register_xenbus_watch(&cpu_watch); (void)register_xenbus_watch(&cpu_watch);
for_each_possible_cpu(cpu) { for_each_possible_cpu(cpu) {
if (vcpu_online(cpu) == 0) { if (vcpu_online(cpu) == 0)
device_offline(get_cpu_device(cpu)); disable_hotplug_cpu(cpu);
set_cpu_present(cpu, false);
}
} }
return NOTIFY_DONE; return NOTIFY_DONE;
...@@ -119,5 +117,5 @@ static int __init setup_vcpu_hotplug_event(void) ...@@ -119,5 +117,5 @@ static int __init setup_vcpu_hotplug_event(void)
return 0; return 0;
} }
arch_initcall(setup_vcpu_hotplug_event); late_initcall(setup_vcpu_hotplug_event);
...@@ -168,7 +168,7 @@ static const struct pci_device_id platform_pci_tbl[] = { ...@@ -168,7 +168,7 @@ static const struct pci_device_id platform_pci_tbl[] = {
{0,} {0,}
}; };
static struct dev_pm_ops platform_pm_ops = { static const struct dev_pm_ops platform_pm_ops = {
.resume_noirq = platform_pci_resume, .resume_noirq = platform_pci_resume,
}; };
......
...@@ -24,7 +24,7 @@ ...@@ -24,7 +24,7 @@
#define PVCALLS_VERSIONS "1" #define PVCALLS_VERSIONS "1"
#define MAX_RING_ORDER XENBUS_MAX_RING_GRANT_ORDER #define MAX_RING_ORDER XENBUS_MAX_RING_GRANT_ORDER
struct pvcalls_back_global { static struct pvcalls_back_global {
struct list_head frontends; struct list_head frontends;
struct semaphore frontends_lock; struct semaphore frontends_lock;
} pvcalls_back_global; } pvcalls_back_global;
...@@ -1088,7 +1088,8 @@ static void set_backend_state(struct xenbus_device *dev, ...@@ -1088,7 +1088,8 @@ static void set_backend_state(struct xenbus_device *dev,
case XenbusStateInitialised: case XenbusStateInitialised:
switch (state) { switch (state) {
case XenbusStateConnected: case XenbusStateConnected:
backend_connect(dev); if (backend_connect(dev))
return;
xenbus_switch_state(dev, XenbusStateConnected); xenbus_switch_state(dev, XenbusStateConnected);
break; break;
case XenbusStateClosing: case XenbusStateClosing:
......
...@@ -10,6 +10,8 @@ ...@@ -10,6 +10,8 @@
* Author: Ryan Wilson <hap9@epoch.ncsc.mil> * Author: Ryan Wilson <hap9@epoch.ncsc.mil>
*/ */
#define dev_fmt(fmt) DRV_NAME ": " fmt
#include <linux/kernel.h> #include <linux/kernel.h>
#include <linux/moduleparam.h> #include <linux/moduleparam.h>
#include <linux/pci.h> #include <linux/pci.h>
...@@ -154,9 +156,7 @@ int xen_pcibk_config_read(struct pci_dev *dev, int offset, int size, ...@@ -154,9 +156,7 @@ int xen_pcibk_config_read(struct pci_dev *dev, int offset, int size,
* (as if device didn't respond) */ * (as if device didn't respond) */
u32 value = 0, tmp_val; u32 value = 0, tmp_val;
if (unlikely(verbose_request)) dev_dbg(&dev->dev, "read %d bytes at 0x%x\n", size, offset);
printk(KERN_DEBUG DRV_NAME ": %s: read %d bytes at 0x%x\n",
pci_name(dev), size, offset);
if (!valid_request(offset, size)) { if (!valid_request(offset, size)) {
err = XEN_PCI_ERR_invalid_offset; err = XEN_PCI_ERR_invalid_offset;
...@@ -195,9 +195,7 @@ int xen_pcibk_config_read(struct pci_dev *dev, int offset, int size, ...@@ -195,9 +195,7 @@ int xen_pcibk_config_read(struct pci_dev *dev, int offset, int size,
} }
out: out:
if (unlikely(verbose_request)) dev_dbg(&dev->dev, "read %d bytes at 0x%x = %x\n", size, offset, value);
printk(KERN_DEBUG DRV_NAME ": %s: read %d bytes at 0x%x = %x\n",
pci_name(dev), size, offset, value);
*ret_val = value; *ret_val = value;
return xen_pcibios_err_to_errno(err); return xen_pcibios_err_to_errno(err);
...@@ -212,10 +210,8 @@ int xen_pcibk_config_write(struct pci_dev *dev, int offset, int size, u32 value) ...@@ -212,10 +210,8 @@ int xen_pcibk_config_write(struct pci_dev *dev, int offset, int size, u32 value)
u32 tmp_val; u32 tmp_val;
int field_start, field_end; int field_start, field_end;
if (unlikely(verbose_request)) dev_dbg(&dev->dev, "write request %d bytes at 0x%x = %x\n",
printk(KERN_DEBUG size, offset, value);
DRV_NAME ": %s: write request %d bytes at 0x%x = %x\n",
pci_name(dev), size, offset, value);
if (!valid_request(offset, size)) if (!valid_request(offset, size))
return XEN_PCI_ERR_invalid_offset; return XEN_PCI_ERR_invalid_offset;
......
...@@ -6,6 +6,7 @@ ...@@ -6,6 +6,7 @@
*/ */
#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
#define dev_fmt pr_fmt
#include <linux/kernel.h> #include <linux/kernel.h>
#include <linux/pci.h> #include <linux/pci.h>
...@@ -67,53 +68,39 @@ static int command_write(struct pci_dev *dev, int offset, u16 value, void *data) ...@@ -67,53 +68,39 @@ static int command_write(struct pci_dev *dev, int offset, u16 value, void *data)
dev_data = pci_get_drvdata(dev); dev_data = pci_get_drvdata(dev);
if (!pci_is_enabled(dev) && is_enable_cmd(value)) { if (!pci_is_enabled(dev) && is_enable_cmd(value)) {
if (unlikely(verbose_request)) dev_dbg(&dev->dev, "enable\n");
printk(KERN_DEBUG DRV_NAME ": %s: enable\n",
pci_name(dev));
err = pci_enable_device(dev); err = pci_enable_device(dev);
if (err) if (err)
return err; return err;
if (dev_data) if (dev_data)
dev_data->enable_intx = 1; dev_data->enable_intx = 1;
} else if (pci_is_enabled(dev) && !is_enable_cmd(value)) { } else if (pci_is_enabled(dev) && !is_enable_cmd(value)) {
if (unlikely(verbose_request)) dev_dbg(&dev->dev, "disable\n");
printk(KERN_DEBUG DRV_NAME ": %s: disable\n",
pci_name(dev));
pci_disable_device(dev); pci_disable_device(dev);
if (dev_data) if (dev_data)
dev_data->enable_intx = 0; dev_data->enable_intx = 0;
} }
if (!dev->is_busmaster && is_master_cmd(value)) { if (!dev->is_busmaster && is_master_cmd(value)) {
if (unlikely(verbose_request)) dev_dbg(&dev->dev, "set bus master\n");
printk(KERN_DEBUG DRV_NAME ": %s: set bus master\n",
pci_name(dev));
pci_set_master(dev); pci_set_master(dev);
} else if (dev->is_busmaster && !is_master_cmd(value)) { } else if (dev->is_busmaster && !is_master_cmd(value)) {
if (unlikely(verbose_request)) dev_dbg(&dev->dev, "clear bus master\n");
printk(KERN_DEBUG DRV_NAME ": %s: clear bus master\n",
pci_name(dev));
pci_clear_master(dev); pci_clear_master(dev);
} }
if (!(cmd->val & PCI_COMMAND_INVALIDATE) && if (!(cmd->val & PCI_COMMAND_INVALIDATE) &&
(value & PCI_COMMAND_INVALIDATE)) { (value & PCI_COMMAND_INVALIDATE)) {
if (unlikely(verbose_request)) dev_dbg(&dev->dev, "enable memory-write-invalidate\n");
printk(KERN_DEBUG
DRV_NAME ": %s: enable memory-write-invalidate\n",
pci_name(dev));
err = pci_set_mwi(dev); err = pci_set_mwi(dev);
if (err) { if (err) {
pr_warn("%s: cannot enable memory-write-invalidate (%d)\n", dev_warn(&dev->dev, "cannot enable memory-write-invalidate (%d)\n",
pci_name(dev), err); err);
value &= ~PCI_COMMAND_INVALIDATE; value &= ~PCI_COMMAND_INVALIDATE;
} }
} else if ((cmd->val & PCI_COMMAND_INVALIDATE) && } else if ((cmd->val & PCI_COMMAND_INVALIDATE) &&
!(value & PCI_COMMAND_INVALIDATE)) { !(value & PCI_COMMAND_INVALIDATE)) {
if (unlikely(verbose_request)) dev_dbg(&dev->dev, "disable memory-write-invalidate\n");
printk(KERN_DEBUG
DRV_NAME ": %s: disable memory-write-invalidate\n",
pci_name(dev));
pci_clear_mwi(dev); pci_clear_mwi(dev);
} }
...@@ -157,8 +144,7 @@ static int rom_write(struct pci_dev *dev, int offset, u32 value, void *data) ...@@ -157,8 +144,7 @@ static int rom_write(struct pci_dev *dev, int offset, u32 value, void *data)
struct pci_bar_info *bar = data; struct pci_bar_info *bar = data;
if (unlikely(!bar)) { if (unlikely(!bar)) {
pr_warn(DRV_NAME ": driver data not found for %s\n", dev_warn(&dev->dev, "driver data not found\n");
pci_name(dev));
return XEN_PCI_ERR_op_failed; return XEN_PCI_ERR_op_failed;
} }
...@@ -194,8 +180,7 @@ static int bar_write(struct pci_dev *dev, int offset, u32 value, void *data) ...@@ -194,8 +180,7 @@ static int bar_write(struct pci_dev *dev, int offset, u32 value, void *data)
u32 mask; u32 mask;
if (unlikely(!bar)) { if (unlikely(!bar)) {
pr_warn(DRV_NAME ": driver data not found for %s\n", dev_warn(&dev->dev, "driver data not found\n");
pci_name(dev));
return XEN_PCI_ERR_op_failed; return XEN_PCI_ERR_op_failed;
} }
...@@ -228,8 +213,7 @@ static int bar_read(struct pci_dev *dev, int offset, u32 * value, void *data) ...@@ -228,8 +213,7 @@ static int bar_read(struct pci_dev *dev, int offset, u32 * value, void *data)
struct pci_bar_info *bar = data; struct pci_bar_info *bar = data;
if (unlikely(!bar)) { if (unlikely(!bar)) {
pr_warn(DRV_NAME ": driver data not found for %s\n", dev_warn(&dev->dev, "driver data not found\n");
pci_name(dev));
return XEN_PCI_ERR_op_failed; return XEN_PCI_ERR_op_failed;
} }
...@@ -433,8 +417,8 @@ int xen_pcibk_config_header_add_fields(struct pci_dev *dev) ...@@ -433,8 +417,8 @@ int xen_pcibk_config_header_add_fields(struct pci_dev *dev)
default: default:
err = -EINVAL; err = -EINVAL;
pr_err("%s: Unsupported header type %d!\n", dev_err(&dev->dev, "Unsupported header type %d!\n",
pci_name(dev), dev->hdr_type); dev->hdr_type);
break; break;
} }
......
...@@ -6,6 +6,8 @@ ...@@ -6,6 +6,8 @@
* Author: Chris Bookholt <hap10@epoch.ncsc.mil> * Author: Chris Bookholt <hap10@epoch.ncsc.mil>
*/ */
#define dev_fmt(fmt) DRV_NAME ": " fmt
#include <linux/kernel.h> #include <linux/kernel.h>
#include <linux/pci.h> #include <linux/pci.h>
#include "pciback.h" #include "pciback.h"
...@@ -35,8 +37,8 @@ static struct xen_pcibk_config_quirk *xen_pcibk_find_quirk(struct pci_dev *dev) ...@@ -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) if (match_one_device(&tmp_quirk->devid, dev) != NULL)
goto out; goto out;
tmp_quirk = NULL; tmp_quirk = NULL;
printk(KERN_DEBUG DRV_NAME dev_printk(KERN_DEBUG, &dev->dev,
": quirk didn't match any device known\n"); "quirk didn't match any device known\n");
out: out:
return tmp_quirk; return tmp_quirk;
} }
......
...@@ -6,6 +6,7 @@ ...@@ -6,6 +6,7 @@
*/ */
#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
#define dev_fmt pr_fmt
#include <linux/module.h> #include <linux/module.h>
#include <linux/init.h> #include <linux/init.h>
...@@ -626,11 +627,11 @@ static void pcistub_remove(struct pci_dev *dev) ...@@ -626,11 +627,11 @@ static void pcistub_remove(struct pci_dev *dev)
if (found_psdev->pdev) { if (found_psdev->pdev) {
int domid = xen_find_device_domain_owner(dev); int domid = xen_find_device_domain_owner(dev);
pr_warn("****** removing device %s while still in-use by domain %d! ******\n", dev_warn(&dev->dev, "****** removing device %s while still in-use by domain %d! ******\n",
pci_name(found_psdev->dev), domid); pci_name(found_psdev->dev), domid);
pr_warn("****** driver domain may still access this device's i/o resources!\n"); dev_warn(&dev->dev, "****** driver domain may still access this device's i/o resources!\n");
pr_warn("****** shutdown driver domain before binding device\n"); dev_warn(&dev->dev, "****** shutdown driver domain before binding device\n");
pr_warn("****** to other drivers or domains\n"); dev_warn(&dev->dev, "****** to other drivers or domains\n");
/* N.B. This ends up calling pcistub_put_pci_dev which ends up /* N.B. This ends up calling pcistub_put_pci_dev which ends up
* doing the FLR. */ * doing the FLR. */
...@@ -711,14 +712,12 @@ static pci_ers_result_t common_process(struct pcistub_device *psdev, ...@@ -711,14 +712,12 @@ static pci_ers_result_t common_process(struct pcistub_device *psdev,
ret = xen_pcibk_get_pcifront_dev(psdev->dev, psdev->pdev, ret = xen_pcibk_get_pcifront_dev(psdev->dev, psdev->pdev,
&aer_op->domain, &aer_op->bus, &aer_op->devfn); &aer_op->domain, &aer_op->bus, &aer_op->devfn);
if (!ret) { if (!ret) {
dev_err(&psdev->dev->dev, dev_err(&psdev->dev->dev, "failed to get pcifront device\n");
DRV_NAME ": failed to get pcifront device\n");
return PCI_ERS_RESULT_NONE; return PCI_ERS_RESULT_NONE;
} }
wmb(); wmb();
dev_dbg(&psdev->dev->dev, dev_dbg(&psdev->dev->dev, "aer_op %x dom %x bus %x devfn %x\n",
DRV_NAME ": aer_op %x dom %x bus %x devfn %x\n",
aer_cmd, aer_op->domain, aer_op->bus, aer_op->devfn); aer_cmd, aer_op->domain, aer_op->bus, aer_op->devfn);
/*local flag to mark there's aer request, xen_pcibk callback will use /*local flag to mark there's aer request, xen_pcibk callback will use
* this flag to judge whether we need to check pci-front give aer * this flag to judge whether we need to check pci-front give aer
...@@ -754,8 +753,7 @@ static pci_ers_result_t common_process(struct pcistub_device *psdev, ...@@ -754,8 +753,7 @@ static pci_ers_result_t common_process(struct pcistub_device *psdev,
if (test_bit(_XEN_PCIF_active, if (test_bit(_XEN_PCIF_active,
(unsigned long *)&sh_info->flags)) { (unsigned long *)&sh_info->flags)) {
dev_dbg(&psdev->dev->dev, dev_dbg(&psdev->dev->dev, "schedule pci_conf service\n");
"schedule pci_conf service in " DRV_NAME "\n");
xen_pcibk_test_and_schedule_op(psdev->pdev); xen_pcibk_test_and_schedule_op(psdev->pdev);
} }
...@@ -786,13 +784,12 @@ static pci_ers_result_t xen_pcibk_slot_reset(struct pci_dev *dev) ...@@ -786,13 +784,12 @@ static pci_ers_result_t xen_pcibk_slot_reset(struct pci_dev *dev)
PCI_FUNC(dev->devfn)); PCI_FUNC(dev->devfn));
if (!psdev || !psdev->pdev) { if (!psdev || !psdev->pdev) {
dev_err(&dev->dev, dev_err(&dev->dev, "device is not found/assigned\n");
DRV_NAME " device is not found/assigned\n");
goto end; goto end;
} }
if (!psdev->pdev->sh_info) { if (!psdev->pdev->sh_info) {
dev_err(&dev->dev, DRV_NAME " device is not connected or owned" dev_err(&dev->dev, "device is not connected or owned"
" by HVM, kill it\n"); " by HVM, kill it\n");
kill_domain_by_device(psdev); kill_domain_by_device(psdev);
goto end; goto end;
...@@ -844,13 +841,12 @@ static pci_ers_result_t xen_pcibk_mmio_enabled(struct pci_dev *dev) ...@@ -844,13 +841,12 @@ static pci_ers_result_t xen_pcibk_mmio_enabled(struct pci_dev *dev)
PCI_FUNC(dev->devfn)); PCI_FUNC(dev->devfn));
if (!psdev || !psdev->pdev) { if (!psdev || !psdev->pdev) {
dev_err(&dev->dev, dev_err(&dev->dev, "device is not found/assigned\n");
DRV_NAME " device is not found/assigned\n");
goto end; goto end;
} }
if (!psdev->pdev->sh_info) { if (!psdev->pdev->sh_info) {
dev_err(&dev->dev, DRV_NAME " device is not connected or owned" dev_err(&dev->dev, "device is not connected or owned"
" by HVM, kill it\n"); " by HVM, kill it\n");
kill_domain_by_device(psdev); kill_domain_by_device(psdev);
goto end; goto end;
...@@ -902,13 +898,12 @@ static pci_ers_result_t xen_pcibk_error_detected(struct pci_dev *dev, ...@@ -902,13 +898,12 @@ static pci_ers_result_t xen_pcibk_error_detected(struct pci_dev *dev,
PCI_FUNC(dev->devfn)); PCI_FUNC(dev->devfn));
if (!psdev || !psdev->pdev) { if (!psdev || !psdev->pdev) {
dev_err(&dev->dev, dev_err(&dev->dev, "device is not found/assigned\n");
DRV_NAME " device is not found/assigned\n");
goto end; goto end;
} }
if (!psdev->pdev->sh_info) { if (!psdev->pdev->sh_info) {
dev_err(&dev->dev, DRV_NAME " device is not connected or owned" dev_err(&dev->dev, "device is not connected or owned"
" by HVM, kill it\n"); " by HVM, kill it\n");
kill_domain_by_device(psdev); kill_domain_by_device(psdev);
goto end; goto end;
...@@ -956,13 +951,12 @@ static void xen_pcibk_error_resume(struct pci_dev *dev) ...@@ -956,13 +951,12 @@ static void xen_pcibk_error_resume(struct pci_dev *dev)
PCI_FUNC(dev->devfn)); PCI_FUNC(dev->devfn));
if (!psdev || !psdev->pdev) { if (!psdev || !psdev->pdev) {
dev_err(&dev->dev, dev_err(&dev->dev, "device is not found/assigned\n");
DRV_NAME " device is not found/assigned\n");
goto end; goto end;
} }
if (!psdev->pdev->sh_info) { if (!psdev->pdev->sh_info) {
dev_err(&dev->dev, DRV_NAME " device is not connected or owned" dev_err(&dev->dev, "device is not connected or owned"
" by HVM, kill it\n"); " by HVM, kill it\n");
kill_domain_by_device(psdev); kill_domain_by_device(psdev);
goto end; goto end;
......
...@@ -186,8 +186,6 @@ void xen_pcibk_do_op(struct work_struct *data); ...@@ -186,8 +186,6 @@ void xen_pcibk_do_op(struct work_struct *data);
int xen_pcibk_xenbus_register(void); int xen_pcibk_xenbus_register(void);
void xen_pcibk_xenbus_unregister(void); void xen_pcibk_xenbus_unregister(void);
extern int verbose_request;
void xen_pcibk_test_and_schedule_op(struct xen_pcibk_device *pdev); void xen_pcibk_test_and_schedule_op(struct xen_pcibk_device *pdev);
#endif #endif
......
...@@ -6,6 +6,7 @@ ...@@ -6,6 +6,7 @@
*/ */
#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
#define dev_fmt pr_fmt
#include <linux/moduleparam.h> #include <linux/moduleparam.h>
#include <linux/wait.h> #include <linux/wait.h>
...@@ -14,9 +15,6 @@ ...@@ -14,9 +15,6 @@
#include <linux/sched.h> #include <linux/sched.h>
#include "pciback.h" #include "pciback.h"
int verbose_request;
module_param(verbose_request, int, 0644);
static irqreturn_t xen_pcibk_guest_interrupt(int irq, void *dev_id); static irqreturn_t xen_pcibk_guest_interrupt(int irq, void *dev_id);
/* Ensure a device is has the fake IRQ handler "turned on/off" and is /* Ensure a device is has the fake IRQ handler "turned on/off" and is
...@@ -147,9 +145,6 @@ int xen_pcibk_enable_msi(struct xen_pcibk_device *pdev, ...@@ -147,9 +145,6 @@ int xen_pcibk_enable_msi(struct xen_pcibk_device *pdev,
struct xen_pcibk_dev_data *dev_data; struct xen_pcibk_dev_data *dev_data;
int status; int status;
if (unlikely(verbose_request))
printk(KERN_DEBUG DRV_NAME ": %s: enable MSI\n", pci_name(dev));
if (dev->msi_enabled) if (dev->msi_enabled)
status = -EALREADY; status = -EALREADY;
else if (dev->msix_enabled) else if (dev->msix_enabled)
...@@ -158,9 +153,8 @@ int xen_pcibk_enable_msi(struct xen_pcibk_device *pdev, ...@@ -158,9 +153,8 @@ int xen_pcibk_enable_msi(struct xen_pcibk_device *pdev,
status = pci_enable_msi(dev); status = pci_enable_msi(dev);
if (status) { if (status) {
pr_warn_ratelimited("%s: error enabling MSI for guest %u: err %d\n", dev_warn_ratelimited(&dev->dev, "error enabling MSI for guest %u: err %d\n",
pci_name(dev), pdev->xdev->otherend_id, pdev->xdev->otherend_id, status);
status);
op->value = 0; op->value = 0;
return XEN_PCI_ERR_op_failed; return XEN_PCI_ERR_op_failed;
} }
...@@ -169,9 +163,8 @@ int xen_pcibk_enable_msi(struct xen_pcibk_device *pdev, ...@@ -169,9 +163,8 @@ int xen_pcibk_enable_msi(struct xen_pcibk_device *pdev,
* the local domain's IRQ number. */ * the local domain's IRQ number. */
op->value = dev->irq ? xen_pirq_from_irq(dev->irq) : 0; op->value = dev->irq ? xen_pirq_from_irq(dev->irq) : 0;
if (unlikely(verbose_request))
printk(KERN_DEBUG DRV_NAME ": %s: MSI: %d\n", pci_name(dev), dev_dbg(&dev->dev, "MSI: %d\n", op->value);
op->value);
dev_data = pci_get_drvdata(dev); dev_data = pci_get_drvdata(dev);
if (dev_data) if (dev_data)
...@@ -184,10 +177,6 @@ static ...@@ -184,10 +177,6 @@ static
int xen_pcibk_disable_msi(struct xen_pcibk_device *pdev, int xen_pcibk_disable_msi(struct xen_pcibk_device *pdev,
struct pci_dev *dev, struct xen_pci_op *op) struct pci_dev *dev, struct xen_pci_op *op)
{ {
if (unlikely(verbose_request))
printk(KERN_DEBUG DRV_NAME ": %s: disable MSI\n",
pci_name(dev));
if (dev->msi_enabled) { if (dev->msi_enabled) {
struct xen_pcibk_dev_data *dev_data; struct xen_pcibk_dev_data *dev_data;
...@@ -198,9 +187,9 @@ int xen_pcibk_disable_msi(struct xen_pcibk_device *pdev, ...@@ -198,9 +187,9 @@ int xen_pcibk_disable_msi(struct xen_pcibk_device *pdev,
dev_data->ack_intr = 1; dev_data->ack_intr = 1;
} }
op->value = dev->irq ? xen_pirq_from_irq(dev->irq) : 0; op->value = dev->irq ? xen_pirq_from_irq(dev->irq) : 0;
if (unlikely(verbose_request))
printk(KERN_DEBUG DRV_NAME ": %s: MSI: %d\n", pci_name(dev), dev_dbg(&dev->dev, "MSI: %d\n", op->value);
op->value);
return 0; return 0;
} }
...@@ -213,9 +202,7 @@ int xen_pcibk_enable_msix(struct xen_pcibk_device *pdev, ...@@ -213,9 +202,7 @@ int xen_pcibk_enable_msix(struct xen_pcibk_device *pdev,
struct msix_entry *entries; struct msix_entry *entries;
u16 cmd; u16 cmd;
if (unlikely(verbose_request)) dev_dbg(&dev->dev, "enable MSI-X\n");
printk(KERN_DEBUG DRV_NAME ": %s: enable MSI-X\n",
pci_name(dev));
if (op->value > SH_INFO_MAX_VEC) if (op->value > SH_INFO_MAX_VEC)
return -EINVAL; return -EINVAL;
...@@ -248,17 +235,13 @@ int xen_pcibk_enable_msix(struct xen_pcibk_device *pdev, ...@@ -248,17 +235,13 @@ int xen_pcibk_enable_msix(struct xen_pcibk_device *pdev,
if (entries[i].vector) { if (entries[i].vector) {
op->msix_entries[i].vector = op->msix_entries[i].vector =
xen_pirq_from_irq(entries[i].vector); xen_pirq_from_irq(entries[i].vector);
if (unlikely(verbose_request)) dev_dbg(&dev->dev, "MSI-X[%d]: %d\n", i,
printk(KERN_DEBUG DRV_NAME ": %s: " \
"MSI-X[%d]: %d\n",
pci_name(dev), i,
op->msix_entries[i].vector); op->msix_entries[i].vector);
} }
} }
} else } else
pr_warn_ratelimited("%s: error enabling MSI-X for guest %u: err %d!\n", dev_warn_ratelimited(&dev->dev, "error enabling MSI-X for guest %u: err %d!\n",
pci_name(dev), pdev->xdev->otherend_id, pdev->xdev->otherend_id, result);
result);
kfree(entries); kfree(entries);
op->value = result; op->value = result;
...@@ -273,10 +256,6 @@ static ...@@ -273,10 +256,6 @@ static
int xen_pcibk_disable_msix(struct xen_pcibk_device *pdev, int xen_pcibk_disable_msix(struct xen_pcibk_device *pdev,
struct pci_dev *dev, struct xen_pci_op *op) struct pci_dev *dev, struct xen_pci_op *op)
{ {
if (unlikely(verbose_request))
printk(KERN_DEBUG DRV_NAME ": %s: disable MSI-X\n",
pci_name(dev));
if (dev->msix_enabled) { if (dev->msix_enabled) {
struct xen_pcibk_dev_data *dev_data; struct xen_pcibk_dev_data *dev_data;
...@@ -291,9 +270,9 @@ int xen_pcibk_disable_msix(struct xen_pcibk_device *pdev, ...@@ -291,9 +270,9 @@ int xen_pcibk_disable_msix(struct xen_pcibk_device *pdev,
* an undefined IRQ value of zero. * an undefined IRQ value of zero.
*/ */
op->value = dev->irq ? xen_pirq_from_irq(dev->irq) : 0; op->value = dev->irq ? xen_pirq_from_irq(dev->irq) : 0;
if (unlikely(verbose_request))
printk(KERN_DEBUG DRV_NAME ": %s: MSI-X: %d\n", dev_dbg(&dev->dev, "MSI-X: %d\n", op->value);
pci_name(dev), op->value);
return 0; return 0;
} }
#endif #endif
...@@ -424,7 +403,7 @@ static irqreturn_t xen_pcibk_guest_interrupt(int irq, void *dev_id) ...@@ -424,7 +403,7 @@ static irqreturn_t xen_pcibk_guest_interrupt(int irq, void *dev_id)
dev_data->handled++; dev_data->handled++;
if ((dev_data->handled % 1000) == 0) { if ((dev_data->handled % 1000) == 0) {
if (xen_test_irq_shared(irq)) { if (xen_test_irq_shared(irq)) {
pr_info("%s IRQ line is not shared " dev_info(&dev->dev, "%s IRQ line is not shared "
"with other domains. Turning ISR off\n", "with other domains. Turning ISR off\n",
dev_data->irq_name); dev_data->irq_name);
dev_data->ack_intr = 0; dev_data->ack_intr = 0;
......
...@@ -7,6 +7,7 @@ ...@@ -7,6 +7,7 @@
*/ */
#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
#define dev_fmt pr_fmt
#include <linux/list.h> #include <linux/list.h>
#include <linux/slab.h> #include <linux/slab.h>
...@@ -105,9 +106,8 @@ static int __xen_pcibk_add_pci_dev(struct xen_pcibk_device *pdev, ...@@ -105,9 +106,8 @@ static int __xen_pcibk_add_pci_dev(struct xen_pcibk_device *pdev,
struct pci_dev_entry, list); struct pci_dev_entry, list);
if (match_slot(dev, t->dev)) { if (match_slot(dev, t->dev)) {
pr_info("vpci: %s: assign to virtual slot %d func %d\n", dev_info(&dev->dev, "vpci: assign to virtual slot %d func %d\n",
pci_name(dev), slot, slot, PCI_FUNC(dev->devfn));
PCI_FUNC(dev->devfn));
list_add_tail(&dev_entry->list, list_add_tail(&dev_entry->list,
&vpci_dev->dev_list[slot]); &vpci_dev->dev_list[slot]);
func = PCI_FUNC(dev->devfn); func = PCI_FUNC(dev->devfn);
...@@ -119,8 +119,8 @@ static int __xen_pcibk_add_pci_dev(struct xen_pcibk_device *pdev, ...@@ -119,8 +119,8 @@ static int __xen_pcibk_add_pci_dev(struct xen_pcibk_device *pdev,
/* Assign to a new slot on the virtual PCI bus */ /* Assign to a new slot on the virtual PCI bus */
for (slot = 0; slot < PCI_SLOT_MAX; slot++) { for (slot = 0; slot < PCI_SLOT_MAX; slot++) {
if (list_empty(&vpci_dev->dev_list[slot])) { if (list_empty(&vpci_dev->dev_list[slot])) {
pr_info("vpci: %s: assign to virtual slot %d\n", dev_info(&dev->dev, "vpci: assign to virtual slot %d\n",
pci_name(dev), slot); slot);
list_add_tail(&dev_entry->list, list_add_tail(&dev_entry->list,
&vpci_dev->dev_list[slot]); &vpci_dev->dev_list[slot]);
func = dev->is_virtfn ? 0 : PCI_FUNC(dev->devfn); func = dev->is_virtfn ? 0 : PCI_FUNC(dev->devfn);
......
...@@ -31,6 +31,7 @@ ...@@ -31,6 +31,7 @@
*/ */
#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
#define dev_fmt pr_fmt
#define DPRINTK(fmt, args...) \ #define DPRINTK(fmt, args...) \
pr_debug("xenbus_probe (%s:%d) " fmt ".\n", \ pr_debug("xenbus_probe (%s:%d) " fmt ".\n", \
...@@ -607,7 +608,7 @@ int xenbus_dev_suspend(struct device *dev) ...@@ -607,7 +608,7 @@ int xenbus_dev_suspend(struct device *dev)
if (drv->suspend) if (drv->suspend)
err = drv->suspend(xdev); err = drv->suspend(xdev);
if (err) if (err)
pr_warn("suspend %s failed: %i\n", dev_name(dev), err); dev_warn(dev, "suspend failed: %i\n", err);
return 0; return 0;
} }
EXPORT_SYMBOL_GPL(xenbus_dev_suspend); EXPORT_SYMBOL_GPL(xenbus_dev_suspend);
...@@ -626,8 +627,7 @@ int xenbus_dev_resume(struct device *dev) ...@@ -626,8 +627,7 @@ int xenbus_dev_resume(struct device *dev)
drv = to_xenbus_driver(dev->driver); drv = to_xenbus_driver(dev->driver);
err = talk_to_otherend(xdev); err = talk_to_otherend(xdev);
if (err) { if (err) {
pr_warn("resume (talk_to_otherend) %s failed: %i\n", dev_warn(dev, "resume (talk_to_otherend) failed: %i\n", err);
dev_name(dev), err);
return err; return err;
} }
...@@ -636,15 +636,14 @@ int xenbus_dev_resume(struct device *dev) ...@@ -636,15 +636,14 @@ int xenbus_dev_resume(struct device *dev)
if (drv->resume) { if (drv->resume) {
err = drv->resume(xdev); err = drv->resume(xdev);
if (err) { if (err) {
pr_warn("resume %s failed: %i\n", dev_name(dev), err); dev_warn(dev, "resume failed: %i\n", err);
return err; return err;
} }
} }
err = watch_otherend(xdev); err = watch_otherend(xdev);
if (err) { if (err) {
pr_warn("resume (watch_otherend) %s failed: %d.\n", dev_warn(dev, "resume (watch_otherend) failed: %d\n", err);
dev_name(dev), err);
return err; return err;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment