Commit c93a4dfb31f2c023da3ad1238c352452f2cc0e05

Authored by Ian Campbell
1 parent da5cabf80e

xen: pvhvm: allow user to request no emulated device unplug

this allows the user to disable pvhvm and revert to emulated devices
in case of a system misconfiguration (e.g. initramfs with only
emulated drivers in it).

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
Acked-by: Stefano Stabellini <Stefano.Stabellini@eu.citrix.com>

Showing 3 changed files with 7 additions and 0 deletions Side-by-side Diff

Documentation/kernel-parameters.txt
... ... @@ -2631,6 +2631,7 @@
2631 2631 all -- unplug all emulated devices (NICs and IDE disks)
2632 2632 ignore -- continue loading the Xen platform PCI driver even
2633 2633 if the version check failed
  2634 + never -- do not unplug even if version check succeeds
2634 2635  
2635 2636 xirc2ps_cs= [NET,PCMCIA]
2636 2637 Format:
arch/x86/xen/platform-pci-unplug.c
... ... @@ -72,6 +72,9 @@
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.
... ... @@ -127,6 +130,8 @@
127 130 xen_emul_unplug |= XEN_UNPLUG_ALL_NICS;
128 131 else if (!strncmp(p, "ignore", l))
129 132 xen_emul_unplug |= XEN_UNPLUG_IGNORE;
  133 + else if (!strncmp(p, "never", l))
  134 + xen_emul_unplug |= XEN_UNPLUG_NEVER;
130 135 else
131 136 printk(KERN_WARNING "unrecognised option '%s' "
132 137 "in parameter 'xen_emul_unplug'\n", p);
include/xen/platform_pci.h
... ... @@ -21,6 +21,7 @@
21 21 #define XEN_UNPLUG_AUX_IDE_DISKS 4
22 22 #define XEN_UNPLUG_ALL 7
23 23 #define XEN_UNPLUG_IGNORE 8
  24 +#define XEN_UNPLUG_NEVER 16
24 25  
25 26 static inline int xen_must_unplug_nics(void) {
26 27 #if (defined(CONFIG_XEN_NETDEV_FRONTEND) || \