Commit c05e1e23 authored by Linus Torvalds's avatar Linus Torvalds

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
parents c70662ec 9c35e90c
...@@ -2629,8 +2629,10 @@ and is between 256 and 4096 characters. It is defined in the file ...@@ -2629,8 +2629,10 @@ and is between 256 and 4096 characters. It is defined in the file
aux-ide-disks -- unplug non-primary-master IDE devices aux-ide-disks -- unplug non-primary-master IDE devices
nics -- unplug network devices nics -- unplug network devices
all -- unplug all emulated devices (NICs and IDE disks) all -- unplug all emulated devices (NICs and IDE disks)
ignore -- continue loading the Xen platform PCI driver even unnecessary -- unplugging emulated devices is
if the version check failed unnecessary even if the host did not respond to
the unplug protocol
never -- do not unplug even if version check succeeds
xirc2ps_cs= [NET,PCMCIA] xirc2ps_cs= [NET,PCMCIA]
Format: Format:
......
...@@ -72,13 +72,17 @@ void __init xen_unplug_emulated_devices(void) ...@@ -72,13 +72,17 @@ void __init xen_unplug_emulated_devices(void)
{ {
int r; int r;
/* user explicitly requested no unplug */
if (xen_emul_unplug & XEN_UNPLUG_NEVER)
return;
/* check the version of the xen platform PCI device */ /* check the version of the xen platform PCI device */
r = check_platform_magic(); r = check_platform_magic();
/* If the version matches enable the Xen platform PCI driver. /* If the version matches enable the Xen platform PCI driver.
* Also enable the Xen platform PCI driver if the version is really old * Also enable the Xen platform PCI driver if the host does
* and the user told us to ignore it. */ * not support the unplug protocol (XEN_PLATFORM_ERR_MAGIC)
* but the user told us that unplugging is unnecessary. */
if (r && !(r == XEN_PLATFORM_ERR_MAGIC && if (r && !(r == XEN_PLATFORM_ERR_MAGIC &&
(xen_emul_unplug & XEN_UNPLUG_IGNORE))) (xen_emul_unplug & XEN_UNPLUG_UNNECESSARY)))
return; return;
/* Set the default value of xen_emul_unplug depending on whether or /* Set the default value of xen_emul_unplug depending on whether or
* not the Xen PV frontends and the Xen platform PCI driver have * not the Xen PV frontends and the Xen platform PCI driver have
...@@ -99,7 +103,7 @@ void __init xen_unplug_emulated_devices(void) ...@@ -99,7 +103,7 @@ void __init xen_unplug_emulated_devices(void)
} }
} }
/* Now unplug the emulated devices */ /* Now unplug the emulated devices */
if (!(xen_emul_unplug & XEN_UNPLUG_IGNORE)) if (!(xen_emul_unplug & XEN_UNPLUG_UNNECESSARY))
outw(xen_emul_unplug, XEN_IOPORT_UNPLUG); outw(xen_emul_unplug, XEN_IOPORT_UNPLUG);
xen_platform_pci_unplug = xen_emul_unplug; xen_platform_pci_unplug = xen_emul_unplug;
} }
...@@ -125,8 +129,10 @@ static int __init parse_xen_emul_unplug(char *arg) ...@@ -125,8 +129,10 @@ static int __init parse_xen_emul_unplug(char *arg)
xen_emul_unplug |= XEN_UNPLUG_AUX_IDE_DISKS; xen_emul_unplug |= XEN_UNPLUG_AUX_IDE_DISKS;
else if (!strncmp(p, "nics", l)) else if (!strncmp(p, "nics", l))
xen_emul_unplug |= XEN_UNPLUG_ALL_NICS; xen_emul_unplug |= XEN_UNPLUG_ALL_NICS;
else if (!strncmp(p, "ignore", l)) else if (!strncmp(p, "unnecessary", l))
xen_emul_unplug |= XEN_UNPLUG_IGNORE; xen_emul_unplug |= XEN_UNPLUG_UNNECESSARY;
else if (!strncmp(p, "never", l))
xen_emul_unplug |= XEN_UNPLUG_NEVER;
else else
printk(KERN_WARNING "unrecognised option '%s' " printk(KERN_WARNING "unrecognised option '%s' "
"in parameter 'xen_emul_unplug'\n", p); "in parameter 'xen_emul_unplug'\n", p);
......
...@@ -834,7 +834,7 @@ static int blkfront_probe(struct xenbus_device *dev, ...@@ -834,7 +834,7 @@ static int blkfront_probe(struct xenbus_device *dev,
char *type; char *type;
int len; int len;
/* no unplug has been done: do not hook devices != xen vbds */ /* no unplug has been done: do not hook devices != xen vbds */
if (xen_platform_pci_unplug & XEN_UNPLUG_IGNORE) { if (xen_platform_pci_unplug & XEN_UNPLUG_UNNECESSARY) {
int major; int major;
if (!VDEV_IS_EXTENDED(vdevice)) if (!VDEV_IS_EXTENDED(vdevice))
......
...@@ -16,11 +16,15 @@ ...@@ -16,11 +16,15 @@
#define XEN_IOPORT_PROTOVER (XEN_IOPORT_BASE + 2) /* 1 byte access (R) */ #define XEN_IOPORT_PROTOVER (XEN_IOPORT_BASE + 2) /* 1 byte access (R) */
#define XEN_IOPORT_PRODNUM (XEN_IOPORT_BASE + 2) /* 2 byte access (W) */ #define XEN_IOPORT_PRODNUM (XEN_IOPORT_BASE + 2) /* 2 byte access (W) */
#define XEN_UNPLUG_ALL_IDE_DISKS 1 #define XEN_UNPLUG_ALL_IDE_DISKS (1<<0)
#define XEN_UNPLUG_ALL_NICS 2 #define XEN_UNPLUG_ALL_NICS (1<<1)
#define XEN_UNPLUG_AUX_IDE_DISKS 4 #define XEN_UNPLUG_AUX_IDE_DISKS (1<<2)
#define XEN_UNPLUG_ALL 7 #define XEN_UNPLUG_ALL (XEN_UNPLUG_ALL_IDE_DISKS|\
#define XEN_UNPLUG_IGNORE 8 XEN_UNPLUG_ALL_NICS|\
XEN_UNPLUG_AUX_IDE_DISKS)
#define XEN_UNPLUG_UNNECESSARY (1<<16)
#define XEN_UNPLUG_NEVER (1<<17)
static inline int xen_must_unplug_nics(void) { static inline int xen_must_unplug_nics(void) {
#if (defined(CONFIG_XEN_NETDEV_FRONTEND) || \ #if (defined(CONFIG_XEN_NETDEV_FRONTEND) || \
......
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