[Qemu-devel] [PATCH] i386/kvm: fix FEATURE_HYPERV_EDX value in hyperv_passthrough case

2019-08-20 Thread Zhenyu Wang
Fix typo to use correct edx value for FEATURE_HYPERV_EDX when
hyperv_passthrough is enabled.

Signed-off-by: Zhenyu Wang 
---
 target/i386/kvm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/target/i386/kvm.c b/target/i386/kvm.c
index 2abc881324..101229bce4 100644
--- a/target/i386/kvm.c
+++ b/target/i386/kvm.c
@@ -1152,7 +1152,7 @@ static int hyperv_handle_properties(CPUState *cs,
 if (c) {
 env->features[FEAT_HYPERV_EAX] = c->eax;
 env->features[FEAT_HYPERV_EBX] = c->ebx;
-env->features[FEAT_HYPERV_EDX] = c->eax;
+env->features[FEAT_HYPERV_EDX] = c->edx;
 }
 c = cpuid_find_entry(cpuid, HV_CPUID_ENLIGHTMENT_INFO, 0);
 if (c) {
-- 
2.20.1




Re: [Qemu-devel] [PATCH v3 2/2] drm/i915/gvt: export migration_version to mdev sysfs for Intel vGPU

2019-05-28 Thread Zhenyu Wang
On 2019.05.26 23:44:37 -0400, Yan Zhao wrote:
> This feature implements the migration_version attribute for Intel's vGPU
> mdev devices.
> 
> migration_version attribute is rw.
> It's used to check migration compatibility for two mdev devices of the
> same mdev type.
> migration_version string is defined by vendor driver and opaque to
> userspace.
> 
> For Intel vGPU of gen8 and gen9, the format of migration_version string
> is:
>   ---.
> 
> For future platforms, the format of migration_version string is to be
> expanded to include more meta data to identify Intel vGPUs for live
> migration compatibility check
> 
> For old platforms, and for GVT not supporting vGPU live migration
> feature, -ENODEV is returned on read(2)/write(2) of migration_version
> attribute.
> For vGPUs running old GVT who do not expose migration_version
> attribute, live migration is regarded as not supported for those vGPUs.
> 
> Cc: Alex Williamson 
> Cc: Erik Skultety 
> Cc: "Dr. David Alan Gilbert" 
> Cc: Cornelia Huck 
> Cc: "Tian, Kevin" 
> Cc: Zhenyu Wang 
> Cc: "Wang, Zhi A" 
> c: Neo Jia 
> Cc: Kirti Wankhede 
> 
> Signed-off-by: Yan Zhao 
> 
> ---
> v3:
> 1. renamed version to migration_version
> (Christophe de Dinechin, Cornelia Huck, Alex Williamson)
> 2. instead of generating migration version strings each time, storing
> them in vgpu types generated during initialization.
> (Zhenyu Wang, Cornelia Huck)
> 3. replaced multiple snprintf to one big snprintf in
> intel_gvt_get_vfio_migration_version()
> (Dr. David Alan Gilbert)
> 4. printed detailed error log
> (Alex Williamson, Erik Skultety, Cornelia Huck, Dr. David Alan Gilbert)
> 5. incorporated  into migration_version string
> (Alex Williamson)
> 6. do not use ifndef macro to switch off migration_version attribute
> (Zhenyu Wang)
> 
> v2:
> 1. removed 32 common part of version string
> (Alex Williamson)
> 2. do not register version attribute for GVT not supporting live
> migration.(Cornelia Huck)
> 3. for platforms out of gen8, gen9, return -EINVAL --> -ENODEV for
> incompatible. (Cornelia Huck)
> ---
>  drivers/gpu/drm/i915/gvt/Makefile|   2 +-
>  drivers/gpu/drm/i915/gvt/gvt.c   |  39 +
>  drivers/gpu/drm/i915/gvt/gvt.h   |   5 +
>  drivers/gpu/drm/i915/gvt/migration_version.c | 167 +++
>  drivers/gpu/drm/i915/gvt/vgpu.c  |  13 +-
>  5 files changed, 223 insertions(+), 3 deletions(-)
>  create mode 100644 drivers/gpu/drm/i915/gvt/migration_version.c
> 
> diff --git a/drivers/gpu/drm/i915/gvt/Makefile 
> b/drivers/gpu/drm/i915/gvt/Makefile
> index 271fb46d4dd0..a9d561c93ab8 100644
> --- a/drivers/gpu/drm/i915/gvt/Makefile
> +++ b/drivers/gpu/drm/i915/gvt/Makefile
> @@ -3,7 +3,7 @@ GVT_DIR := gvt
>  GVT_SOURCE := gvt.o aperture_gm.o handlers.o vgpu.o trace_points.o 
> firmware.o \
>   interrupt.o gtt.o cfg_space.o opregion.o mmio.o display.o edid.o \
>   execlist.o scheduler.o sched_policy.o mmio_context.o cmd_parser.o 
> debugfs.o \
> - fb_decoder.o dmabuf.o page_track.o
> + fb_decoder.o dmabuf.o page_track.o migration_version.o
>  
>  ccflags-y+= -I$(src) -I$(src)/$(GVT_DIR)
>  i915-y   += $(addprefix $(GVT_DIR)/, 
> $(GVT_SOURCE))
> diff --git a/drivers/gpu/drm/i915/gvt/gvt.c b/drivers/gpu/drm/i915/gvt/gvt.c
> index 43f4242062dd..be2980e8ac75 100644
> --- a/drivers/gpu/drm/i915/gvt/gvt.c
> +++ b/drivers/gpu/drm/i915/gvt/gvt.c
> @@ -105,14 +105,53 @@ static ssize_t description_show(struct kobject *kobj, 
> struct device *dev,
>  type->weight);
>  }
>  
> +static ssize_t migration_version_show(struct kobject *kobj, struct device 
> *dev,
> + char *buf)
> +{
> + struct intel_vgpu_type *type;
> + void *gvt = kdev_to_i915(dev)->gvt;
> +
> + type = intel_gvt_find_vgpu_type(gvt, kobject_name(kobj));
> + if (!type || !type->migration_version) {
> + gvt_err("Does not support migraion on type %s. Please search 
> previous detailed log\n",
> + kobject_name(kobj));
> + return -ENODEV;
> + }
> +
> + return snprintf(buf, strlen(type->migration_version) + 2,
> + "%s\n", type->migration_version);
> +}
> +
> +static ssize_t migration_version_store(struct kobject *kobj, struct device 
> *dev,
> + const char *buf, size_t count)
> +{
> + int ret = 0;
> + struct intel_vgpu_type *type;
> + void *gvt = kdev_to_i915(dev)->gvt;
> +
> + type = intel_gvt_find

Re: [Qemu-devel] [PATCH v2 2/2] drm/i915/gvt: export mdev device version to sysfs for Intel vGPU

2019-05-06 Thread Zhenyu Wang
On 2019.05.06 11:20:32 +0800, Zhenyu Wang wrote:
> On 2019.05.05 21:51:02 -0400, Yan Zhao wrote:
> > This feature implements the version attribute for Intel's vGPU mdev
> > devices.
> > 
> > version attribute is rw.
> > It's used to check device compatibility for two mdev devices.
> > version string format and length are private for vendor driver. vendor
> > driver is able to define them freely.
> > 
> > For Intel vGPU of gen8 and gen9, the mdev device version
> > consists of 3 fields: "vendor id" + "device id" + "mdev type".
> > 
> > Reading from a vGPU's version attribute, a string is returned in below
> > format: --. e.g.
> > 8086-193b-i915-GVTg_V5_2.
> > 
> > Writing a string to a vGPU's version attribute will trigger GVT to check
> > whether a vGPU identified by the written string is compatible with
> > current vGPU owning this version attribute. errno is returned if the two
> > vGPUs are incompatible. The length of written string is returned in
> > compatible case.
> > 
> > For other platforms, and for GVT not supporting vGPU live migration
> > feature, errnos are returned when read/write of mdev devices' version
> > attributes.
> > 
> > For old GVT versions where no version attributes exposed in sysfs, it is
> > regarded as not supporting vGPU live migration.
> > 
> > For future platforms, besides the current 2 fields in vendor proprietary
> > part, more fields may be added to identify Intel vGPU well for live
> > migration purpose.
> > 
> > v2:
> > 1. removed 32 common part of version string
> > (Alex Williamson)
> > 2. do not register version attribute for GVT not supporting live
> > migration.(Cornelia Huck)
> > 3. for platforms out of gen8, gen9, return -EINVAL --> -ENODEV for
> > incompatible. (Cornelia Huck)
> > 
> > Cc: Alex Williamson 
> > Cc: Erik Skultety 
> > Cc: "Dr. David Alan Gilbert" 
> > Cc: Cornelia Huck 
> > Cc: "Tian, Kevin" 
> > Cc: Zhenyu Wang 
> > Cc: "Wang, Zhi A" 
> > c: Neo Jia 
> > Cc: Kirti Wankhede 
> > 
> > Signed-off-by: Yan Zhao 
> > ---
> >  drivers/gpu/drm/i915/gvt/Makefile |  2 +-
> >  drivers/gpu/drm/i915/gvt/device_version.c | 87 +++
> >  drivers/gpu/drm/i915/gvt/gvt.c| 51 +
> >  drivers/gpu/drm/i915/gvt/gvt.h|  6 ++
> >  4 files changed, 145 insertions(+), 1 deletion(-)
> >  create mode 100644 drivers/gpu/drm/i915/gvt/device_version.c
> > 
> > diff --git a/drivers/gpu/drm/i915/gvt/Makefile 
> > b/drivers/gpu/drm/i915/gvt/Makefile
> > index 271fb46d4dd0..54e209a23899 100644
> > --- a/drivers/gpu/drm/i915/gvt/Makefile
> > +++ b/drivers/gpu/drm/i915/gvt/Makefile
> > @@ -3,7 +3,7 @@ GVT_DIR := gvt
> >  GVT_SOURCE := gvt.o aperture_gm.o handlers.o vgpu.o trace_points.o 
> > firmware.o \
> > interrupt.o gtt.o cfg_space.o opregion.o mmio.o display.o edid.o \
> > execlist.o scheduler.o sched_policy.o mmio_context.o cmd_parser.o 
> > debugfs.o \
> > -   fb_decoder.o dmabuf.o page_track.o
> > +   fb_decoder.o dmabuf.o page_track.o device_version.o
> >  
> >  ccflags-y  += -I$(src) -I$(src)/$(GVT_DIR)
> >  i915-y += $(addprefix $(GVT_DIR)/, 
> > $(GVT_SOURCE))
> > diff --git a/drivers/gpu/drm/i915/gvt/device_version.c 
> > b/drivers/gpu/drm/i915/gvt/device_version.c
> > new file mode 100644
> > index ..bd4cdcbdba95
> > --- /dev/null
> > +++ b/drivers/gpu/drm/i915/gvt/device_version.c
> > @@ -0,0 +1,87 @@
> > +/*
> > + * Copyright(c) 2011-2017 Intel Corporation. All rights reserved.
> > + *
> > + * Permission is hereby granted, free of charge, to any person obtaining a
> > + * copy of this software and associated documentation files (the 
> > "Software"),
> > + * to deal in the Software without restriction, including without 
> > limitation
> > + * the rights to use, copy, modify, merge, publish, distribute, sublicense,
> > + * and/or sell copies of the Software, and to permit persons to whom the
> > + * Software is furnished to do so, subject to the following conditions:
> > + *
> > + * The above copyright notice and this permission notice (including the 
> > next
> > + * paragraph) shall be included in all copies or substantial portions of 
> > the
> > + * Software.
> > + *
> > + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY O

Re: [Qemu-devel] [PATCH v2 2/2] drm/i915/gvt: export mdev device version to sysfs for Intel vGPU

2019-05-05 Thread Zhenyu Wang
On 2019.05.05 21:51:02 -0400, Yan Zhao wrote:
> This feature implements the version attribute for Intel's vGPU mdev
> devices.
> 
> version attribute is rw.
> It's used to check device compatibility for two mdev devices.
> version string format and length are private for vendor driver. vendor
> driver is able to define them freely.
> 
> For Intel vGPU of gen8 and gen9, the mdev device version
> consists of 3 fields: "vendor id" + "device id" + "mdev type".
> 
> Reading from a vGPU's version attribute, a string is returned in below
> format: --. e.g.
> 8086-193b-i915-GVTg_V5_2.
> 
> Writing a string to a vGPU's version attribute will trigger GVT to check
> whether a vGPU identified by the written string is compatible with
> current vGPU owning this version attribute. errno is returned if the two
> vGPUs are incompatible. The length of written string is returned in
> compatible case.
> 
> For other platforms, and for GVT not supporting vGPU live migration
> feature, errnos are returned when read/write of mdev devices' version
> attributes.
> 
> For old GVT versions where no version attributes exposed in sysfs, it is
> regarded as not supporting vGPU live migration.
> 
> For future platforms, besides the current 2 fields in vendor proprietary
> part, more fields may be added to identify Intel vGPU well for live
> migration purpose.
> 
> v2:
> 1. removed 32 common part of version string
> (Alex Williamson)
> 2. do not register version attribute for GVT not supporting live
> migration.(Cornelia Huck)
> 3. for platforms out of gen8, gen9, return -EINVAL --> -ENODEV for
> incompatible. (Cornelia Huck)
> 
> Cc: Alex Williamson 
> Cc: Erik Skultety 
> Cc: "Dr. David Alan Gilbert" 
> Cc: Cornelia Huck 
> Cc: "Tian, Kevin" 
> Cc: Zhenyu Wang 
> Cc: "Wang, Zhi A" 
> c: Neo Jia 
> Cc: Kirti Wankhede 
> 
> Signed-off-by: Yan Zhao 
> ---
>  drivers/gpu/drm/i915/gvt/Makefile |  2 +-
>  drivers/gpu/drm/i915/gvt/device_version.c | 87 +++
>  drivers/gpu/drm/i915/gvt/gvt.c| 51 +
>  drivers/gpu/drm/i915/gvt/gvt.h|  6 ++
>  4 files changed, 145 insertions(+), 1 deletion(-)
>  create mode 100644 drivers/gpu/drm/i915/gvt/device_version.c
> 
> diff --git a/drivers/gpu/drm/i915/gvt/Makefile 
> b/drivers/gpu/drm/i915/gvt/Makefile
> index 271fb46d4dd0..54e209a23899 100644
> --- a/drivers/gpu/drm/i915/gvt/Makefile
> +++ b/drivers/gpu/drm/i915/gvt/Makefile
> @@ -3,7 +3,7 @@ GVT_DIR := gvt
>  GVT_SOURCE := gvt.o aperture_gm.o handlers.o vgpu.o trace_points.o 
> firmware.o \
>   interrupt.o gtt.o cfg_space.o opregion.o mmio.o display.o edid.o \
>   execlist.o scheduler.o sched_policy.o mmio_context.o cmd_parser.o 
> debugfs.o \
> - fb_decoder.o dmabuf.o page_track.o
> + fb_decoder.o dmabuf.o page_track.o device_version.o
>  
>  ccflags-y+= -I$(src) -I$(src)/$(GVT_DIR)
>  i915-y   += $(addprefix $(GVT_DIR)/, 
> $(GVT_SOURCE))
> diff --git a/drivers/gpu/drm/i915/gvt/device_version.c 
> b/drivers/gpu/drm/i915/gvt/device_version.c
> new file mode 100644
> index ..bd4cdcbdba95
> --- /dev/null
> +++ b/drivers/gpu/drm/i915/gvt/device_version.c
> @@ -0,0 +1,87 @@
> +/*
> + * Copyright(c) 2011-2017 Intel Corporation. All rights reserved.
> + *
> + * Permission is hereby granted, free of charge, to any person obtaining a
> + * copy of this software and associated documentation files (the "Software"),
> + * to deal in the Software without restriction, including without limitation
> + * the rights to use, copy, modify, merge, publish, distribute, sublicense,
> + * and/or sell copies of the Software, and to permit persons to whom the
> + * Software is furnished to do so, subject to the following conditions:
> + *
> + * The above copyright notice and this permission notice (including the next
> + * paragraph) shall be included in all copies or substantial portions of the
> + * Software.
> + *
> + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
> + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
> + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
> + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
> + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 
> FROM,
> + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 
> THE
> + * SOFTWARE.
> + *
> + * Authors:
> + *Yan Zhao 
> + */
> +#include 
> +#include "

Re: [Qemu-devel] [PATCH 2/2] drm/i915/gvt: export mdev device version to sysfs for Intel vGPU

2019-04-22 Thread Zhenyu Wang
On 2019.04.19 04:35:59 -0400, Yan Zhao wrote:
> This feature implements the version attribute for Intel's vGPU mdev
> devices.
> 
> version attribute is rw. It is queried by userspace software like libvirt
> to check whether two vGPUs are compatible for live migration.
> 
> It consists of two parts: common part and vendor proprietary part.
> common part: 32 bit. lower 16 bits is vendor id and higher 16 bits
>  identifies device type. e.g., for pci device, it is
>  "pci vendor id" | (VFIO_DEVICE_FLAGS_PCI << 16).
> vendor proprietary part: this part is varied in length. vendor driver can
>  specify any string to identify a device.
> 
> For Intel vGPU of gen8 and gen9, the vendor proprietary part currently
> consists of 2 fields: "device id" + "mdev type".
> 
> Reading from a vGPU's version attribute, a string is returned in below
> format: 00028086--. e.g.
> 00028086-193b-i915-GVTg_V5_2.
> 
> Writing a string to a vGPU's version attribute will trigger GVT to check
> whether a vGPU identified by the written string is compatible with
> current vGPU owning this version attribute. errno is returned if the two
> vGPUs are incompatible. The length of written string is returned in
> compatible case.
> 
> For other platforms, and for GVT not supporting vGPU live migration
> feature, errnos are returned when read/write of mdev devices' version
> attributes.
> 
> For old GVT versions where no version attributes exposed in sysfs, it is
> regarded as not supporting vGPU live migration.
> 
> For future platforms, besides the current 2 fields in vendor proprietary
> part, more fields may be added to identify Intel vGPU well for live
> migration purpose.
> 
> Cc: Alex Williamson 
> Cc: Erik Skultety 
> Cc: "Dr. David Alan Gilbert" 
> Cc: Cornelia Huck 
> Cc: "Tian, Kevin" 
> Cc: Zhenyu Wang 
> Cc: "Wang, Zhi A" 
> c: Neo Jia 
> Cc: Kirti Wankhede 
> 
> Signed-off-by: Yan Zhao 
> ---
>  drivers/gpu/drm/i915/gvt/Makefile |  2 +-
>  drivers/gpu/drm/i915/gvt/device_version.c | 94 +++
>  drivers/gpu/drm/i915/gvt/gvt.c| 55 +
>  drivers/gpu/drm/i915/gvt/gvt.h|  6 ++
>  4 files changed, 156 insertions(+), 1 deletion(-)
>  create mode 100644 drivers/gpu/drm/i915/gvt/device_version.c
> 
> diff --git a/drivers/gpu/drm/i915/gvt/Makefile 
> b/drivers/gpu/drm/i915/gvt/Makefile
> index 271fb46d4dd0..54e209a23899 100644
> --- a/drivers/gpu/drm/i915/gvt/Makefile
> +++ b/drivers/gpu/drm/i915/gvt/Makefile
> @@ -3,7 +3,7 @@ GVT_DIR := gvt
>  GVT_SOURCE := gvt.o aperture_gm.o handlers.o vgpu.o trace_points.o 
> firmware.o \
>   interrupt.o gtt.o cfg_space.o opregion.o mmio.o display.o edid.o \
>   execlist.o scheduler.o sched_policy.o mmio_context.o cmd_parser.o 
> debugfs.o \
> - fb_decoder.o dmabuf.o page_track.o
> + fb_decoder.o dmabuf.o page_track.o device_version.o
>  
>  ccflags-y+= -I$(src) -I$(src)/$(GVT_DIR)
>  i915-y   += $(addprefix $(GVT_DIR)/, 
> $(GVT_SOURCE))
> diff --git a/drivers/gpu/drm/i915/gvt/device_version.c 
> b/drivers/gpu/drm/i915/gvt/device_version.c
> new file mode 100644
> index ..c64010d2bc54
> --- /dev/null
> +++ b/drivers/gpu/drm/i915/gvt/device_version.c
> @@ -0,0 +1,94 @@
> +/*
> + * Copyright(c) 2011-2017 Intel Corporation. All rights reserved.
> + *
> + * Permission is hereby granted, free of charge, to any person obtaining a
> + * copy of this software and associated documentation files (the "Software"),
> + * to deal in the Software without restriction, including without limitation
> + * the rights to use, copy, modify, merge, publish, distribute, sublicense,
> + * and/or sell copies of the Software, and to permit persons to whom the
> + * Software is furnished to do so, subject to the following conditions:
> + *
> + * The above copyright notice and this permission notice (including the next
> + * paragraph) shall be included in all copies or substantial portions of the
> + * Software.
> + *
> + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
> + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
> + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
> + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
> + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 
> FROM,
> + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 
> THE
> + * SOFTWARE.
> + */
> +#include 
> +#

Re: [Qemu-devel] [PATCH v4 4/7] qdev: add hotpluggable to DeviceState

2018-02-22 Thread Zhenyu Wang
On 2018.02.22 09:59:17 -0700, Alex Williamson wrote:
> On Thu, 22 Feb 2018 15:46:17 +
> Peter Maydell  wrote:
> 
> > On 22 February 2018 at 15:37, Gerd Hoffmann  wrote:
> > > On Mon, Feb 19, 2018 at 12:14:55PM +0100, Gerd Hoffmann wrote:  
> > >> vfio display support wants disable hotplug for certain devices, because
> > >> qemu doesn't support hotplugging display devices and qemu consoles.
> > >>
> > >> Add a hotpluggable bool to DeviceState, initialize it from
> > >> DeviceClass->hotpluggable, update device_get_hotpluggable accordingly.
> > >>
> > >> Devices can flip the new variable from true to false if needed.  
> > >
> > > Alex wants an ack for this one.  Who maintains it these days?
> > >
> > > MAINTAINERS doesn't list qdev.  For QOM which is closest probably
> > > Andreas Färber is listed.  Havn't seen him on the list for a while
> > > though.
> > >
> > > Ok, lets try some usual suspects...
> > > Markus? Eric? Paolo? Peter?  Any comments on this one?  
> > 
> > What type of device is only sometimes hotpluggable ?
> > The commit message says "display devices" and "consoles",
> > but I would expect those to both be types of device which
> > have a class which is never hotpluggable, so you can mark
> > them non-hotpluggable with the existing class flag rather
> > than needing a per-instance flag.
> 
> With this series, a vfio-pci device optionally supports a display.  The
> vfio-pci device is hotpluggable, but QEMU display support is not.  So
> the solution here is to make the vfio-pci device non-hotpluggable only
> when it supports and enables a display.
>

I'm not sure, how this is supposed to work?

And there's also case that vgpu's display is not required but still need
device hotplug feature e.g to use render/media acceleration, as supported
by current vfio mdev device on gvt-g.

> Gerd, is there another solution that the display object is instantiated
> separately from the vfio-pci object and the display support in the
> vfio-pci device references the display object via an id.  Possibly
> vfio-pci could remain hotpluggable while the display class device is
> not.  Potentially one display could be switched between multiple
> display capable devices, like an input control button on a monitor,
> losing signal if none are connected.  Possible?  Clearly I have no idea
> how display objects actually work in QEMU.  Thanks,
> 
> Alex
> ___
> intel-gvt-dev mailing list
> intel-gvt-...@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/intel-gvt-dev

-- 
Open Source Technology Center, Intel ltd.

$gpg --keyserver wwwkeys.pgp.net --recv-keys 4D781827


signature.asc
Description: PGP signature


Re: [Qemu-devel] [PATCH v4 0/7] vfio: add display support

2018-02-22 Thread Zhenyu Wang
On 2018.02.22 10:30:55 +0100, Gerd Hoffmann wrote:
>   Hi,
> 
> > Nice! Seems to be the last missing gap for local spice with cursor
> > dmabuf support, we'll do more testing on that for sure. Btw, another
> > method might be to add direct cursor dmabuf passing for spice as gl
> > output, is that correct way?
> 
> Passing on the cursor sprite needs the hotspot information, so spice
> client can position the cursor correctly.  I didn't got hotspot
> information in my testing yet, but maybe the guest kernel was too old.
> Is that supported meanwhile?  If so, which kernel version is needed?
>

Current gvt dmabuf doesn't support true hotspot info yet which requires
some pv info update as we can't get it from hw state. Tina is pursuing that.

> Spice already has support for setting pointers, we can simply use
> that, at least initially.  Doesn't use dma-bufs.  If it turns out to be
> a performance issue we can add support for using dma-bufs instead, but
> that needs spice server changes.
> 
> > And really like to see dmabuf support could be in upstream soon. Do
> > you have any predict for which qemu version?
> 
> I want have this in 2.12, at least the current, initial version.
> Improved cursor support might take a little longer.
> 

Good to know. Thanks!

-- 
Open Source Technology Center, Intel ltd.

$gpg --keyserver wwwkeys.pgp.net --recv-keys 4D781827


signature.asc
Description: PGP signature


Re: [Qemu-devel] [PATCH v4 0/7] vfio: add display support

2018-02-21 Thread Zhenyu Wang
On 2018.02.20 18:04:17 +0100, Gerd Hoffmann wrote:
>   Hi,
> 
> > Sneak preview at https://www.kraxel.org/cgit/qemu/log/?h=work/intel-vgpu
> > Note: branch is a moving target ;)
> > 
> > State:
> >   spice: Partly working (no mouse ptr yet).
> 
> Working now, in case anyone wants play.
> 
> Must turn on opengl and use a unix socket, i.e. this:
> 
>   qemu -spice disable-ticketing,gl=on,unix,addr=/tmp/spice-vgpu
> 
> and this:
> 
>   remote-viewer spice+unix:tmp/spice-vgpu
> 
> Host needs a 4.16-rc kernel.
> 
> Guest can be older, most of the time I'm testing with the Fedora 27 live
> iso (4.13) which works ok.
> 

Nice! Seems to be the last missing gap for local spice with cursor
dmabuf support, we'll do more testing on that for sure. Btw, another
method might be to add direct cursor dmabuf passing for spice as gl
output, is that correct way?

And really like to see dmabuf support could be in upstream soon. Do
you have any predict for which qemu version?

Thanks!

-- 
Open Source Technology Center, Intel ltd.

$gpg --keyserver wwwkeys.pgp.net --recv-keys 4D781827


signature.asc
Description: PGP signature


Re: [Qemu-devel] [PATCH v14 00/22] Add Mediated device support

2016-11-18 Thread Zhenyu Wang
On 2016.11.17 16:51:45 -0700, Alex Williamson wrote:
> On Thu, 17 Nov 2016 23:29:38 +
> "Tian, Kevin"  wrote:
> 
> > > From: Alex Williamson [mailto:alex.william...@redhat.com]
> > > Sent: Friday, November 18, 2016 5:25 AM
> > > 
> > > On Thu, 17 Nov 2016 02:16:12 +0530
> > > Kirti Wankhede  wrote:  
> > > >
> > > >  Documentation/ABI/testing/sysfs-bus-vfio-mdev |  111 ++
> > > >  Documentation/vfio-mediated-device.txt|  399 +++
> > > >  MAINTAINERS   |9 +
> > > >  drivers/vfio/Kconfig  |1 +
> > > >  drivers/vfio/Makefile |1 +
> > > >  drivers/vfio/mdev/Kconfig |   17 +
> > > >  drivers/vfio/mdev/Makefile|5 +
> > > >  drivers/vfio/mdev/mdev_core.c |  385 +++
> > > >  drivers/vfio/mdev/mdev_driver.c   |  119 ++
> > > >  drivers/vfio/mdev/mdev_private.h  |   41 +
> > > >  drivers/vfio/mdev/mdev_sysfs.c|  286 +
> > > >  drivers/vfio/mdev/vfio_mdev.c |  180 +++
> > > >  drivers/vfio/pci/vfio_pci.c   |   83 +-
> > > >  drivers/vfio/platform/vfio_platform_common.c  |   31 +-
> > > >  drivers/vfio/vfio.c   |  340 +-
> > > >  drivers/vfio/vfio_iommu_type1.c   |  872 +++---
> > > >  include/linux/mdev.h  |  177 +++
> > > >  include/linux/vfio.h  |   32 +-
> > > >  include/uapi/linux/vfio.h |   10 +
> > > >  samples/vfio-mdev/Makefile|   13 +
> > > >  samples/vfio-mdev/mtty.c  | 1503  
> > > +  
> > > >  21 files changed, 4358 insertions(+), 257 deletions(-)
> > > >  create mode 100644 Documentation/ABI/testing/sysfs-bus-vfio-mdev
> > > >  create mode 100644 Documentation/vfio-mediated-device.txt
> > > >  create mode 100644 drivers/vfio/mdev/Kconfig
> > > >  create mode 100644 drivers/vfio/mdev/Makefile
> > > >  create mode 100644 drivers/vfio/mdev/mdev_core.c
> > > >  create mode 100644 drivers/vfio/mdev/mdev_driver.c
> > > >  create mode 100644 drivers/vfio/mdev/mdev_private.h
> > > >  create mode 100644 drivers/vfio/mdev/mdev_sysfs.c
> > > >  create mode 100644 drivers/vfio/mdev/vfio_mdev.c
> > > >  create mode 100644 include/linux/mdev.h
> > > >  create mode 100644 samples/vfio-mdev/Makefile
> > > >  create mode 100644 samples/vfio-mdev/mtty.c  
> > > 
> > > As discussed, I dropped patch 12, updated the documentation, and added
> > > 'retries' initialization.  This is now applied to my next branch for
> > > v4.10.  Thanks to the reviewers and Kirti and Neo for your hard work!
> > > Thanks,
> > >   
> > 
> > That's a great news! Alex, do you have an idea when this series may
> > hit linux-next? :-)
> 
> Whenever there's a new build, hopefully within the next 24hrs, but I
> don't really know the schedule.  Thanks,
> 

