Commit c05e1e23b8e5cf6c3a499e4aeb8503dcb3924394

Authored by 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

Showing 4 changed files Side-by-side Diff

Documentation/kernel-parameters.txt
... ... @@ -2629,8 +2629,10 @@
2629 2629 aux-ide-disks -- unplug non-primary-master IDE devices
2630 2630 nics -- unplug network devices
2631 2631 all -- unplug all emulated devices (NICs and IDE disks)
2632   - ignore -- continue loading the Xen platform PCI driver even
2633   - if the version check failed
  2632 + unnecessary -- unplugging emulated devices is
  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 2637 xirc2ps_cs= [NET,PCMCIA]
2636 2638 Format:
arch/x86/xen/platform-pci-unplug.c
... ... @@ -72,13 +72,17 @@
72 72 {
73 73 int r;
74 74  
  75 + /* user explicitly requested no unplug */
  76 + if (xen_emul_unplug & XEN_UNPLUG_NEVER)
  77 + return;
75 78 /* check the version of the xen platform PCI device */
76 79 r = check_platform_magic();
77 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
79   - * and the user told us to ignore it. */
  81 + * Also enable the Xen platform PCI driver if the host does
  82 + * not support the unplug protocol (XEN_PLATFORM_ERR_MAGIC)
  83 + * but the user told us that unplugging is unnecessary. */
80 84 if (r && !(r == XEN_PLATFORM_ERR_MAGIC &&
81   - (xen_emul_unplug & XEN_UNPLUG_IGNORE)))
  85 + (xen_emul_unplug & XEN_UNPLUG_UNNECESSARY)))
82 86 return;
83 87 /* Set the default value of xen_emul_unplug depending on whether or
84 88 * not the Xen PV frontends and the Xen platform PCI driver have
... ... @@ -99,7 +103,7 @@
99 103 }
100 104 }
101 105 /* Now unplug the emulated devices */
102   - if (!(xen_emul_unplug & XEN_UNPLUG_IGNORE))
  106 + if (!(xen_emul_unplug & XEN_UNPLUG_UNNECESSARY))
103 107 outw(xen_emul_unplug, XEN_IOPORT_UNPLUG);
104 108 xen_platform_pci_unplug = xen_emul_unplug;
105 109 }
... ... @@ -125,8 +129,10 @@
125 129 xen_emul_unplug |= XEN_UNPLUG_AUX_IDE_DISKS;
126 130 else if (!strncmp(p, "nics", l))
127 131 xen_emul_unplug |= XEN_UNPLUG_ALL_NICS;
128   - else if (!strncmp(p, "ignore", l))
129   - xen_emul_unplug |= XEN_UNPLUG_IGNORE;
  132 + else if (!strncmp(p, "unnecessary", l))
  133 + xen_emul_unplug |= XEN_UNPLUG_UNNECESSARY;
  134 + else if (!strncmp(p, "never", l))
  135 + xen_emul_unplug |= XEN_UNPLUG_NEVER;
130 136 else
131 137 printk(KERN_WARNING "unrecognised option '%s' "
132 138 "in parameter 'xen_emul_unplug'\n", p);
drivers/block/xen-blkfront.c
... ... @@ -834,7 +834,7 @@
834 834 char *type;
835 835 int len;
836 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 838 int major;
839 839  
840 840 if (!VDEV_IS_EXTENDED(vdevice))
include/xen/platform_pci.h
... ... @@ -16,11 +16,15 @@
16 16 #define XEN_IOPORT_PROTOVER (XEN_IOPORT_BASE + 2) /* 1 byte access (R) */
17 17 #define XEN_IOPORT_PRODNUM (XEN_IOPORT_BASE + 2) /* 2 byte access (W) */
18 18  
19   -#define XEN_UNPLUG_ALL_IDE_DISKS 1
20   -#define XEN_UNPLUG_ALL_NICS 2
21   -#define XEN_UNPLUG_AUX_IDE_DISKS 4
22   -#define XEN_UNPLUG_ALL 7
23   -#define XEN_UNPLUG_IGNORE 8
  19 +#define XEN_UNPLUG_ALL_IDE_DISKS (1<<0)
  20 +#define XEN_UNPLUG_ALL_NICS (1<<1)
  21 +#define XEN_UNPLUG_AUX_IDE_DISKS (1<<2)
  22 +#define XEN_UNPLUG_ALL (XEN_UNPLUG_ALL_IDE_DISKS|\
  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  
25 29 static inline int xen_must_unplug_nics(void) {
26 30 #if (defined(CONFIG_XEN_NETDEV_FRONTEND) || \