All of lore.kernel.org
 help / color / mirror / Atom feed
From: Fabio Fantoni <fabio.fantoni@m2r.biz>
To: Stefano Stabellini <stefano.stabellini@eu.citrix.com>,
	xen-devel@lists.xensource.com
Cc: Ian Campbell <Ian.Campbell@citrix.com>,
	Ian Jackson <Ian.Jackson@eu.citrix.com>,
	qemu-devel@nongnu.org, Paul Durrant <paul.durrant@citrix.com>,
	Anthony.Perard@citrix.com, tiejun.chen@intel.com
Subject: Re: [Qemu-devel] [Xen-devel] [PATCH] libxl: change default QEMU machine to pc-i440fx-1.6
Date: Fri, 23 May 2014 19:08:19 +0200	[thread overview]
Message-ID: <537F8083.7040802@m2r.biz> (raw)
In-Reply-To: <alpine.DEB.2.02.1405231555560.14596@kaball.uk.xensource.com>


Il 23/05/2014 18:07, Stefano Stabellini ha scritto:
> Choose pc-i440fx-1.6 instead of pc for HVM guests, so that we know for
> sure what is the machine that we are emulating.
>
> Use pc-i440fx-1.6 regardless of the xen_platform_pci option. Add the
> xen-platform device if requested. Choose slot 2 for the xen-platform
> device for compatibility with current installations. In case of Intel
> graphic passthrough, slot 2 might be needed by the grafic card. However
> now that we can specify the slot explicitly, it is easy to change the
> position of the xen-platform device on the PCI bus if graphic
> passthrough is enabled.
>
> Move the machine options earlier, before any other emulated devices
> options. Otherwise the selected PCI slot for the xen-platform device is
> not available in QEMU.
>
> Specify PIIX4_PM.acpi-pci-hotplug-with-bridge-support=off, because
> differently from xenfv, the other QEMU machines do not have that option
> off by default.
>
> This patch does not change the emulated environment in the guest.
>
> Refer to this thread: http://marc.info/?l=xen-devel&m=140023775929625&w=2
>
> Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
>
> diff --git a/tools/libxl/libxl_dm.c b/tools/libxl/libxl_dm.c
> index 8abed7b..fef684f 100644
> --- a/tools/libxl/libxl_dm.c
> +++ b/tools/libxl/libxl_dm.c
> @@ -476,6 +476,29 @@ static char ** libxl__build_device_model_args_new(libxl__gc *gc,
>           flexarray_vappend(dm_args, "-k", keymap, NULL);
>       }
>   
> +    flexarray_append(dm_args, "-machine");
> +    switch (b_info->type) {
> +    case LIBXL_DOMAIN_TYPE_PV:
> +        flexarray_append(dm_args, "xenpv");
> +        for (i = 0; b_info->extra_pv && b_info->extra_pv[i] != NULL; i++)
> +            flexarray_append(dm_args, b_info->extra_pv[i]);
> +        break;
> +    case LIBXL_DOMAIN_TYPE_HVM:
> +        flexarray_append(dm_args, "pc-i440fx-1.6,accel=xen");
> +        flexarray_append(dm_args, "-global");
> +        flexarray_append(dm_args, "PIIX4_PM.acpi-pci-hotplug-with-bridge-support=off");

I think is good add a comment for remember to remove this workaround 
when pc >=2.1 will be the default since qemu 2.1 will fix it.
https://lists.gnu.org/archive/html/qemu-devel/2014-05/msg04789.html

> +        if (libxl_defbool_val(b_info->u.hvm.xen_platform_pci)) {
> +            flexarray_append(dm_args, "-device");
> +            flexarray_append(dm_args, "xen-platform,addr=0x2");

The fixed pci address to 0x2 probably is a problem with intel gpu 
passthrough:
http://lists.gnu.org/archive/html/qemu-devel/2014-05/msg03726.html

> +        }
> +        for (i = 0; b_info->extra_hvm && b_info->extra_hvm[i] != NULL; i++)
> +            flexarray_append(dm_args, b_info->extra_hvm[i]);
> +        break;
> +    default:
> +        abort();
> +    }
> +
> +
>       if (b_info->type == LIBXL_DOMAIN_TYPE_HVM) {
>           int ioemu_nics = 0;
>   
> @@ -645,29 +668,6 @@ static char ** libxl__build_device_model_args_new(libxl__gc *gc,
>       for (i = 0; b_info->extra && b_info->extra[i] != NULL; i++)
>           flexarray_append(dm_args, b_info->extra[i]);
>   
> -    flexarray_append(dm_args, "-machine");
> -    switch (b_info->type) {
> -    case LIBXL_DOMAIN_TYPE_PV:
> -        flexarray_append(dm_args, "xenpv");
> -        for (i = 0; b_info->extra_pv && b_info->extra_pv[i] != NULL; i++)
> -            flexarray_append(dm_args, b_info->extra_pv[i]);
> -        break;
> -    case LIBXL_DOMAIN_TYPE_HVM:
> -        if (!libxl_defbool_val(b_info->u.hvm.xen_platform_pci)) {
> -            /* Switching here to the machine "pc" which does not add
> -             * the xen-platform device instead of the default "xenfv" machine.
> -             */
> -            flexarray_append(dm_args, "pc,accel=xen");
> -        } else {
> -            flexarray_append(dm_args, "xenfv");
> -        }
> -        for (i = 0; b_info->extra_hvm && b_info->extra_hvm[i] != NULL; i++)
> -            flexarray_append(dm_args, b_info->extra_hvm[i]);
> -        break;
> -    default:
> -        abort();
> -    }
> -
>       ram_size = libxl__sizekb_to_mb(b_info->max_memkb - b_info->video_memkb);
>       flexarray_append(dm_args, "-m");
>       flexarray_append(dm_args, libxl__sprintf(gc, "%"PRId64, ram_size));
>
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel

WARNING: multiple messages have this Message-ID (diff)
From: Fabio Fantoni <fabio.fantoni@m2r.biz>
To: Stefano Stabellini <stefano.stabellini@eu.citrix.com>,
	xen-devel@lists.xensource.com
Cc: Ian Campbell <Ian.Campbell@citrix.com>,
	Ian Jackson <Ian.Jackson@eu.citrix.com>,
	qemu-devel@nongnu.org, Paul Durrant <paul.durrant@citrix.com>,
	Anthony.Perard@citrix.com, tiejun.chen@intel.com
Subject: Re: [Xen-devel] [PATCH] libxl: change default QEMU machine to pc-i440fx-1.6
Date: Fri, 23 May 2014 19:08:19 +0200	[thread overview]
Message-ID: <537F8083.7040802@m2r.biz> (raw)
In-Reply-To: <alpine.DEB.2.02.1405231555560.14596@kaball.uk.xensource.com>


Il 23/05/2014 18:07, Stefano Stabellini ha scritto:
> Choose pc-i440fx-1.6 instead of pc for HVM guests, so that we know for
> sure what is the machine that we are emulating.
>
> Use pc-i440fx-1.6 regardless of the xen_platform_pci option. Add the
> xen-platform device if requested. Choose slot 2 for the xen-platform
> device for compatibility with current installations. In case of Intel
> graphic passthrough, slot 2 might be needed by the grafic card. However
> now that we can specify the slot explicitly, it is easy to change the
> position of the xen-platform device on the PCI bus if graphic
> passthrough is enabled.
>
> Move the machine options earlier, before any other emulated devices
> options. Otherwise the selected PCI slot for the xen-platform device is
> not available in QEMU.
>
> Specify PIIX4_PM.acpi-pci-hotplug-with-bridge-support=off, because
> differently from xenfv, the other QEMU machines do not have that option
> off by default.
>
> This patch does not change the emulated environment in the guest.
>
> Refer to this thread: http://marc.info/?l=xen-devel&m=140023775929625&w=2
>
> Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
>
> diff --git a/tools/libxl/libxl_dm.c b/tools/libxl/libxl_dm.c
> index 8abed7b..fef684f 100644
> --- a/tools/libxl/libxl_dm.c
> +++ b/tools/libxl/libxl_dm.c
> @@ -476,6 +476,29 @@ static char ** libxl__build_device_model_args_new(libxl__gc *gc,
>           flexarray_vappend(dm_args, "-k", keymap, NULL);
>       }
>   
> +    flexarray_append(dm_args, "-machine");
> +    switch (b_info->type) {
> +    case LIBXL_DOMAIN_TYPE_PV:
> +        flexarray_append(dm_args, "xenpv");
> +        for (i = 0; b_info->extra_pv && b_info->extra_pv[i] != NULL; i++)
> +            flexarray_append(dm_args, b_info->extra_pv[i]);
> +        break;
> +    case LIBXL_DOMAIN_TYPE_HVM:
> +        flexarray_append(dm_args, "pc-i440fx-1.6,accel=xen");
> +        flexarray_append(dm_args, "-global");
> +        flexarray_append(dm_args, "PIIX4_PM.acpi-pci-hotplug-with-bridge-support=off");

I think is good add a comment for remember to remove this workaround 
when pc >=2.1 will be the default since qemu 2.1 will fix it.
https://lists.gnu.org/archive/html/qemu-devel/2014-05/msg04789.html

> +        if (libxl_defbool_val(b_info->u.hvm.xen_platform_pci)) {
> +            flexarray_append(dm_args, "-device");
> +            flexarray_append(dm_args, "xen-platform,addr=0x2");

The fixed pci address to 0x2 probably is a problem with intel gpu 
passthrough:
http://lists.gnu.org/archive/html/qemu-devel/2014-05/msg03726.html

> +        }
> +        for (i = 0; b_info->extra_hvm && b_info->extra_hvm[i] != NULL; i++)
> +            flexarray_append(dm_args, b_info->extra_hvm[i]);
> +        break;
> +    default:
> +        abort();
> +    }
> +
> +
>       if (b_info->type == LIBXL_DOMAIN_TYPE_HVM) {
>           int ioemu_nics = 0;
>   
> @@ -645,29 +668,6 @@ static char ** libxl__build_device_model_args_new(libxl__gc *gc,
>       for (i = 0; b_info->extra && b_info->extra[i] != NULL; i++)
>           flexarray_append(dm_args, b_info->extra[i]);
>   
> -    flexarray_append(dm_args, "-machine");
> -    switch (b_info->type) {
> -    case LIBXL_DOMAIN_TYPE_PV:
> -        flexarray_append(dm_args, "xenpv");
> -        for (i = 0; b_info->extra_pv && b_info->extra_pv[i] != NULL; i++)
> -            flexarray_append(dm_args, b_info->extra_pv[i]);
> -        break;
> -    case LIBXL_DOMAIN_TYPE_HVM:
> -        if (!libxl_defbool_val(b_info->u.hvm.xen_platform_pci)) {
> -            /* Switching here to the machine "pc" which does not add
> -             * the xen-platform device instead of the default "xenfv" machine.
> -             */
> -            flexarray_append(dm_args, "pc,accel=xen");
> -        } else {
> -            flexarray_append(dm_args, "xenfv");
> -        }
> -        for (i = 0; b_info->extra_hvm && b_info->extra_hvm[i] != NULL; i++)
> -            flexarray_append(dm_args, b_info->extra_hvm[i]);
> -        break;
> -    default:
> -        abort();
> -    }
> -
>       ram_size = libxl__sizekb_to_mb(b_info->max_memkb - b_info->video_memkb);
>       flexarray_append(dm_args, "-m");
>       flexarray_append(dm_args, libxl__sprintf(gc, "%"PRId64, ram_size));
>
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel

  reply	other threads:[~2014-05-23 17:08 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-05-23 16:07 [Qemu-devel] [PATCH] libxl: change default QEMU machine to pc-i440fx-1.6 Stefano Stabellini
2014-05-23 16:07 ` Stefano Stabellini
2014-05-23 17:08 ` Fabio Fantoni [this message]
2014-05-23 17:08   ` [Xen-devel] " Fabio Fantoni
2014-05-25 14:14   ` [Qemu-devel] " Stefano Stabellini
2014-05-25 14:14     ` Stefano Stabellini
2014-05-26  8:00     ` [Qemu-devel] " Fabio Fantoni
2014-05-26  8:00       ` Fabio Fantoni
2014-05-28 14:45       ` Fabio Fantoni
2014-05-28 16:18         ` Stefano Stabellini
2014-05-28 16:41           ` Stefano Stabellini
2014-05-28 16:50             ` Paolo Bonzini
2014-05-28 16:59               ` Fabio Fantoni
2014-06-03 13:38               ` [Qemu-devel] " Stefano Stabellini
2014-06-03 13:38                 ` Stefano Stabellini
2014-06-03 13:43                 ` [Qemu-devel] " Paolo Bonzini
2014-06-03 13:43                   ` Paolo Bonzini
2014-06-03 13:47                 ` [Qemu-devel] " Ian Campbell
2014-06-03 13:47                   ` Ian Campbell
2014-06-03 14:03                 ` [Qemu-devel] " Fabio Fantoni
2014-06-03 14:03                   ` Fabio Fantoni
2014-05-28 16:53             ` [Xen-devel] " Fabio Fantoni
2014-05-29  8:08               ` Fabio Fantoni
2014-06-10 11:14 ` [Qemu-devel] " Ian Campbell
2014-06-10 11:14   ` Ian Campbell
2014-06-11 10:35   ` [Qemu-devel] " Stefano Stabellini
2014-06-11 10:35     ` Stefano Stabellini
2014-06-11 10:44     ` [Qemu-devel] " Ian Campbell
2014-06-11 10:44       ` Ian Campbell
2014-06-11 18:05       ` [Qemu-devel] [Xen-devel] " Fabio Fantoni
2014-06-11 18:05         ` Fabio Fantoni

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=537F8083.7040802@m2r.biz \
    --to=fabio.fantoni@m2r.biz \
    --cc=Anthony.Perard@citrix.com \
    --cc=Ian.Campbell@citrix.com \
    --cc=Ian.Jackson@eu.citrix.com \
    --cc=paul.durrant@citrix.com \
    --cc=qemu-devel@nongnu.org \
    --cc=stefano.stabellini@eu.citrix.com \
    --cc=tiejun.chen@intel.com \
    --cc=xen-devel@lists.xensource.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.