xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
* [v4][PATCH 1/2] libxl: introduce libxl__is_igd_vga_passthru
       [not found] <1442565017-31725-1-git-send-email-tiejun.chen@intel.com>
@ 2015-09-18  8:30 ` Tiejun Chen
  2015-09-18  8:30 ` [v4][PATCH 2/2] libxl: introduce gfx_passthru_kind Tiejun Chen
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: Tiejun Chen @ 2015-09-18  8:30 UTC (permalink / raw)
  To: ian.campbell, wei.liu2, stefano.stabellini, Ian.Jackson
  Cc: qemu-devel, xen-devel

While working with qemu, IGD is a specific device in the case of pass through
so we need to identify that to handle more later. Here we define a table to
record all IGD types currently we can support. Also we need to introduce two
helper functions to get vendor and device ids to lookup that table.

Signed-off-by: Tiejun Chen <tiejun.chen@intel.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/libxl/libxl_internal.h |   2 +
 tools/libxl/libxl_pci.c      | 124 +++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 126 insertions(+)

diff --git a/tools/libxl/libxl_internal.h b/tools/libxl/libxl_internal.h
index 5fa55a7..5d6c793 100644
--- a/tools/libxl/libxl_internal.h
+++ b/tools/libxl/libxl_internal.h
@@ -1343,6 +1343,8 @@ _hidden int libxl__device_pci_add(libxl__gc *gc, uint32_t domid, libxl_device_pc
 _hidden int libxl__create_pci_backend(libxl__gc *gc, uint32_t domid,
                                       libxl_device_pci *pcidev, int num);
 _hidden int libxl__device_pci_destroy_all(libxl__gc *gc, uint32_t domid);
+_hidden bool libxl__is_igd_vga_passthru(libxl__gc *gc,
+                                        const libxl_domain_config *d_config);
 
 /* from libxl_dtdev */
 
diff --git a/tools/libxl/libxl_pci.c b/tools/libxl/libxl_pci.c
index 7229a36..8434ec8 100644
--- a/tools/libxl/libxl_pci.c
+++ b/tools/libxl/libxl_pci.c
@@ -491,6 +491,130 @@ static int sysfs_dev_unbind(libxl__gc *gc, libxl_device_pci *pcidev,
     return 0;
 }
 
+static uint16_t sysfs_dev_get_vendor(libxl__gc *gc, libxl_device_pci *pcidev)
+{
+    char *pci_device_vendor_path =
+            GCSPRINTF(SYSFS_PCI_DEV"/"PCI_BDF"/vendor",
+                      pcidev->domain, pcidev->bus, pcidev->dev, pcidev->func);
+    uint16_t read_items;
+    uint16_t pci_device_vendor;
+
+    FILE *f = fopen(pci_device_vendor_path, "r");
+    if (!f) {
+        LOGE(ERROR,
+             "pci device "PCI_BDF" does not have vendor attribute",
+             pcidev->domain, pcidev->bus, pcidev->dev, pcidev->func);
+        return 0xffff;
+    }
+    read_items = fscanf(f, "0x%hx\n", &pci_device_vendor);
+    fclose(f);
+    if (read_items != 1) {
+        LOGE(ERROR,
+             "cannot read vendor of pci device "PCI_BDF,
+             pcidev->domain, pcidev->bus, pcidev->dev, pcidev->func);
+        return 0xffff;
+    }
+
+    return pci_device_vendor;
+}
+
+static uint16_t sysfs_dev_get_device(libxl__gc *gc, libxl_device_pci *pcidev)
+{
+    char *pci_device_device_path =
+            GCSPRINTF(SYSFS_PCI_DEV"/"PCI_BDF"/device",
+                      pcidev->domain, pcidev->bus, pcidev->dev, pcidev->func);
+    uint16_t read_items;
+    uint16_t pci_device_device;
+
+    FILE *f = fopen(pci_device_device_path, "r");
+    if (!f) {
+        LOGE(ERROR,
+             "pci device "PCI_BDF" does not have device attribute",
+             pcidev->domain, pcidev->bus, pcidev->dev, pcidev->func);
+        return 0xffff;
+    }
+    read_items = fscanf(f, "0x%hx\n", &pci_device_device);
+    fclose(f);
+    if (read_items != 1) {
+        LOGE(ERROR,
+             "cannot read device of pci device "PCI_BDF,
+             pcidev->domain, pcidev->bus, pcidev->dev, pcidev->func);
+        return 0xffff;
+    }
+
+    return pci_device_device;
+}
+
+typedef struct {
+    uint16_t vendor;
+    uint16_t device;
+} pci_info;
+
+static const pci_info fixup_ids[] = {
+    /* Intel HSW Classic */
+    {0x8086, 0x0402}, /* HSWGT1D, HSWD_w7 */
+    {0x8086, 0x0406}, /* HSWGT1M, HSWM_w7 */
+    {0x8086, 0x0412}, /* HSWGT2D, HSWD_w7 */
+    {0x8086, 0x0416}, /* HSWGT2M, HSWM_w7 */
+    {0x8086, 0x041E}, /* HSWGT15D, HSWD_w7 */
+    /* Intel HSW ULT */
+    {0x8086, 0x0A06}, /* HSWGT1UT, HSWM_w7 */
+    {0x8086, 0x0A16}, /* HSWGT2UT, HSWM_w7 */
+    {0x8086, 0x0A26}, /* HSWGT3UT, HSWM_w7 */
+    {0x8086, 0x0A2E}, /* HSWGT3UT28W, HSWM_w7 */
+    {0x8086, 0x0A1E}, /* HSWGT2UX, HSWM_w7 */
+    {0x8086, 0x0A0E}, /* HSWGT1ULX, HSWM_w7 */
+    /* Intel HSW CRW */
+    {0x8086, 0x0D26}, /* HSWGT3CW, HSWM_w7 */
+    {0x8086, 0x0D22}, /* HSWGT3CWDT, HSWD_w7 */
+    /* Intel HSW Server */
+    {0x8086, 0x041A}, /* HSWSVGT2, HSWD_w7 */
+    /* Intel HSW SRVR */
+    {0x8086, 0x040A}, /* HSWSVGT1, HSWD_w7 */
+    /* Intel BSW */
+    {0x8086, 0x1606}, /* BDWULTGT1, BDWM_w7 */
+    {0x8086, 0x1616}, /* BDWULTGT2, BDWM_w7 */
+    {0x8086, 0x1626}, /* BDWULTGT3, BDWM_w7 */
+    {0x8086, 0x160E}, /* BDWULXGT1, BDWM_w7 */
+    {0x8086, 0x161E}, /* BDWULXGT2, BDWM_w7 */
+    {0x8086, 0x1602}, /* BDWHALOGT1, BDWM_w7 */
+    {0x8086, 0x1612}, /* BDWHALOGT2, BDWM_w7 */
+    {0x8086, 0x1622}, /* BDWHALOGT3, BDWM_w7 */
+    {0x8086, 0x162B}, /* BDWHALO28W, BDWM_w7 */
+    {0x8086, 0x162A}, /* BDWGT3WRKS, BDWM_w7 */
+    {0x8086, 0x162D}, /* BDWGT3SRVR, BDWM_w7 */
+};
+
+/*
+ * Some devices may need some ways to work well. Here like IGD,
+ * we have to pass a specific option to qemu.
+ */
+bool libxl__is_igd_vga_passthru(libxl__gc *gc,
+                                const libxl_domain_config *d_config)
+{
+    unsigned int i, j, num = ARRAY_SIZE(fixup_ids);
+    uint16_t vendor, device, pt_vendor, pt_device;
+
+    for (i = 0 ; i < d_config->num_pcidevs ; i++) {
+        libxl_device_pci *pcidev = &d_config->pcidevs[i];
+        pt_vendor = sysfs_dev_get_vendor(gc, pcidev);
+        pt_device = sysfs_dev_get_device(gc, pcidev);
+
+        if (pt_vendor == 0xffff || pt_device == 0xffff)
+            continue;
+
+        for (j = 0 ; j < num ; j++) {
+            vendor = fixup_ids[j].vendor;
+            device = fixup_ids[j].device;
+
+            if (pt_vendor == vendor &&  pt_device == device)
+                return true;
+        }
+    }
+
+    return false;
+}
+
 /*
  * A brief comment about slots.  I don't know what slots are for; however,
  * I have by experimentation determined:
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [v4][PATCH 2/2] libxl: introduce gfx_passthru_kind
       [not found] <1442565017-31725-1-git-send-email-tiejun.chen@intel.com>
  2015-09-18  8:30 ` [v4][PATCH 1/2] libxl: introduce libxl__is_igd_vga_passthru Tiejun Chen
@ 2015-09-18  8:30 ` Tiejun Chen
  2015-09-25  5:51 ` [Qemu-devel] [v4][PATCH 0/2] libxl: try to support IGD passthrough for qemu upstream Chen, Tiejun
       [not found] ` <1442565017-31725-3-git-send-email-tiejun.chen@intel.com>
  3 siblings, 0 replies; 5+ messages in thread
From: Tiejun Chen @ 2015-09-18  8:30 UTC (permalink / raw)
  To: ian.campbell, wei.liu2, stefano.stabellini, Ian.Jackson
  Cc: qemu-devel, xen-devel

Although we already have 'gfx_passthru' in b_info, this doesn't suffice
after we want to handle IGD specifically. Now we define a new field of
type, gfx_passthru_kind, to indicate we're trying to pass IGD. Actually
this means we can benefit this to support other specific devices just
by extending gfx_passthru_kind. And then we can cooperate with
gfx_passthru to address IGD cases as follows:

    gfx_passthru = 0    => sets build_info.u.gfx_passthru to false
    gfx_passthru = 1    => sets build_info.u.gfx_passthru to true and
                           build_info.u.gfx_passthru_kind to DEFAULT
    gfx_passthru = "igd"    => sets build_info.u.gfx_passthru to true
                               and build_info.u.gfx_passthru_kind to IGD

Here if gfx_passthru_kind = DEFAULT, we will call
libxl__is_igd_vga_passthru() to check if we're hitting that table to need
to pass that option to qemu. But if gfx_passthru_kind = "igd" we always
force to pass that.

And "-gfx_passthru" is just introduced to work for qemu-xen-traditional
so we should get this away from libxl__build_device_model_args_new() in
the case of qemu upstream.

Signed-off-by: Tiejun Chen <tiejun.chen@intel.com>
---
 docs/man/xl.cfg.pod.5       | 35 ++++++++++++++++++++++++++++++----
 tools/libxl/libxl.h         |  6 ++++++
 tools/libxl/libxl_dm.c      | 46 +++++++++++++++++++++++++++++++++++++++++----
 tools/libxl/libxl_types.idl |  6 ++++++
 tools/libxl/xl_cmdimpl.c    | 14 ++++++++++++--
 5 files changed, 97 insertions(+), 10 deletions(-)

diff --git a/docs/man/xl.cfg.pod.5 b/docs/man/xl.cfg.pod.5
index db4a163..4aa7b05 100644
--- a/docs/man/xl.cfg.pod.5
+++ b/docs/man/xl.cfg.pod.5
@@ -812,7 +812,7 @@ through to this VM. See L<seize|/"seize_boolean"> above.
 devices passed through to this VM. See L<power_mgt|/"power_mgmt_boolean">
 above.
 
-=item B<gfx_passthru=BOOLEAN>
+=item B<gfx_passthru=BOOLEAN|"STRING">
 
 Enable graphics device PCI passthrough. This option makes an assigned
 PCI graphics card become primary graphics card in the VM. The QEMU
@@ -840,9 +840,36 @@ working graphics passthrough. See the XenVGAPassthroughTestedAdapters
 L<http://wiki.xen.org/wiki/XenVGAPassthroughTestedAdapters> wiki page
 for currently supported graphics cards for gfx_passthru.
 
-gfx_passthru is currently only supported with the qemu-xen-traditional
-device-model. Upstream qemu-xen device-model currently does not have
-support for gfx_passthru.
+gfx_passthru is currently supported both with the qemu-xen-traditional
+device-model and upstream qemu-xen device-model.
+
+When given as a boolean the B<gfx_passthru> option either disables gfx
+passthru or enables autodetection.
+
+But when given as a string the B<gfx_passthru> option describes the type
+of device to enable. Note this behavior is only supported with the upstream
+qemu-xen device-model. With qemu-xen-traditional IGD is always assumed
+and other options than autodetect or explicit IGD will result in an error.
+
+Currently, valid options are:
+
+=over 4
+
+=item B<gfx_passthru=0>
+
+Disables graphics device PCI passthrough.
+
+=item B<gfx_passthru=1>, B<gfx_passthru="default">
+
+Enables graphics device PCI passthrough and autodetects the type of device
+which is being used.
+
+=item "igd"
+
+Enables graphics device PCI passthrough but forcing the type of device to
+Intel Graphics Device.
+
+=back
 
 Note that some graphics adapters (AMD/ATI cards, for example) do not
 necessarily require gfx_passthru option, so you can use the normal Xen
diff --git a/tools/libxl/libxl.h b/tools/libxl/libxl.h
index 5f9047c..899de28 100644
--- a/tools/libxl/libxl.h
+++ b/tools/libxl/libxl.h
@@ -832,6 +832,12 @@ void libxl_mac_copy(libxl_ctx *ctx, libxl_mac *dst, libxl_mac *src);
  */
 #define LIBXL_HAVE_SRM_V1 1
 
+/*
+ * libxl_domain_build_info has the u.hvm.gfx_passthru_kind field and
+ * the libxl_gfx_passthru_kind enumeration is defined.
+*/
+#define LIBXL_HAVE_GFX_PASSTHRU_KIND
+
 typedef char **libxl_string_list;
 void libxl_string_list_dispose(libxl_string_list *sl);
 int libxl_string_list_length(const libxl_string_list *sl);
diff --git a/tools/libxl/libxl_dm.c b/tools/libxl/libxl_dm.c
index b7c6592..9378b0b 100644
--- a/tools/libxl/libxl_dm.c
+++ b/tools/libxl/libxl_dm.c
@@ -605,7 +605,15 @@ static int libxl__build_device_model_args_old(libxl__gc *gc,
             flexarray_vappend(dm_args, "-net", "none", NULL);
         }
         if (libxl_defbool_val(b_info->u.hvm.gfx_passthru)) {
-            flexarray_append(dm_args, "-gfx_passthru");
+            switch (b_info->u.hvm.gfx_passthru_kind) {
+            case LIBXL_GFX_PASSTHRU_KIND_DEFAULT:
+            case LIBXL_GFX_PASSTHRU_KIND_IGD:
+                flexarray_append(dm_args, "-gfx_passthru");
+                break;
+            default:
+                LOG(ERROR, "unsupported gfx_passthru_kind.");
+                return ERROR_INVAL;
+            }
         }
     } else {
         if (!sdl && !vnc)
@@ -700,6 +708,22 @@ static char *dm_spice_options(libxl__gc *gc,
     return opt;
 }
 
+static enum libxl_gfx_passthru_kind
+libxl__detect_gfx_passthru_kind(libxl__gc *gc,
+                                const libxl_domain_config *guest_config)
+{
+    const libxl_domain_build_info *b_info = &guest_config->b_info;
+
+    if (b_info->u.hvm.gfx_passthru_kind != LIBXL_GFX_PASSTHRU_KIND_DEFAULT)
+        return b_info->u.hvm.gfx_passthru_kind;
+
+    if (libxl__is_igd_vga_passthru(gc, guest_config)) {
+        return LIBXL_GFX_PASSTHRU_KIND_IGD;
+    }
+
+    return LIBXL_GFX_PASSTHRU_KIND_DEFAULT;
+}
+
 static int libxl__build_device_model_args_new(libxl__gc *gc,
                                         const char *dm, int guest_domid,
                                         const libxl_domain_config *guest_config,
@@ -1031,9 +1055,6 @@ static int libxl__build_device_model_args_new(libxl__gc *gc,
             flexarray_append(dm_args, "-net");
             flexarray_append(dm_args, "none");
         }
-        if (libxl_defbool_val(b_info->u.hvm.gfx_passthru)) {
-            flexarray_append(dm_args, "-gfx_passthru");
-        }
     } else {
         if (!sdl && !vnc) {
             flexarray_append(dm_args, "-nographic");
@@ -1078,6 +1099,23 @@ static int libxl__build_device_model_args_new(libxl__gc *gc,
                                             machinearg, max_ram_below_4g);
             }
         }
+
+        if (libxl_defbool_val(b_info->u.hvm.gfx_passthru)) {
+            enum libxl_gfx_passthru_kind gfx_passthru_kind =
+                            libxl__detect_gfx_passthru_kind(gc, guest_config);
+            switch (gfx_passthru_kind) {
+            case LIBXL_GFX_PASSTHRU_KIND_IGD:
+                machinearg = GCSPRINTF("%s,igd-passthru=on", machinearg);
+                break;
+            case LIBXL_GFX_PASSTHRU_KIND_DEFAULT:
+                LOG(ERROR, "unable to detect required gfx_passthru_kind");
+                return ERROR_FAIL;
+            default:
+                LOG(ERROR, "invalid value for gfx_passthru_kind");
+                return ERROR_INVAL;
+            }
+        }
+
         flexarray_append(dm_args, machinearg);
         for (i = 0; b_info->extra_hvm && b_info->extra_hvm[i] != NULL; i++)
             flexarray_append(dm_args, b_info->extra_hvm[i]);
diff --git a/tools/libxl/libxl_types.idl b/tools/libxl/libxl_types.idl
index 9f6ec00..7e1ab85 100644
--- a/tools/libxl/libxl_types.idl
+++ b/tools/libxl/libxl_types.idl
@@ -157,6 +157,11 @@ libxl_tsc_mode = Enumeration("tsc_mode", [
     (3, "native_paravirt"),
     ])
 
+libxl_gfx_passthru_kind = Enumeration("gfx_passthru_kind", [
+    (0, "default"),
+    (1, "igd"),
+    ])
+
 # Consistent with the values defined for HVM_PARAM_TIMER_MODE.
 libxl_timer_mode = Enumeration("timer_mode", [
     (-1, "unknown"),
@@ -488,6 +493,7 @@ libxl_domain_build_info = Struct("domain_build_info",[
                                        ("spice",            libxl_spice_info),
                                        
                                        ("gfx_passthru",     libxl_defbool),
+                                       ("gfx_passthru_kind", libxl_gfx_passthru_kind),
                                        
                                        ("serial",           string),
                                        ("boot",             string),
diff --git a/tools/libxl/xl_cmdimpl.c b/tools/libxl/xl_cmdimpl.c
index 2706759..b26fc37 100644
--- a/tools/libxl/xl_cmdimpl.c
+++ b/tools/libxl/xl_cmdimpl.c
@@ -2295,8 +2295,18 @@ skip_vfb:
         xlu_cfg_replace_string (config, "spice_streaming_video",
                                 &b_info->u.hvm.spice.streaming_video, 0);
         xlu_cfg_get_defbool(config, "nographic", &b_info->u.hvm.nographic, 0);
-        xlu_cfg_get_defbool(config, "gfx_passthru",
-                            &b_info->u.hvm.gfx_passthru, 0);
+        if (!xlu_cfg_get_long(config, "gfx_passthru", &l, 1)) {
+            libxl_defbool_set(&b_info->u.hvm.gfx_passthru, l);
+        } else if (!xlu_cfg_get_string(config, "gfx_passthru", &buf, 0)) {
+            if (libxl_gfx_passthru_kind_from_string(buf,
+                                        &b_info->u.hvm.gfx_passthru_kind)) {
+                fprintf(stderr,
+                        "ERROR: invalid value \"%s\" for \"gfx_passthru\"\n",
+                        buf);
+                exit (1);
+            }
+            libxl_defbool_set(&b_info->u.hvm.gfx_passthru, true);
+        }
         switch (xlu_cfg_get_list_as_string_list(config, "serial",
                                                 &b_info->u.hvm.serial_list,
                                                 1))
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [Qemu-devel] [v4][PATCH 0/2] libxl: try to support IGD passthrough for qemu upstream
       [not found] <1442565017-31725-1-git-send-email-tiejun.chen@intel.com>
  2015-09-18  8:30 ` [v4][PATCH 1/2] libxl: introduce libxl__is_igd_vga_passthru Tiejun Chen
  2015-09-18  8:30 ` [v4][PATCH 2/2] libxl: introduce gfx_passthru_kind Tiejun Chen
@ 2015-09-25  5:51 ` Chen, Tiejun
       [not found] ` <1442565017-31725-3-git-send-email-tiejun.chen@intel.com>
  3 siblings, 0 replies; 5+ messages in thread
From: Chen, Tiejun @ 2015-09-25  5:51 UTC (permalink / raw)
  To: ian.campbell, wei.liu2, stefano.stabellini, Ian.Jackson
  Cc: qemu-devel, xen-devel

Ping...

Thanks
Tiejun

On 9/18/2015 4:30 PM, Tiejun Chen wrote:
> Ian,
>
> As we discussed previously,
>
> http://patchwork.ozlabs.org/patch/457055/
>
> now it's time to push this into on xen/tools side since all qemu stuffs
> have been merged.
>
> https://lists.gnu.org/archive/html/qemu-devel/2015-09/msg02094.html
>
> v4:
>
> Ian,
>
> Actually we had v3.5 online previously, which was reviewed by you.
>
> http://permalink.gmane.org/gmane.comp.emulators.qemu/329100
>
> So here I just bring a little bit to refine code just for patch #2
> according to out last conversation.
>
> v3:
>
> * Refine some codes based on Campbell's feedback so thanks for Campbell's
>    kind guideline to patch #2
> * Update the manpages in patch #2
>
> v2:
>
> * Refine patch #2's head description
> * Improve codes quality inside patch #1 based on Wei's comments
> * Refill the summary inside patch #0 based on Konrad and Wei's suggestion
>
> When we're working to support IGD GFX passthrough with qemu
> upstream, instead of "-gfx_passthru" we'd like to make that
> a machine option, "-machine xxx,igd-passthru=on".
>
> https://lists.nongnu.org/archive/html/qemu-devel/2015-01/msg02050.html
>
> This need to bring a change on tool side.
>
> After a discussion with Campbell, we'd like to construct a table to record
> all IGD devices we can support. If we hit that table, we should pass that
> option. And so we also introduce a new field of type, 'gfx_passthru_kind',
> to cooperate with 'gfx_passthru' to cover all scenarios like this,
>
>      gfx_passthru = 0    => sets build_info.u.gfx_passthru to false
>      gfx_passthru = 1    => sets build_info.u.gfx_passthru to true and
>                             build_info.u.gfx_passthru_kind to DEFAULT
>      gfx_passthru = "igd"    => sets build_info.u.gfx_passthru to false
>                                 and build_info.u.gfx_passthru_kind to IGD
>
> And note actually that option "-gfx_passthru" is just introduced to
> work for qemu-xen-traditional so we should get this away from
> libxl__build_device_model_args_new() in the case of qemu upstream.
>
> ----------------------------------------------------------------
> Tiejun Chen (2):
>        libxl: introduce libxl__is_igd_vga_passthru
>        libxl: introduce gfx_passthru_kind
>
>   docs/man/xl.cfg.pod.5        |  35 ++++++++--
>   tools/libxl/libxl.h          |   6 ++
>   tools/libxl/libxl_dm.c       |  46 +++++++++++--
>   tools/libxl/libxl_internal.h |   2 +
>   tools/libxl/libxl_pci.c      | 124 +++++++++++++++++++++++++++++++++++
>   tools/libxl/libxl_types.idl  |   6 ++
>   tools/libxl/xl_cmdimpl.c     |  14 +++-
>   7 files changed, 223 insertions(+), 10 deletions(-)
>
> Thanks
> Tiejun
>
>

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [v4][PATCH 2/2] libxl: introduce gfx_passthru_kind
       [not found] ` <1442565017-31725-3-git-send-email-tiejun.chen@intel.com>
@ 2015-09-25 15:38   ` Ian Campbell
       [not found]   ` <1443195500.25250.167.camel@citrix.com>
  1 sibling, 0 replies; 5+ messages in thread
From: Ian Campbell @ 2015-09-25 15:38 UTC (permalink / raw)
  To: Tiejun Chen, wei.liu2, stefano.stabellini, Ian.Jackson
  Cc: qemu-devel, xen-devel

On Fri, 2015-09-18 at 16:30 +0800, Tiejun Chen wrote:
> Although we already have 'gfx_passthru' in b_info, this doesn't suffice
> after we want to handle IGD specifically. Now we define a new field of
> type, gfx_passthru_kind, to indicate we're trying to pass IGD. Actually
> this means we can benefit this to support other specific devices just
> by extending gfx_passthru_kind. And then we can cooperate with
> gfx_passthru to address IGD cases as follows:
> 
>     gfx_passthru = 0    => sets build_info.u.gfx_passthru to false
>     gfx_passthru = 1    => sets build_info.u.gfx_passthru to true and
>                            build_info.u.gfx_passthru_kind to DEFAULT
>     gfx_passthru = "igd"    => sets build_info.u.gfx_passthru to true
>                                and build_info.u.gfx_passthru_kind to IGD
> 
> Here if gfx_passthru_kind = DEFAULT, we will call
> libxl__is_igd_vga_passthru() to check if we're hitting that table to need
> to pass that option to qemu. But if gfx_passthru_kind = "igd" we always
> force to pass that.
> 
> And "-gfx_passthru" is just introduced to work for qemu-xen-traditional
> so we should get this away from libxl__build_device_model_args_new() in
> the case of qemu upstream.
> 
> Signed-off-by: Tiejun Chen <tiejun.chen@intel.com>

Acked + applied both patches, thanks.

Stefano -- are the QEMU side patches in qemu-upstream-unstable.git yet? If
not I suppose this is a call/reminder to backport them from mainline or
whatever.

Ian.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [v4][PATCH 2/2] libxl: introduce gfx_passthru_kind
       [not found]   ` <1443195500.25250.167.camel@citrix.com>
@ 2015-10-06 15:30     ` Stefano Stabellini
  0 siblings, 0 replies; 5+ messages in thread
From: Stefano Stabellini @ 2015-10-06 15:30 UTC (permalink / raw)
  To: Ian Campbell
  Cc: wei.liu2, Ian.Jackson, qemu-devel, xen-devel, stefano.stabellini,
	Tiejun Chen

On Fri, 25 Sep 2015, Ian Campbell wrote:
> On Fri, 2015-09-18 at 16:30 +0800, Tiejun Chen wrote:
> > Although we already have 'gfx_passthru' in b_info, this doesn't suffice
> > after we want to handle IGD specifically. Now we define a new field of
> > type, gfx_passthru_kind, to indicate we're trying to pass IGD. Actually
> > this means we can benefit this to support other specific devices just
> > by extending gfx_passthru_kind. And then we can cooperate with
> > gfx_passthru to address IGD cases as follows:
> > 
> >     gfx_passthru = 0    => sets build_info.u.gfx_passthru to false
> >     gfx_passthru = 1    => sets build_info.u.gfx_passthru to true and
> >                            build_info.u.gfx_passthru_kind to DEFAULT
> >     gfx_passthru = "igd"    => sets build_info.u.gfx_passthru to true
> >                                and build_info.u.gfx_passthru_kind to IGD
> > 
> > Here if gfx_passthru_kind = DEFAULT, we will call
> > libxl__is_igd_vga_passthru() to check if we're hitting that table to need
> > to pass that option to qemu. But if gfx_passthru_kind = "igd" we always
> > force to pass that.
> > 
> > And "-gfx_passthru" is just introduced to work for qemu-xen-traditional
> > so we should get this away from libxl__build_device_model_args_new() in
> > the case of qemu upstream.
> > 
> > Signed-off-by: Tiejun Chen <tiejun.chen@intel.com>
> 
> Acked + applied both patches, thanks.
> 
> Stefano -- are the QEMU side patches in qemu-upstream-unstable.git yet? If
> not I suppose this is a call/reminder to backport them from mainline or
> whatever.

No, they are not, they'll be in qemu-upstream for Xen 4.7.

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2015-10-06 15:30 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <1442565017-31725-1-git-send-email-tiejun.chen@intel.com>
2015-09-18  8:30 ` [v4][PATCH 1/2] libxl: introduce libxl__is_igd_vga_passthru Tiejun Chen
2015-09-18  8:30 ` [v4][PATCH 2/2] libxl: introduce gfx_passthru_kind Tiejun Chen
2015-09-25  5:51 ` [Qemu-devel] [v4][PATCH 0/2] libxl: try to support IGD passthrough for qemu upstream Chen, Tiejun
     [not found] ` <1442565017-31725-3-git-send-email-tiejun.chen@intel.com>
2015-09-25 15:38   ` [v4][PATCH 2/2] libxl: introduce gfx_passthru_kind Ian Campbell
     [not found]   ` <1443195500.25250.167.camel@citrix.com>
2015-10-06 15:30     ` Stefano Stabellini

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).