Alex, could you do a pull request of mdev for Daniel's drm-intel tree?
We need to send KVMGT mdev support pull base on that.

Thanks!

-- 
Open Source Technology Center, Intel ltd.

$gpg --keyserver wwwkeys.pgp.net --recv-keys 4D781827


signature.asc
Description: PGP signature


Re: [Qemu-devel] [Intel-gfx] [RFC][PATCH] gpu:drm:i915:intel_detect_pch: back to check devfn instead of check class type

2014-06-24 Thread Zhenyu Wang
On 2014.06.19 17:53:51 +0800, Tiejun Chen wrote:
 Originally the reason to probe ISA bridge instead of Dev31:Fun0
 is to make graphics device passthrough work easy for VMM, that
 only need to expose ISA bridge to let driver know the real
 hardware underneath. This is a requirement from virtualization
 team. Especially in that virtualized environments, XEN, there
 is irrelevant ISA bridge in the system with that legacy qemu
 version specific to xen, qemu-xen-traditional. So to work
 reliably, we should scan through all the ISA bridge devices
 and check for the first match, instead of only checking the
 first one.
 
 But actually, qemu-xen-traditional, is always enumerated with
 Dev31:Fun0, 00:1f.0 as follows:
 
 hw/pt-graphics.c:
 
 intel_pch_init()
 |
 + pci_isa_bridge_init(bus, PCI_DEVFN(0x1f, 0), ...);
 
 so this mean that isa bridge is still represented with Dev31:Func0
 like the native OS. Furthermore, currently we're pushing VGA
 passthrough support into qemu upstream, and with some discussion,
 we wouldn't set the bridge class type and just expose this devfn.
 
 So we just go back to check devfn to make life normal.
 
 Signed-off-by: Tiejun Chen tiejun.c...@intel.com

This was added historically when supporting graphics device passthrough.
Looks qemu upstream can't accept multiple ISA bridge and our PCH is always
on device 31: func0 as far as I know. Looks good to me.

Reviewed-by: Zhenyu Wang zhen...@linux.intel.com 

-- 
Open Source Technology Center, Intel ltd.

$gpg --keyserver wwwkeys.pgp.net --recv-keys 4D781827


signature.asc
Description: Digital signature