WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

[Xen-devel] Re: [PATCH 1/3] xen: pvhvm: allow user to request no emulate

To: Ian Campbell <Ian.Campbell@xxxxxxxxxxxxx>
Subject: [Xen-devel] Re: [PATCH 1/3] xen: pvhvm: allow user to request no emulated device unplug
From: Stefano Stabellini <stefano.stabellini@xxxxxxxxxxxxx>
Date: Thu, 19 Aug 2010 11:37:51 +0100
Cc: Fitzhardinge <jeremy@xxxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxx>, Jeremy, Stefano Stabellini <Stefano.Stabellini@xxxxxxxxxxxxx>
Delivery-date: Thu, 19 Aug 2010 03:38:07 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <1282211946-8629-1-git-send-email-ian.campbell@xxxxxxxxxx>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
References: <1282211932.3170.2341.camel@xxxxxxxxxxxxxxxxxxxxxx> <1282211946-8629-1-git-send-email-ian.campbell@xxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Alpine 2.00 (DEB 1167 2008-08-23)
On Thu, 19 Aug 2010, Ian Campbell wrote:
> 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).
> 

I think this option might be a good thing to have, expecially to debug
qemu-xen emulated devices.

> Signed-off-by: Ian Campbell <ian.campbell@xxxxxxxxxx>
> ---
>  Documentation/kernel-parameters.txt |    1 +
>  arch/x86/xen/platform-pci-unplug.c  |   12 ++++++++++--
>  2 files changed, 11 insertions(+), 2 deletions(-)
> 
> diff --git a/Documentation/kernel-parameters.txt 
> b/Documentation/kernel-parameters.txt
> index 2c85c06..8bbe83b 100644
> --- a/Documentation/kernel-parameters.txt
> +++ b/Documentation/kernel-parameters.txt
> @@ -2631,6 +2631,7 @@ and is between 256 and 4096 characters. It is defined 
> in the file
>                       all -- unplug all emulated devices (NICs and IDE disks)
>                       ignore -- continue loading the Xen platform PCI driver 
> even
>                               if the version check failed
> +                     never -- do not unplug even if version check succeeds
>  
>       xirc2ps_cs=     [NET,PCMCIA]
>                       Format:
> diff --git a/arch/x86/xen/platform-pci-unplug.c 
> b/arch/x86/xen/platform-pci-unplug.c
> index 554c002..c82ce1e 100644
> --- a/arch/x86/xen/platform-pci-unplug.c
> +++ b/arch/x86/xen/platform-pci-unplug.c
> @@ -33,7 +33,7 @@
>  int xen_platform_pci_unplug;
>  EXPORT_SYMBOL_GPL(xen_platform_pci_unplug);
>  #ifdef CONFIG_XEN_PVHVM
> -static int xen_emul_unplug;
> +static int xen_emul_unplug = -1;
>  
>  static int __init check_platform_magic(void)
>  {
> @@ -72,18 +72,23 @@ void __init xen_unplug_emulated_devices(void)
>  {
>       int r;
>  
> +     /* user explicitly requested no unplug */
> +     if (xen_emul_unplug == 0)
> +             return;
>       /* check the version of the xen platform PCI device */
>       r = check_platform_magic();
>       /* If the version matches enable the Xen platform PCI driver.
>        * Also enable the Xen platform PCI driver if the version is really old
>        * and the user told us to ignore it. */
>       if (r && !(r == XEN_PLATFORM_ERR_MAGIC &&
> +                     (xen_emul_unplug != -1) &&
>                       (xen_emul_unplug & XEN_UNPLUG_IGNORE)))

I wouldn't add xen_emul_unplug != -1 because it should be clear that
xen_emul_unplug & XEN_UNPLUG_IGNORE always implies xen_emul_unplug != -1.

The other two patches look fine to me.


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel