Skip to content

Commit d2d5439

Browse files
committed
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()
2 parents b791d1b + a952f64 commit d2d5439

File tree

14 files changed

+90
-142
lines changed

14 files changed

+90
-142
lines changed

MAINTAINERS

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12911,7 +12911,7 @@ F: include/uapi/linux/ppdev.h
1291112911

1291212912
PARAVIRT_OPS INTERFACE
1291312913
M: Juergen Gross <[email protected]>
12914-
M: Thomas Hellstrom <thellstrom@vmware.com>
12914+
M: Deep Shah <sdeep@vmware.com>
1291512915
M: "VMware, Inc." <[email protected]>
1291612916
1291712917
S: Supported
@@ -18287,7 +18287,7 @@ S: Maintained
1828718287
F: drivers/misc/vmw_balloon.c
1828818288

1828918289
VMWARE HYPERVISOR INTERFACE
18290-
M: Thomas Hellstrom <thellstrom@vmware.com>
18290+
M: Deep Shah <sdeep@vmware.com>
1829118291
M: "VMware, Inc." <[email protected]>
1829218292
1829318293
S: Supported

drivers/pci/xen-pcifront.c

Lines changed: 10 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -77,9 +77,6 @@ static inline void pcifront_init_sd(struct pcifront_sd *sd,
7777
static DEFINE_SPINLOCK(pcifront_dev_lock);
7878
static struct pcifront_device *pcifront_dev;
7979

80-
static int verbose_request;
81-
module_param(verbose_request, int, 0644);
82-
8380
static int errno_to_pcibios_err(int errno)
8481
{
8582
switch (errno) {
@@ -190,18 +187,16 @@ static int pcifront_bus_read(struct pci_bus *bus, unsigned int devfn,
190187
struct pcifront_sd *sd = bus->sysdata;
191188
struct pcifront_device *pdev = pcifront_get_pdev(sd);
192189

193-
if (verbose_request)
194-
dev_info(&pdev->xdev->dev,
195-
"read dev=%04x:%02x:%02x.%d - offset %x size %d\n",
196-
pci_domain_nr(bus), bus->number, PCI_SLOT(devfn),
197-
PCI_FUNC(devfn), where, size);
190+
dev_dbg(&pdev->xdev->dev,
191+
"read dev=%04x:%02x:%02x.%d - offset %x size %d\n",
192+
pci_domain_nr(bus), bus->number, PCI_SLOT(devfn),
193+
PCI_FUNC(devfn), where, size);
198194

199195
err = do_pci_op(pdev, &op);
200196

201197
if (likely(!err)) {
202-
if (verbose_request)
203-
dev_info(&pdev->xdev->dev, "read got back value %x\n",
204-
op.value);
198+
dev_dbg(&pdev->xdev->dev, "read got back value %x\n",
199+
op.value);
205200

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

232-
if (verbose_request)
233-
dev_info(&pdev->xdev->dev,
234-
"write dev=%04x:%02x:%02x.%d - "
235-
"offset %x size %d val %x\n",
236-
pci_domain_nr(bus), bus->number,
237-
PCI_SLOT(devfn), PCI_FUNC(devfn), where, size, val);
227+
dev_dbg(&pdev->xdev->dev,
228+
"write dev=%04x:%02x:%02x.%d - offset %x size %d val %x\n",
229+
pci_domain_nr(bus), bus->number,
230+
PCI_SLOT(devfn), PCI_FUNC(devfn), where, size, val);
238231

239232
return errno_to_pcibios_err(do_pci_op(pdev, &op));
240233
}

drivers/xen/Kconfig

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,16 @@ config XEN_BALLOON
1313
config XEN_BALLOON_MEMORY_HOTPLUG
1414
bool "Memory hotplug support for Xen balloon driver"
1515
depends on XEN_BALLOON && MEMORY_HOTPLUG
16+
default y
1617
help
1718
Memory hotplug support for Xen balloon driver allows expanding memory
1819
available for the system above limit declared at system startup.
1920
It is very useful on critical systems which require long
2021
run without rebooting.
2122

23+
It's also very useful for non PV domains to obtain unpopulated physical
24+
memory ranges to use in order to map foreign memory or grants.
25+
2226
Memory could be hotplugged in following steps:
2327

2428
1) target domain: ensure that memory auto online policy is in

drivers/xen/cpu_hotplug.c

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -93,10 +93,8 @@ static int setup_cpu_watcher(struct notifier_block *notifier,
9393
(void)register_xenbus_watch(&cpu_watch);
9494

9595
for_each_possible_cpu(cpu) {
96-
if (vcpu_online(cpu) == 0) {
97-
device_offline(get_cpu_device(cpu));
98-
set_cpu_present(cpu, false);
99-
}
96+
if (vcpu_online(cpu) == 0)
97+
disable_hotplug_cpu(cpu);
10098
}
10199

102100
return NOTIFY_DONE;
@@ -119,5 +117,5 @@ static int __init setup_vcpu_hotplug_event(void)
119117
return 0;
120118
}
121119

122-
arch_initcall(setup_vcpu_hotplug_event);
120+
late_initcall(setup_vcpu_hotplug_event);
123121

drivers/xen/platform-pci.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ static const struct pci_device_id platform_pci_tbl[] = {
168168
{0,}
169169
};
170170

171-
static struct dev_pm_ops platform_pm_ops = {
171+
static const struct dev_pm_ops platform_pm_ops = {
172172
.resume_noirq = platform_pci_resume,
173173
};
174174

drivers/xen/pvcalls-back.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
#define PVCALLS_VERSIONS "1"
2525
#define MAX_RING_ORDER XENBUS_MAX_RING_GRANT_ORDER
2626

27-
struct pvcalls_back_global {
27+
static struct pvcalls_back_global {
2828
struct list_head frontends;
2929
struct semaphore frontends_lock;
3030
} pvcalls_back_global;
@@ -1088,7 +1088,8 @@ static void set_backend_state(struct xenbus_device *dev,
10881088
case XenbusStateInitialised:
10891089
switch (state) {
10901090
case XenbusStateConnected:
1091-
backend_connect(dev);
1091+
if (backend_connect(dev))
1092+
return;
10921093
xenbus_switch_state(dev, XenbusStateConnected);
10931094
break;
10941095
case XenbusStateClosing:

drivers/xen/xen-pciback/conf_space.c

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010
* Author: Ryan Wilson <[email protected]>
1111
*/
1212

13+
#define dev_fmt(fmt) DRV_NAME ": " fmt
14+
1315
#include <linux/kernel.h>
1416
#include <linux/moduleparam.h>
1517
#include <linux/pci.h>
@@ -154,9 +156,7 @@ int xen_pcibk_config_read(struct pci_dev *dev, int offset, int size,
154156
* (as if device didn't respond) */
155157
u32 value = 0, tmp_val;
156158

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

161161
if (!valid_request(offset, size)) {
162162
err = XEN_PCI_ERR_invalid_offset;
@@ -195,9 +195,7 @@ int xen_pcibk_config_read(struct pci_dev *dev, int offset, int size,
195195
}
196196

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

202200
*ret_val = value;
203201
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)
212210
u32 tmp_val;
213211
int field_start, field_end;
214212

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

220216
if (!valid_request(offset, size))
221217
return XEN_PCI_ERR_invalid_offset;

drivers/xen/xen-pciback/conf_space_header.c

Lines changed: 14 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
*/
77

88
#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
9+
#define dev_fmt pr_fmt
910

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

6869
dev_data = pci_get_drvdata(dev);
6970
if (!pci_is_enabled(dev) && is_enable_cmd(value)) {
70-
if (unlikely(verbose_request))
71-
printk(KERN_DEBUG DRV_NAME ": %s: enable\n",
72-
pci_name(dev));
71+
dev_dbg(&dev->dev, "enable\n");
7372
err = pci_enable_device(dev);
7473
if (err)
7574
return err;
7675
if (dev_data)
7776
dev_data->enable_intx = 1;
7877
} else if (pci_is_enabled(dev) && !is_enable_cmd(value)) {
79-
if (unlikely(verbose_request))
80-
printk(KERN_DEBUG DRV_NAME ": %s: disable\n",
81-
pci_name(dev));
78+
dev_dbg(&dev->dev, "disable\n");
8279
pci_disable_device(dev);
8380
if (dev_data)
8481
dev_data->enable_intx = 0;
8582
}
8683

8784
if (!dev->is_busmaster && is_master_cmd(value)) {
88-
if (unlikely(verbose_request))
89-
printk(KERN_DEBUG DRV_NAME ": %s: set bus master\n",
90-
pci_name(dev));
85+
dev_dbg(&dev->dev, "set bus master\n");
9186
pci_set_master(dev);
9287
} else if (dev->is_busmaster && !is_master_cmd(value)) {
93-
if (unlikely(verbose_request))
94-
printk(KERN_DEBUG DRV_NAME ": %s: clear bus master\n",
95-
pci_name(dev));
88+
dev_dbg(&dev->dev, "clear bus master\n");
9689
pci_clear_master(dev);
9790
}
9891

9992
if (!(cmd->val & PCI_COMMAND_INVALIDATE) &&
10093
(value & PCI_COMMAND_INVALIDATE)) {
101-
if (unlikely(verbose_request))
102-
printk(KERN_DEBUG
103-
DRV_NAME ": %s: enable memory-write-invalidate\n",
104-
pci_name(dev));
94+
dev_dbg(&dev->dev, "enable memory-write-invalidate\n");
10595
err = pci_set_mwi(dev);
10696
if (err) {
107-
pr_warn("%s: cannot enable memory-write-invalidate (%d)\n",
108-
pci_name(dev), err);
97+
dev_warn(&dev->dev, "cannot enable memory-write-invalidate (%d)\n",
98+
err);
10999
value &= ~PCI_COMMAND_INVALIDATE;
110100
}
111101
} else if ((cmd->val & PCI_COMMAND_INVALIDATE) &&
112102
!(value & PCI_COMMAND_INVALIDATE)) {
113-
if (unlikely(verbose_request))
114-
printk(KERN_DEBUG
115-
DRV_NAME ": %s: disable memory-write-invalidate\n",
116-
pci_name(dev));
103+
dev_dbg(&dev->dev, "disable memory-write-invalidate\n");
117104
pci_clear_mwi(dev);
118105
}
119106

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

159146
if (unlikely(!bar)) {
160-
pr_warn(DRV_NAME ": driver data not found for %s\n",
161-
pci_name(dev));
147+
dev_warn(&dev->dev, "driver data not found\n");
162148
return XEN_PCI_ERR_op_failed;
163149
}
164150

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

196182
if (unlikely(!bar)) {
197-
pr_warn(DRV_NAME ": driver data not found for %s\n",
198-
pci_name(dev));
183+
dev_warn(&dev->dev, "driver data not found\n");
199184
return XEN_PCI_ERR_op_failed;
200185
}
201186

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

230215
if (unlikely(!bar)) {
231-
pr_warn(DRV_NAME ": driver data not found for %s\n",
232-
pci_name(dev));
216+
dev_warn(&dev->dev, "driver data not found\n");
233217
return XEN_PCI_ERR_op_failed;
234218
}
235219

@@ -433,8 +417,8 @@ int xen_pcibk_config_header_add_fields(struct pci_dev *dev)
433417

434418
default:
435419
err = -EINVAL;
436-
pr_err("%s: Unsupported header type %d!\n",
437-
pci_name(dev), dev->hdr_type);
420+
dev_err(&dev->dev, "Unsupported header type %d!\n",
421+
dev->hdr_type);
438422
break;
439423
}
440424

drivers/xen/xen-pciback/conf_space_quirks.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
* Author: Chris Bookholt <[email protected]>
77
*/
88

9+
#define dev_fmt(fmt) DRV_NAME ": " fmt
10+
911
#include <linux/kernel.h>
1012
#include <linux/pci.h>
1113
#include "pciback.h"
@@ -35,8 +37,8 @@ static struct xen_pcibk_config_quirk *xen_pcibk_find_quirk(struct pci_dev *dev)
3537
if (match_one_device(&tmp_quirk->devid, dev) != NULL)
3638
goto out;
3739
tmp_quirk = NULL;
38-
printk(KERN_DEBUG DRV_NAME
39-
": quirk didn't match any device known\n");
40+
dev_printk(KERN_DEBUG, &dev->dev,
41+
"quirk didn't match any device known\n");
4042
out:
4143
return tmp_quirk;
4244
}

0 commit comments

Comments
 (0)