aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2010-08-23 21:29:18 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2010-08-23 21:29:18 -0400
commitc05e1e23b8e5cf6c3a499e4aeb8503dcb3924394 (patch)
treed159b9722131e32288cd66030ee002e1ed808602
parentc70662ec47191eb235bb1d0a1466b923b7a08a94 (diff)
parent9c35e90c6fcf7f5baf27a63d9565e9f47633f299 (diff)
Merge branch 'for-upstream/pvhvm' of git://xenbits.xensource.com/people/ianc/linux-2.6
* 'for-upstream/pvhvm' of git://xenbits.xensource.com/people/ianc/linux-2.6: xen: pvhvm: make it clearer that XEN_UNPLUG_* define bits in a bitfield xen: pvhvm: rename xen_emul_unplug=ignore to =unnnecessary xen: pvhvm: allow user to request no emulated device unplug
-rw-r--r--Documentation/kernel-parameters.txt6
-rw-r--r--arch/x86/xen/platform-pci-unplug.c18
-rw-r--r--drivers/block/xen-blkfront.c2
-rw-r--r--include/xen/platform_pci.h14
4 files changed, 26 insertions, 14 deletions
diff --git a/Documentation/kernel-parameters.txt b/Documentation/kernel-parameters.txt
index 2c85c0692b01..f084af0cb8e0 100644
--- a/Documentation/kernel-parameters.txt
+++ b/Documentation/kernel-parameters.txt
@@ -2629,8 +2629,10 @@ and is between 256 and 4096 characters. It is defined in the file
2629 aux-ide-disks -- unplug non-primary-master IDE devices 2629 aux-ide-disks -- unplug non-primary-master IDE devices
2630 nics -- unplug network devices 2630 nics -- unplug network devices
2631 all -- unplug all emulated devices (NICs and IDE disks) 2631 all -- unplug all emulated devices (NICs and IDE disks)
2632 ignore -- continue loading the Xen platform PCI driver even 2632 unnecessary -- unplugging emulated devices is
2633 if the version check failed 2633 unnecessary even if the host did not respond to
2634 the unplug protocol
2635 never -- do not unplug even if version check succeeds
2634 2636
2635 xirc2ps_cs= [NET,PCMCIA] 2637 xirc2ps_cs= [NET,PCMCIA]
2636 Format: 2638 Format:
diff --git a/arch/x86/xen/platform-pci-unplug.c b/arch/x86/xen/platform-pci-unplug.c
index 554c002a1e1a..0f456386cce5 100644
--- a/arch/x86/xen/platform-pci-unplug.c
+++ b/arch/x86/xen/platform-pci-unplug.c
@@ -72,13 +72,17 @@ void __init xen_unplug_emulated_devices(void)
72{ 72{
73 int r; 73 int r;
74 74
75 /* user explicitly requested no unplug */
76 if (xen_emul_unplug & XEN_UNPLUG_NEVER)
77 return;
75 /* check the version of the xen platform PCI device */ 78 /* check the version of the xen platform PCI device */
76 r = check_platform_magic(); 79 r = check_platform_magic();
77 /* If the version matches enable the Xen platform PCI driver. 80 /* If the version matches enable the Xen platform PCI driver.
78 * Also enable the Xen platform PCI driver if the version is really old 81 * Also enable the Xen platform PCI driver if the host does
79 * and the user told us to ignore it. */ 82 * not support the unplug protocol (XEN_PLATFORM_ERR_MAGIC)
83 * but the user told us that unplugging is unnecessary. */
80 if (r && !(r == XEN_PLATFORM_ERR_MAGIC && 84 if (r && !(r == XEN_PLATFORM_ERR_MAGIC &&
81 (xen_emul_unplug & XEN_UNPLUG_IGNORE))) 85 (xen_emul_unplug & XEN_UNPLUG_UNNECESSARY)))
82 return; 86 return;
83 /* Set the default value of xen_emul_unplug depending on whether or 87 /* Set the default value of xen_emul_unplug depending on whether or
84 * not the Xen PV frontends and the Xen platform PCI driver have 88 * not the Xen PV frontends and the Xen platform PCI driver have
@@ -99,7 +103,7 @@ void __init xen_unplug_emulated_devices(void)
99 } 103 }
100 } 104 }
101 /* Now unplug the emulated devices */ 105 /* Now unplug the emulated devices */
102 if (!(xen_emul_unplug & XEN_UNPLUG_IGNORE)) 106 if (!(xen_emul_unplug & XEN_UNPLUG_UNNECESSARY))
103 outw(xen_emul_unplug, XEN_IOPORT_UNPLUG); 107 outw(xen_emul_unplug, XEN_IOPORT_UNPLUG);
104 xen_platform_pci_unplug = xen_emul_unplug; 108 xen_platform_pci_unplug = xen_emul_unplug;
105} 109}
@@ -125,8 +129,10 @@ static int __init parse_xen_emul_unplug(char *arg)
125 xen_emul_unplug |= XEN_UNPLUG_AUX_IDE_DISKS; 129 xen_emul_unplug |= XEN_UNPLUG_AUX_IDE_DISKS;
126 else if (!strncmp(p, "nics", l)) 130 else if (!strncmp(p, "nics", l))
127 xen_emul_unplug |= XEN_UNPLUG_ALL_NICS; 131 xen_emul_unplug |= XEN_UNPLUG_ALL_NICS;
128 else if (!strncmp(p, "ignore", l)) 132 else if (!strncmp(p, "unnecessary", l))
129 xen_emul_unplug |= XEN_UNPLUG_IGNORE; 133 xen_emul_unplug |= XEN_UNPLUG_UNNECESSARY;
134 else if (!strncmp(p, "never", l))
135 xen_emul_unplug |= XEN_UNPLUG_NEVER;
130 else 136 else
131 printk(KERN_WARNING "unrecognised option '%s' " 137 printk(KERN_WARNING "unrecognised option '%s' "
132 "in parameter 'xen_emul_unplug'\n", p); 138 "in parameter 'xen_emul_unplug'\n", p);
diff --git a/drivers/block/xen-blkfront.c b/drivers/block/xen-blkfront.c
index ac1b682edecb..ab735a605cf3 100644
--- a/drivers/block/xen-blkfront.c
+++ b/drivers/block/xen-blkfront.c
@@ -834,7 +834,7 @@ static int blkfront_probe(struct xenbus_device *dev,
834 char *type; 834 char *type;
835 int len; 835 int len;
836 /* no unplug has been done: do not hook devices != xen vbds */ 836 /* no unplug has been done: do not hook devices != xen vbds */
837 if (xen_platform_pci_unplug & XEN_UNPLUG_IGNORE) { 837 if (xen_platform_pci_unplug & XEN_UNPLUG_UNNECESSARY) {
838 int major; 838 int major;
839 839
840 if (!VDEV_IS_EXTENDED(vdevice)) 840 if (!VDEV_IS_EXTENDED(vdevice))
diff --git a/include/xen/platform_pci.h b/include/xen/platform_pci.h
index ce9d671c636c..a785a3b0c8c7 100644
--- a/include/xen/platform_pci.h
+++ b/include/xen/platform_pci.h
@@ -16,11 +16,15 @@
16#define XEN_IOPORT_PROTOVER (XEN_IOPORT_BASE + 2) /* 1 byte access (R) */ 16#define XEN_IOPORT_PROTOVER (XEN_IOPORT_BASE + 2) /* 1 byte access (R) */
17#define XEN_IOPORT_PRODNUM (XEN_IOPORT_BASE + 2) /* 2 byte access (W) */ 17#define XEN_IOPORT_PRODNUM (XEN_IOPORT_BASE + 2) /* 2 byte access (W) */
18 18
19#define XEN_UNPLUG_ALL_IDE_DISKS 1 19#define XEN_UNPLUG_ALL_IDE_DISKS (1<<0)
20#define XEN_UNPLUG_ALL_NICS 2 20#define XEN_UNPLUG_ALL_NICS (1<<1)
21#define XEN_UNPLUG_AUX_IDE_DISKS 4 21#define XEN_UNPLUG_AUX_IDE_DISKS (1<<2)
22#define XEN_UNPLUG_ALL 7 22#define XEN_UNPLUG_ALL (XEN_UNPLUG_ALL_IDE_DISKS|\
23#define XEN_UNPLUG_IGNORE 8 23 XEN_UNPLUG_ALL_NICS|\
24 XEN_UNPLUG_AUX_IDE_DISKS)
25
26#define XEN_UNPLUG_UNNECESSARY (1<<16)
27#define XEN_UNPLUG_NEVER (1<<17)
24 28
25static inline int xen_must_unplug_nics(void) { 29static inline int xen_must_unplug_nics(void) {
26#if (defined(CONFIG_XEN_NETDEV_FRONTEND) || \ 30#if (defined(CONFIG_XEN_NETDEV_FRONTEND) || \