Re: [PATCH] drm/i915/gvt: Fix uninitialized variable in handle_mmio()

2024-01-28 Thread Zhenyu Wang
quot;, > - info->offset); > + WARN(1, "dup mmio definition offset %x\n", i); > > /* We return -EEXIST here to make GVT-g load fail. >* So duplicated MMIO can be found as soon as > -- > 2.43.0 > Thanks for the fix. Reviewed-by: Zhenyu Wang signature.asc Description: PGP signature

Re: [PATCH v2 1/4] i915: make inject_virtual_interrupt() void

2023-11-22 Thread Zhenyu Wang
> - return -ESRCH; > - if (vgpu->msi_trigger && eventfd_signal(vgpu->msi_trigger, 1) != 1) > - return -EFAULT; > - return 0; > + return; > + if (!vgpu->msi_trigger) > + return; > + eventfd_signal(vgpu-&

Re: [PATCH v2] drm/i915/gvt: Make use of idr_find and idr_for_each_entry in dmabuf

2023-03-08 Thread Zhenyu Wang
he original code '&& !list_empty()' Looks good to me. I'll send it for some regression test before upstream. Reviewed-by: Zhenyu Wang Thanks! > > v1 link: > > https://lore.kernel.org/lkml/20230302115318.79487-1-cai.huoq...@linux.dev/ > > drivers/gpu/drm/i91

Re: [PATCH] drm/i915/gvt: Make use of idr_find and idr_for_each_entry in dmabuf

2023-03-02 Thread Zhenyu Wang
On 2023.03.02 19:53:18 +0800, Cai Huoqing wrote: > This patch uses the already existing IDR mechanism to simplify > and improve the dmabuf code. > > Using 'vgpu.object_idr' directly instead of 'dmabuf_obj_list_head' > or 'dmabuf.list', because the dmabuf_obj can be found by 'idr_find' > or

Re: [PATCH][next] i915/gvt: Fix spelling mistake "vender" -> "vendor"

2023-02-22 Thread Zhenyu Wang
mem = (fw->data + h->cfg_space_offset); > > id = *(u16 *)(mem + PCI_VENDOR_ID); > - VERIFY("vender id", id, pdev->vendor); > + VERIFY("vendor id", id, pdev->vendor); > > id = *(u16 *)(mem + PCI_DEVICE_ID); > VERIFY(&

Re: [Intel-gfx] [PATCH] i915: fix memory leak with using debugfs_lookup()

2023-02-22 Thread Zhenyu Wang
, just > > call debugfs_lookup_and_remove() instead which handles all of the logic > > at once. > > > > Cc: Zhenyu Wang > > Cc: Zhi Wang > > Cc: Jani Nikula > > Cc: Joonas Lahtinen > > Cc: Rodrigo Vivi > > Cc: Tvrtko Ursulin > > Cc: David Airlie

Re: [PATCH] drm/i915: move a Kconfig symbol to unbreak the menu presentation

2023-02-19 Thread Zhenyu Wang
On 2023.02.16 22:32:33 -0800, Randy Dunlap wrote: > Hi, > > On 2/16/23 17:52, Zhenyu Wang wrote: > > On 2023.02.14 20:45:33 -0800, Randy Dunlap wrote: > >> Inserting a Kconfig symbol that does not have a dependency (DRM_I915_GVT) > >> into a list of other

Re: [PATCH] drm/i915: move a Kconfig symbol to unbreak the menu presentation

2023-02-16 Thread Zhenyu Wang
Randy Dunlap > Cc: Christoph Hellwig > Cc: Zhi Wang > Cc: Jani Nikula > Cc: Joonas Lahtinen > Cc: Rodrigo Vivi > Cc: Tvrtko Ursulin > Cc: Zhenyu Wang > Cc: intel-...@lists.freedesktop.org > Cc: intel-gvt-...@lists.freedesktop.org > Cc: dri-devel@lists.freedeskto

Re: [Intel-gfx] [PATCH 2/2] drm/i915/gvt: Avoid full proxy f_ops for vgpu_status debug attributes

2023-01-19 Thread Zhenyu Wang
On 2023.01.19 17:05:56 -0500, Rodrigo Vivi wrote: > > It still doesn't apply in drm-intel-next. > Could you please take it through your branch? > sure, I'll pick it. signature.asc Description: PGP signature

Re: [PATCH] drm/i915/gvt: Remove extra semicolon

2023-01-18 Thread Zhenyu Wang
tel_vgpu *vgpu, > ret = idr_alloc(>vgpu_idr, vgpu, IDLE_VGPU_IDR + 1, GVT_MAX_VGPU, > GFP_KERNEL); > if (ret < 0) > - goto out_unlock;; > + goto out_unlock; > > vgpu->id = ret; > vgpu->sched_ctl.weight

Re: [Intel-gfx] [PATCH 2/2] drm/i915/gvt: Avoid full proxy f_ops for vgpu_status debug attributes

2023-01-18 Thread Zhenyu Wang
On 2023.01.18 11:44:55 -0500, Rodrigo Vivi wrote: > On Wed, Jan 18, 2023 at 10:18:11AM +0530, Deepak R Varma wrote: > > On Tue, Jan 17, 2023 at 02:29:37PM -0500, Rodrigo Vivi wrote: > > > On Mon, Jan 16, 2023 at 01:44:46PM +0800, Zhenyu Wang wrote: > > > > On 2023

Re: [PATCH 2/2] drm/i915/gvt: Avoid full proxy f_ops for vgpu_status debug attributes

2023-01-15 Thread Zhenyu Wang
ess they ack and I apply in the drm-intel along with the other > ones. > yeah, they're fine with me, feel free to apply them directly. Acked-by: Zhenyu Wang thanks! > > --- > > drivers/gpu/drm/i915/gvt/debugfs.c | 6 +++--- > > 1 file changed, 3 insertions(+)

Re: [PATCH v5] drm/i915/gvt: fix double free bug in split_2MB_gtt_entry

2022-12-20 Thread Zhenyu Wang
/* Release the new allocated spt. */ > + trace_spt_change(sub_spt->vgpu->id, "release", sub_spt, > + sub_spt->guest_page.gfn, sub_spt->shadow_page.type); > + ppgtt_free_spt(sub_spt); > + sub_spt = NULL; Not need to reset local variable that h

Re: [PATCH] [next] i915/gvt: Replace one-element array with flexible-array member

2022-12-20 Thread Zhenyu Wang
ar data[]; > }; > > #define dev_to_drm_minor(d) dev_get_drvdata((d)) > @@ -77,7 +77,7 @@ static int expose_firmware_sysfs(struct intel_gvt *gvt) > unsigned long size, crc32_start; > int ret; > > - size = sizeof(*h) + info->mmio_size + info->cfg_space_siz

Re: [RESEND PATCH v4] drm/i915/gvt: fix double free bug in split_2MB_gtt_entry

2022-12-20 Thread Zhenyu Wang
On 2022.12.19 20:52:04 +0800, Zheng Wang wrote: > If intel_gvt_dma_map_guest_page failed, it will call > ppgtt_invalidate_spt, which will finally free the spt. But the caller does > not notice that, it will free spt again in error path. > It's not clear from this description which caller is

Re: [PATCH 2/2] drm/i915/gvt: Remove the unused function get_pt_type()

2022-11-07 Thread Zhenyu Wang
type(int type) > -{ > - return gtt_type_table[type].pt_type; > -} > - > static inline int get_entry_type(int type) > { > return gtt_type_table[type].entry_type; > -- > 2.20.1.7.g153144c > Reviewed-by: Zhenyu Wang thanks! signature.asc Description: PGP signature

Re: [PATCH] drm/i915: fix repeated words in comments

2022-11-07 Thread Zhenyu Wang
@gvt: GVT device > * > - * This function is called at the driver unloading stage, to clean up the > + * This function is called at the driver unloading stage, to clean up > * the mm components of a GVT device. > * > */ > -- > 2.36.1 > Reviewed-by: Zhenyu Wang thanks signature.asc Description: PGP signature

Re: [PATCH] [next] i915/gvt: remove hardcoded value on crc32_start calculation

2022-11-07 Thread Zhenyu Wang
nfo->mmio_size); > > - crc32_start = offsetof(struct gvt_firmware_header, crc32) + 4; > + crc32_start = offsetof(struct gvt_firmware_header, version); > h->crc32 = crc32_le(0, firmware + crc32_start, size - crc32_start); > > firmware_attr.size = size; > -- > 2.25.4 > Reviewed-by: Zhenyu Wang thanks! signature.asc Description: PGP signature

Re: [PATCH v2 08/15] drm/i915/gvt: Use the new device life cycle helpers

2022-09-06 Thread Zhenyu Wang
ewed-by: Jason Gunthorpe > --- Looks good to me. Reviewed-by: Zhenyu Wang > drivers/gpu/drm/i915/gvt/gvt.h | 5 ++- > drivers/gpu/drm/i915/gvt/kvmgt.c | 52 ++-- > drivers/gpu/drm/i915/gvt/vgpu.c | 33 > 3 files changed, 50 inserti

Re: [PATCH] drm/i915/gvt: fix double-free bug in split_2MB_gtt_entry.

2022-09-06 Thread Zhenyu Wang
On 2022.09.06 19:36:56 +0800, Zheng Hacker wrote: > Hi Greg, > > Alex has explained how we figured out the patch. We did analyze the > code and found it possible to reach the vulnerability code. But we > have no physical device in hand to test the driver. So we'd like to > discuss with developers

Re: [PATCH v2 07/39] drm/i915: gvt: fix kernel-doc trivial warnings

2022-07-13 Thread Zhenyu Wang
> - * intel_gvt_deactive_vgpu - deactivate a virtual GPU > + * intel_gvt_deactivate_vgpu - deactivate a virtual GPU > * @vgpu: virtual GPU > * > * This function is called when user wants to deactivate a virtual GPU. > @@ -348,7 +348,7 @@ struct intel_vgpu *intel_gvt_create_

Re: [PATCH 04/32] drm/i915: gvt: fix kernel-doc trivial warnings

2022-07-11 Thread Zhenyu Wang
On 2022.07.11 21:24:49 +0100, Mauro Carvalho Chehab wrote: > Some functions seem to have been renamed without updating the kernel-doc > markup causing warnings. Also, struct intel_vgpu_dmabuf_obj is not > properly documented, but has a kerneld-doc markup. > > Fix those warnings: >

Re: [PATCH] drm/i915/gvt: Fix kernel-doc

2022-07-10 Thread Zhenyu Wang
This function is used to free the HW resource owned by a vGPU. > @@ -328,7 +328,7 @@ void intel_vgpu_reset_resource(struct intel_vgpu *vgpu) > } > > /** > - * intel_alloc_vgpu_resource - allocate HW resource for a vGPU > + * intel_vgpu_alloc_resource() - allocate HW resource for a vG

Re: [PATCH 2/2] drm/i915/gvt: Fix kernel-doc

2022-07-10 Thread Zhenyu Wang
gine > + * intel_gvt_switch_mmio - switch mmio context of specific engine > * @pre: the last vGPU that own the engine > * @next: the vGPU to switch to > * @engine: the engine > -- > 2.20.1.7.g153144c > Acked-by: Zhenyu Wang Thanks! signature.asc Description: PGP signature

Re: [PATCH 1/2] drm/i915/gvt: Fix kernel-doc

2022-07-10 Thread Zhenyu Wang
te handler > + * intel_vgpu_default_mmio_write() - default MMIO write handler > * @vgpu: a vGPU > * @offset: access offset > * @p_data: write data buffer > -- > 2.20.1.7.g153144c > Sorry for late reply! Acked-by: Zhenyu Wang signature.asc Description: PGP signature

Re: [PATCH] drm/i915/gvt: fix typo in comment

2022-07-10 Thread Zhenyu Wang
* settting the shadow entry to point to a scratch page > + * setting the shadow entry to point to a scratch page >*/ > ops->set_pfn(, gvt->gtt.scratch_mfn); > } else > Sorry for late reply! Acked-by: Zhenyu Wang signature.asc Description: PGP signature

Re: [PATCH v3 1/2] vfio: Replace the DMA unmapping notifier with a callback

2022-07-05 Thread Zhenyu Wang
ewed-by: Christoph Hellwig > Reviewed-by: Kevin Tian > Reviewed-by: Tony Krowiak > Reviewed-by: Eric Farman > Signed-off-by: Jason Gunthorpe > --- > drivers/gpu/drm/i915/gvt/gvt.h| 1 - > drivers/gpu/drm/i915/gvt/kvmgt.c | 75 --- gvt change look

Re: [PATCH v9 1/3] i915/gvt: Separate the MMIO tracking table from GVT-g

2022-04-07 Thread Zhenyu Wang
fine to me. Thanks! Reviewed-by: Zhenyu Wang signature.asc Description: PGP signature

Re: [PATCH v8 10/16] i915/gvt: remove spaces in pr_debug "gvt: core:" etc prefixes

2021-09-23 Thread Zhenyu Wang
(fmt, args...) \ > - pr_debug("gvt: dpy: "fmt, ##args) > + pr_debug("gvt:dpy: " fmt, ##args) > > #define gvt_dbg_el(fmt, args...) \ > - pr_debug("gvt: el: "fmt, ##args) > + pr_debug("gvt:el: " fmt, ##args) > >

Re: refactor the i915 GVT support

2021-08-26 Thread Zhenyu Wang
On 2021.08.20 12:56:34 -0700, Luis Chamberlain wrote: > On Fri, Aug 20, 2021 at 04:17:24PM +0200, Christoph Hellwig wrote: > > On Thu, Aug 19, 2021 at 04:29:29PM +0800, Zhenyu Wang wrote: > > > I'm working on below patch to resolve this. But I met a weird issue in > > &

Re: refactor the i915 GVT support

2021-08-26 Thread Zhenyu Wang
On 2021.08.20 16:17:24 +0200, Christoph Hellwig wrote: > On Thu, Aug 19, 2021 at 04:29:29PM +0800, Zhenyu Wang wrote: > > I'm working on below patch to resolve this. But I met a weird issue in > > case when building i915 as module and also kvmgt module, it caused > > busy w

Re: refactor the i915 GVT support

2021-08-26 Thread Zhenyu Wang
On 2021.08.19 17:43:43 +0300, Joonas Lahtinen wrote: > Quoting Zhenyu Wang (2021-08-19 11:29:29) > > On 2021.08.17 13:22:03 +0800, Zhenyu Wang wrote: > > > > On 2021.08.16 19:34:58 +0200, Christoph Hellwig wrote: > > > > > Any updates on this? I'd r

Re: refactor the i915 GVT support

2021-08-19 Thread Zhenyu Wang
On 2021.08.17 13:22:03 +0800, Zhenyu Wang wrote: > > On 2021.08.16 19:34:58 +0200, Christoph Hellwig wrote: > > > Any updates on this? I'd really hate to miss this merge window. > > > > I'm still waiting for our validation team's report on this. I'm afraid >

Re: refactor the i915 GVT support

2021-08-16 Thread Zhenyu Wang
On 2021.08.17 09:08:55 +0800, Zhenyu Wang wrote: > On 2021.08.16 19:34:58 +0200, Christoph Hellwig wrote: > > On Wed, Aug 04, 2021 at 01:26:06PM +0800, Zhenyu Wang wrote: > > > On 2021.08.03 11:30:58 -0300, Jason Gunthorpe wrote: > > > > On Tue, Aug 03, 2021 at 05:43

Re: refactor the i915 GVT support

2021-08-16 Thread Zhenyu Wang
On 2021.08.16 19:34:58 +0200, Christoph Hellwig wrote: > On Wed, Aug 04, 2021 at 01:26:06PM +0800, Zhenyu Wang wrote: > > On 2021.08.03 11:30:58 -0300, Jason Gunthorpe wrote: > > > On Tue, Aug 03, 2021 at 05:43:15PM +0800, Zhenyu Wang wrote: > > > > Acked-by: Zhenyu

Re: refactor the i915 GVT support

2021-08-03 Thread Zhenyu Wang
On 2021.08.03 11:30:58 -0300, Jason Gunthorpe wrote: > On Tue, Aug 03, 2021 at 05:43:15PM +0800, Zhenyu Wang wrote: > > Acked-by: Zhenyu Wang > > > > Thanks a lot for this effort! > > Great, do we have a submission plan for this? how much does it clash > with my

Re: refactor the i915 GVT support

2021-08-03 Thread Zhenyu Wang
f we were to support another upstream hypervisor we'd just need to > union a few fields in struct intel_gpu and maybe introduce a few > methods. Preferably in a way that avoids expensive indirect calls > in the fast path. ok, agree on that. Acked-by: Zhenyu Wang Thanks a lot for this effort! signature.asc Description: PGP signature

Re: [PATCH 01/21] drm/i915/gvt: integrate into the main Makefile

2021-08-03 Thread Zhenyu Wang
On 2021.07.21 17:53:35 +0200, Christoph Hellwig wrote: > Remove the separately included Makefile and just use the relative > reference from the main i915 Makefile as for source files in other > subdirectories. > We agreed to make gvt mostly self-contained in its own directory before. Although I

Re: refactor the i915 GVT support

2021-07-22 Thread Zhenyu Wang
On 2021.07.21 17:53:34 +0200, Christoph Hellwig wrote: > Hi all, > > the GVT code in the i915 is a bit of a mess right now due to strange > abstractions and lots of indirect calls. This series refactors various > bits to clean that up. The main user visible change is that almost all > of the

Re: [PATCH] drm/i915/gvt: Convert from atomic_t to refcount_t on intel_vgpu_ppgtt_spt->refcount

2021-07-20 Thread Zhenyu Wang
On 2021.07.16 18:41:38 +0800, Xiyu Yang wrote: > refcount_t type and corresponding API can protect refcounters from > accidental underflow and overflow and further use-after-free situations > Thanks for the patch. Is there any specific problem you run with current code? Any shadow ppgtt error? >

Re: [PATCH 12/13] vfio/gvt: Fix open/close when multiple device FDs are open

2021-07-16 Thread Zhenyu Wang
> > - .open = intel_vgpu_open, > - .release= intel_vgpu_release, > + .open_device= intel_vgpu_open_device, > + .close_device = intel_vgpu_close_device, > > .read = intel_vgpu_read, > .write = intel_vgpu_write, Looks ok to me. Thanks! Reviewed-by: Zhenyu Wang signature.asc Description: PGP signature

Re: [PATCH v2] drm/i915/gem: Use list_entry to access list members

2021-06-01 Thread Zhenyu Wang
> - list); > + dmabuf_obj = list_entry(pos, struct intel_vgpu_dmabuf_obj, > list); > dmabuf_obj->vgpu = NULL; > > idr_remove(>object_idr, dmabuf_obj->dmabuf_id); > -- Sorry for late reply! Looks good to me. Reviewed-by: Zhenyu Wang signature.asc Description: PGP signature

Re: i915 gvt broke drm-tip; Fix ASAP

2021-05-23 Thread Zhenyu Wang
On 2021.05.22 21:19:38 +0200, Thomas Zimmermann wrote: > Hi, > > after creating drm-tip today as part of [1], building drm-tip is now broken > with the error message shown below. > > Some register constants appear to be missing from the GVT code. Please fix > ASAP. > Thanks, Thomas. Looks DMC

Re: [PATCH] drm/i915/gvt: remove local storage of debugfs file

2021-05-19 Thread Zhenyu Wang
On 2021.05.19 10:31:18 +0200, Greg Kroah-Hartman wrote: > On Wed, May 19, 2021 at 04:03:13PM +0800, Zhenyu Wang wrote: > > On 2021.05.18 18:28:53 +0200, Greg Kroah-Hartman wrote: > > > On Tue, May 18, 2021 at 06:17:05PM +0200, Greg Kroah-Hartman wrote: > > > > There

Re: [PATCH] drm/i915/gvt: remove local storage of debugfs file

2021-05-19 Thread Zhenyu Wang
n. > > Simplify the structure by removing the dentry and relying on debugfs > > to find the dentry to remove when we want to. > > > > By doing this change, we remove the last in-kernel user that was storing > > the result of debugfs_create_long(), so that api can be cleaned u

Re: [PATCH] drm/i915/gvt: remove local storage of debugfs file

2021-05-18 Thread Zhenyu Wang
d the dentry to remove when we want to. > > By doing this change, we remove the last in-kernel user that was storing > the result of debugfs_create_long(), so that api can be cleaned up. > > Cc: Zhenyu Wang > Cc: Zhi Wang > Cc: Jani Nikula > Cc: Joonas Lahtinen > Cc: Rodrigo

Re: [PATCH] vfio/gvt: fix DRM_I915_GVT dependency on VFIO_MDEV

2021-04-24 Thread Zhenyu Wang
On 2021.04.23 09:20:09 -0600, Alex Williamson wrote: > On Fri, 23 Apr 2021 09:07:09 -0300 > Jason Gunthorpe wrote: > > > On Fri, Apr 23, 2021 at 11:54:26AM +0800, Zhenyu Wang wrote: > > > On 2021.04.22 10:58:10 -0300, Jason Gunthorpe wrote: > > > > On T

Re: [PATCH] vfio/gvt: fix DRM_I915_GVT dependency on VFIO_MDEV

2021-04-22 Thread Zhenyu Wang
On 2021.04.22 10:58:10 -0300, Jason Gunthorpe wrote: > On Thu, Apr 22, 2021 at 03:35:33PM +0200, Arnd Bergmann wrote: > > From: Arnd Bergmann > > > > The Kconfig dependency is incomplete since DRM_I915_GVT is a 'bool' > > symbol that depends on the 'tristate' VFIO_MDEV. This allows a > >

Re: [PATCH] drm/i915/gvt: Fix error code in intel_gvt_init_device()

2021-04-15 Thread Zhenyu Wang
zero/success. The fix is to modify it to return zero > or negative error codes and make everything consistent. > > Fixes: c5d71cb31723 ("drm/i915/gvt: Move vGPU type related code into gvt > file") > Signed-off-by: Dan Carpenter > --- Reviewed-by: Zhenyu Wang Thanks, Dan

Re: [PATCH] drm/i915/gvt: remove useless function

2021-04-14 Thread Zhenyu Wang
ry, unsigned long index) > -{ > - _ppgtt_set_root_entry(mm, entry, index, true); > -} > - > static inline void ppgtt_set_shadow_root_entry(struct intel_vgpu_mm *mm, > struct intel_gvt_gtt_entry *entry, unsigned long index) > { > -- Reviewed-by: Zhenyu Wan

Re: [PATCH v2 16/18] vfio/gvt: Use mdev_get_type_group_id()

2021-04-12 Thread Zhenyu Wang
evin Tian > Reviewed-by: Christoph Hellwig > Signed-off-by: Jason Gunthorpe > --- Reviewed-by: Zhenyu Wang For two gvt specific changes in this series, it's better to just merge through vfio tree. Thanks > drivers/gpu/drm/i915/gvt/gvt.c | 24 +++- > d

Re: [Intel-gfx] [PATCH v2 15/18] vfio/gvt: Make DRM_I915_GVT depend on VFIO_MDEV

2021-04-12 Thread Zhenyu Wang
+++ b/drivers/gpu/drm/i915/Kconfig > @@ -101,6 +101,7 @@ config DRM_I915_GVT > bool "Enable Intel GVT-g graphics virtualization host support" > depends on DRM_I915 > depends on 64BIT > + depends on VFIO_MDEV > default n > help >

Re: [Intel-gfx] [PATCH 15/18] vfio/gvt: Make DRM_I915_GVT depend on VFIO_MDEV

2021-03-29 Thread Zhenyu Wang
On 2021.03.23 16:39:36 -0300, Jason Gunthorpe wrote: > On Tue, Mar 23, 2021 at 08:26:30PM +0100, Christoph Hellwig wrote: > > On Tue, Mar 23, 2021 at 02:55:32PM -0300, Jason Gunthorpe wrote: > > > Ideally all of this would be moved to kvmgt.c, but it is entangled with > > > the rest of the

Re: [PATCH] drivers: gnu: drm: i915: gvt: Fixed couple of spellings in the file gtt.c

2021-02-28 Thread Zhenyu Wang
On 2021.02.22 06:22:37 -0800, Randy Dunlap wrote: > On 2/22/21 6:21 AM, Randy Dunlap wrote: > > On 2/22/21 12:18 AM, Bhaskar Chowdhury wrote: > >> > >> s/negtive/negative/ > >> s/possilbe/possible/ > >> > >> Signed-off-by: Bhaskar Chowdhury > > > > Acked-by: Randy Dunlap > > except the Subject

Re: [PATCH] drm/i915/gvt/kvmgt: Fix the build failure in kvmgt.

2021-02-08 Thread Zhenyu Wang
On 2021.02.09 02:52:10 +0800, Yu Zhang wrote: > Previously, commit 531810caa9f4 ("KVM: x86/mmu: Use > an rwlock for the x86 MMU") replaced KVM's mmu_lock > with type rwlock_t. This will cause a build failure > in kvmgt, which uses the same lock when trying to add/ > remove some GFNs to/from the

Re: [PATCH] drm/i915/gvt: fix uninitialized return in intel_gvt_update_reg_whitelist()

2021-01-25 Thread Zhenyu Wang
On 2021.01.25 09:44:53 +, Chris Wilson wrote: > Quoting Dan Carpenter (2021-01-25 08:48:30) > > Smatch found an uninitialized variable bug in this code: > > > > drivers/gpu/drm/i915/gvt/cmd_parser.c:3191 > > intel_gvt_update_reg_whitelist() > > error: uninitialized symbol 'ret'. > >

Re: [PATCH] drm/i915/gvt: return error when failing to take the module reference

2020-11-12 Thread Zhenyu Wang
mdev core doesn't take >* a reference for vendor driver. >*/ > - if (!try_module_get(THIS_MODULE)) > + if (!try_module_get(THIS_MODULE)) { > + ret = -ENODEV; > goto undo_group; > + } > > ret = kvmgt_guest_init(mdev); &g

Re: [PATCH] drm/i915/gvt: replace idr_init() by idr_init_base()

2020-11-10 Thread Zhenyu Wang
t;dmabuf_lock); > INIT_LIST_HEAD(>dmabuf_obj_list_head); > INIT_RADIX_TREE(>page_track_tree, GFP_KERNEL); > - idr_init(>object_idr); > + idr_init_base(>object_idr, 1); > intel_vgpu_init_cfg_space(vgpu, param->primary); > vgpu->d3_ent

Re: [Intel-gfx][PATCH v2] drm/i915/gvt: Prevent NULL pointer dereference in intel_vgpu_reg_rw_edid()

2020-09-10 Thread Zhenyu Wang
} else { > pos -= EDID_BLOB_OFFSET; Thanks for reporting this! Sorry that we failed to do sanity validation on older platform when enabling vfio edid function for all platform. Could you try below one to see if it fixes your problem? Instead of refusing possible read of edid,

Re: [PATCH] drm/i915/gvt: print actionable error message when gm runs out

2020-06-04 Thread Zhenyu Wang
ut what actions a user can > take to resolve this situation. > > Cc: Thomas Prescher > Cc: Zhenyu Wang > Signed-off-by: Julian Stecklina > --- > drivers/gpu/drm/i915/gvt/aperture_gm.c | 9 ++--- > 1 file changed, 6 insertions(+), 3 deletions(-) > > diff --git

Re: [PATCH] drm/i915/gvt: Use ARRAY_SIZE for vgpu_types

2020-05-19 Thread Zhenyu Wang
On 2020.05.18 22:00:52 +0100, Chris Wilson wrote: > Quoting Aishwarya Ramakrishnan (2020-05-18 16:03:36) > > Prefer ARRAY_SIZE instead of using sizeof > > > > Fixes coccicheck warning: Use ARRAY_SIZE > > > > Signed-off-by: Aishwarya Ramakrishnan > Reviewed-by: Chris Wilson Applied, thanks!

Re: [PATCH] drm/i915: Mark check_shadow_context_ppgtt as maybe unused

2020-05-18 Thread Zhenyu Wang
context *c, struct > intel_vgpu_mm *m) > { > if (m->ppgtt_mm.root_entry_type == GTT_TYPE_PPGTT_ROOT_L4_ENTRY) { > > base-commit: bdecf38f228bcca73b31ada98b5b7ba1215eb9c9 Thanks for the fix! Acked-by: Zhenyu Wang I'll pick up for gvt-next-fixes pull. -- Open Source Technology Center, Intel ltd. $gpg --k

Re: [PATCH 2/2] drm/i915: remove gvt/Makefile

2020-04-09 Thread Zhenyu Wang
On 2020.04.10 00:58:16 +0300, Jani Nikula wrote: > On Fri, 10 Apr 2020, Masahiro Yamada wrote: > > Including subdirectory Makefile from the driver main Makefile does not > > buy us much because this is not real isolation. > > The isolation it does buy us is that gvt/ subdirectory is developed

Re: [Intel-gfx] [PATCH v7 0/8] drm: Introduce struct drm_device based WARN* and use them in i915

2020-02-24 Thread Zhenyu Wang
On 2020.02.24 13:11:05 +0200, Jani Nikula wrote: > On Mon, 24 Feb 2020, Zhenyu Wang wrote: > > On 2020.02.23 18:09:35 +0200, Jani Nikula wrote: > >> On Thu, 20 Feb 2020, Pankaj Bharadiya > >> wrote: > >> > drm/i915/gvt: Make WARN* drm specific where drm_

Re: [Intel-gfx] [PATCH v7 0/8] drm: Introduce struct drm_device based WARN* and use them in i915

2020-02-24 Thread Zhenyu Wang
tches, pushed everything except these, which are for > Zhenyu & Zhi. > For GVT changes. Acked-by: Zhenyu Wang Please also cc intel-gvt-dev list in future for gvt change. Thanks! -- Open Source Technology Center, Intel ltd. $gpg --keyserver wwwkeys.pgp.net --recv-keys 4D781827 signat

Re: [PATCH v2 RESEND] drm/i915/gvt: make gvt oblivious of kvmgt data structures

2020-02-18 Thread Zhenyu Wang
> Signed-off-by: Julian Stecklina > Acked-by: Zhenyu Wang > --- > drivers/gpu/drm/i915/gvt/gvt.h | 32 +--- > drivers/gpu/drm/i915/gvt/kvmgt.c | 287 +++ > 2 files changed, 184 insertions(+), 135 deletions(-) > > diff --git a/drivers/gpu/dr

Re: [PATCH] drm/i915/gvt: more locking for ppgtt mm LRU list

2020-02-09 Thread Zhenyu Wang
;vgpu->gvt->gtt.ppgtt_mm_lock); > + > invalidate_ppgtt_mm(mm); > } else { > vfree(mm->ggtt_mm.virtual_ggtt); > -- Thanks for the fix! Reviewed-by: Zhenyu Wang -- Open Source Technology Center, Intel ltd. $gpg --keyserver wwwkeys.pgp.net --recv

Re: [PATCH] drm/i915/gvt: fix high-order allocation failure on late load

2020-01-22 Thread Zhenyu Wang
_space = mem; > > - mem = kmalloc(info->mmio_size, GFP_KERNEL); > + mem = vmalloc(info->mmio_size); > if (!mem) { > kfree(path); > kfree(firmware->cfg_space); > -- > 2.7.4 > Looks fine to me. Thanks! Reviewed-by: Zhenyu Wan

Re: [RFC PATCH 1/4] drm/i915/gvt: make gvt oblivious of kvmgt data structures

2020-01-19 Thread Zhenyu Wang
On 2020.01.20 14:22:10 +0800, Zhenyu Wang wrote: > On 2020.01.09 19:13:54 +0200, Julian Stecklina wrote: > > Instead of defining KVMGT per-device state in struct intel_vgpu > > directly, add an indirection. This makes the GVT code oblivious of > > what stat

Re: [RFC PATCH 2/4] drm/i915/gvt: remove unused vblank_done completion

2020-01-19 Thread Zhenyu Wang
On 2020.01.09 19:13:55 +0200, Julian Stecklina wrote: > This variable is used nowhere, so remove it. > > Cc: Zhenyu Wang > > Signed-off-by: Julian Stecklina > --- Thanks for catching this. Acked-by: Zhenyu Wang > drivers/gpu/drm/i915/gvt/gvt.h | 2 -- > drivers/

Re: [RFC PATCH 1/4] drm/i915/gvt: make gvt oblivious of kvmgt data structures

2020-01-19 Thread Zhenyu Wang
ssible to build > hypervisor backends for the mediator, without having to touch the > mediator itself. This is a first step. > > Cc: Zhenyu Wang > > Signed-off-by: Julian Stecklina > --- Acked-by: Zhenyu Wang > drivers/gpu/drm/i915/gvt/gvt.h | 32 +--- &g

Re: [RFC PATCH 4/4] drm/i915/gvt: move public gvt headers out into global include

2020-01-16 Thread Zhenyu Wang
On 2020.01.16 15:13:01 +0100, Julian Stecklina wrote: > Hi Greg, Christoph, > > On Wed, 2020-01-15 at 16:22 +0100, Greg KH wrote: > > On Thu, Jan 09, 2020 at 07:13:57PM +0200, Julian Stecklina wrote: > > > Now that the GVT interface to hypervisors does not depend on i915/GVT > > > internals

Re: [PATCH 1/3] drm/i915/gvt: fix file paths in documentation

2020-01-06 Thread Zhenyu Wang
On 2020.01.06 16:06:20 +0200, Julian Stecklina wrote: > The documentation had some stale paths to i915 graphics virtualization > code. Fix them to point to existing files. > > Cc: Zhenyu Wang > Cc: zhiyuan...@intel.com > Cc: hang.y...@intel.com > > Signed-

Re: [PATCH] drm/i915: Remove unneeded semicolon

2019-12-16 Thread Zhenyu Wang
/gtt.c > @@ -1282,7 +1282,7 @@ static int ppgtt_populate_shadow_entry(struct > intel_vgpu *vgpu, > return -EINVAL; > default: > GEM_BUG_ON(1); > - }; > + } > > /* direct shadow */ > ret = intel_gvt_hypervisor_dma

Re: [PATCH] drm/i915/gvt: fix dropping obj reference twice

2019-11-06 Thread Zhenyu Wang
id) > file_count(dmabuf->file), > kref_read(>base.refcount)); > > + i915_gem_object_put(obj); > + > return dmabuf_fd; > > out_free_dmabuf: Looks fine to me. Thanks! Reviewed-by: Zhenyu Wang -- Open Source Tec

Re: [PATCH] drm/i915: Use after free in error path in intel_vgpu_create_workload()

2019-08-08 Thread Zhenyu Wang
On 2019.08.08 11:44:21 +0100, Chris Wilson wrote: > Quoting Dan Carpenter (2019-08-08 11:32:36) > > We can't free "workload" until after the printk or it's a use after > > free. > > > > Fixes: 2089a76ade90 ("drm/i915/gvt: Checking workload's gma earlier") > > Signed-off-by: Dan Carpenter > >

Re: [PATCH] i915: gvt: no need to check return value of debugfs_create functions

2019-06-17 Thread Zhenyu Wang
Reviewed-by: Zhenyu Wang > > Because there is no need to check these functions, a number of local > functions can be made to return void to simplify things as nothing can > fail. > > Cc: Zhenyu Wang > Cc: Zhi Wang > Cc: Jani Nikula > Cc: Joonas Lahtinen > Cc:

Re: [PATCH] drm/i915/gvt: remove duplicate entry of trace

2019-06-11 Thread Zhenyu Wang
gpu/drm/i915/i915.ko] undefined! ERROR: "__tracepoint_oos_change" [drivers/gpu/drm/i915/i915.ko] undefined! scripts/Makefile.modpost:91: recipe for target '__modpost' failed Looks we need fix like below. Subject: [PATCH] drm/i915/gvt: remove duplicate include of trace.h This removes du

Re: Local Display Direct Flip Feature Discussion

2018-12-20 Thread Zhenyu Wang
On 2018.12.20 12:33:35 +0100, Gerd Hoffmann wrote: > On Thu, Dec 20, 2018 at 08:45:09AM +, Zhang, Tina wrote: > > > > > > > -Original Message- > > > From: intel-gvt-dev [mailto:intel-gvt-dev-boun...@lists.freedesktop.org] > > > On > > > Behalf Of Gerd Hoffmann > > > Sent: Wednesday,

Re: [PATCH] drm/i915/gvt: fix spelling mistake "Interupts" -> "Interrupts"

2018-11-29 Thread Zhenyu Wang
On 2018.11.25 23:25:24 +, Colin King wrote: > From: Colin Ian King > > There is a spelling mistake in an error message, fix it. > > Signed-off-by: Colin Ian King > --- > drivers/gpu/drm/i915/gvt/interrupt.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git

Re: Possible use_mm() mis-uses

2018-08-23 Thread Zhenyu Wang
t_not_zero. > yeah, that's the clear way to fix this imo. We only depend on guest life cycle to access guest memory properly. Here's proposed fix, will verify and integrate it later. Thanks! From 5e5a8d0409aa150884adf5a4d0b956fd0b9906b3 Mon Sep 17 00:00:00 2001 From: Zhenyu Wang Date: Thu, 23 Aug 2018 14:08:06

Re: [PATCH] drm/i915/gvt: fix memory leak in intel_vgpu_ioctl()

2018-08-08 Thread Zhenyu Wang
On 2018.08.03 08:41:19 +0800, Yi Wang wrote: > The 'sparse' variable may leak when return in function > intel_vgpu_ioctl(), and this patch fixes this. > > Signed-off-by: Yi Wang > Reviewed-by: Jiang Biao > --- > drivers/gpu/drm/i915/gvt/kvmgt.c | 3 +++ > 1 file changed, 3 insertions(+) > >

Re: [PATCH] drm/i915/kvmgt: Fix potential Spectre v1

2018-08-06 Thread Zhenyu Wang
On 2018.08.02 22:40:19 -0500, Gustavo A. R. Silva wrote: > info.index can be indirectly controlled by user-space, hence leading > to a potential exploitation of the Spectre variant 1 vulnerability. > > This issue was detected with the help of Smatch: > > drivers/gpu/drm/i915/gvt/kvmgt.c:1232

Re: [PATCH] drm/i915/gvt: fix memory leak in intel_vgpu_ioctl()

2018-08-02 Thread Zhenyu Wang
On 2018.08.03 08:41:19 +0800, Yi Wang wrote: > The 'sparse' variable may leak when return in function > intel_vgpu_ioctl(), and this patch fixes this. > > Signed-off-by: Yi Wang > Reviewed-by: Jiang Biao > --- Looks fine to me, will queue this up. Thanks for the patch! >

Re: [PATCH] drm/i915/gvt/scheduler: Remove unnecessary NULL checks in sr_oa_regs

2018-03-22 Thread Zhenyu Wang
On 2018.03.22 21:31:33 +, Chris Wilson wrote: > Quoting Gustavo A. R. Silva (2018-03-22 18:21:54) > > The checks are misleading and not required [1]. > > > > [1] https://lkml.org/lkml/2018/3/19/1792 > > > > Addresses-Coverity-ID: 1466017 > > Cc: Chris Wilson > >

Re: [PATCH v3] drm/i915/gvt: throw error on unhandled vfio ioctls

2018-03-21 Thread Zhenyu Wang
On 2018.03.21 09:44:32 -0600, Alex Williamson wrote: > On Wed, 21 Mar 2018 15:08:47 +0100 > Gerd Hoffmann wrote: > > > On unknown/unhandled ioctls the driver should return an error, so > > userspace knows it tried to use something unsupported. > > > > Cc:

Re: [PATCH][drm-next] drm/i915/gvt: fix spelling mistake: "destoried" -> "destroyed"

2018-03-12 Thread Zhenyu Wang
On 2018.03.12 12:43:58 +0100, Colin King wrote: > From: Colin Ian King > > Trivial fix to spelling mistake in gvt_err error message text. > > Signed-off-by: Colin Ian King > --- Thanks Colin, will pick up. > drivers/gpu/drm/i915/gvt/gtt.c

Re: [PATCH] drm/i915/gvt/fb_decoder: Fix out-of-bounds read

2017-12-11 Thread Zhenyu Wang
On 2017.12.09 00:37:59 -0600, Gustavo A. R. Silva wrote: > In case function skl_format_to_drm returns -EINVAL, fmt turns into a huge > number as fmt is of type u32, hence there is an out-of-bounds read when > using fmt as an index for array skl_pixel_formats at line 225: > plane->bpp =

Re: linux-next: Signed-off-by missing for commits in the drm tree

2017-12-03 Thread Zhenyu Wang
On 2017.12.04 10:57:35 +1100, Stephen Rothwell wrote: > Hi all, > > There is a series of commits > > 54cff6479fd8 - c1802534e5a6 > (not all in that range) > > that are missing a Signed-off-by from their committer. > They were originally committed by Zhi himself, but I had to rebase onto

Re: [PATCH][drm-next] drm/i915/gvt: ensure -ve return value is handled correctly

2017-09-20 Thread Zhenyu Wang
On 2017.09.19 19:35:23 -0700, Joe Perches wrote: > On Wed, 2017-09-20 at 05:46 +0800, Zhenyu Wang wrote: > > On 2017.09.19 16:55:34 +0100, Colin King wrote: > > > From: Colin Ian King <colin.k...@canonical.com> > > > > > > An earlier fix changed

Re: [PATCH][drm-next] drm/i915/gvt: ensure -ve return value is handled correctly

2017-09-19 Thread Zhenyu Wang
On 2017.09.19 16:55:34 +0100, Colin King wrote: > From: Colin Ian King > > An earlier fix changed the return type from find_bb_size however the > integer return is being assigned to a unsigned int so the -ve error > check will never be detected. Make bb_size an int to

Re: [PATCH v2 1/3] drm/i915/gvt: Add framebuffer decoder support

2017-07-16 Thread Zhenyu Wang
On 2017.07.17 11:06:24 +0800, Tina Zhang wrote: > Framebuffer decoder returns guest framebuffer information. > Guest framebuffer includes primary, cursor and sprite plane. > > Signed-off-by: Xiaoguang Chen > Signed-off-by: Tina Zhang > --- >

Re: [PATCH] drm/i915/gvt: remove redundant -Wall

2017-05-31 Thread Zhenyu Wang
On 2017.05.21 00:15:27 -0700, Nick Desaulniers wrote: > This flag is already set in the top level Makefile of the kernel. > > Also, by having set CONFIG_DRM_I915_GVT, thereby appending -Wall to > ccflags, you undo all the -Wno-* cflags previously set in the Make > variable KBUILD_CFLAGS. > > For

Re: [PATCH] drm/i915: prevent generating unusable gvt build which no mpt module is selected

2017-05-24 Thread Zhenyu Wang
On 2017.05.24 16:50:39 +0800, changbin...@intel.com wrote: > From: Changbin Du > > At least we need one MPT module (currently only have one) selected > to get GVTg functional. When GVTg is enabled while no MPT selected, > the build just includes useless GVTg code. This

Re: [PATCH] drm/i915/gvt: fix typo: "supporte" -> "support"

2017-04-27 Thread Zhenyu Wang
On 2017.04.25 10:05:12 +0100, Colin King wrote: > From: Colin Ian King > > trivial fix to typo in WARN_ONCE message > > Signed-off-by: Colin Ian King > --- > drivers/gpu/drm/i915/gvt/handlers.c | 2 +- > 1 file changed, 1 insertion(+), 1

Re: [PATCH] drm/i915: disable KASAN for handlers

2017-03-31 Thread Zhenyu Wang
;jsl...@suse.cz> > Cc: Martin Liska <mli...@suse.cz> > Cc: Zhenyu Wang <zhen...@linux.intel.com> > Cc: Zhi Wang <zhi.a.w...@intel.com> > Cc: Daniel Vetter <daniel.vet...@intel.com> > Cc: Jani Nikula <jani.nik...@linux.intel.com> > Cc: David Airlie &

Re: [PATCH] drm/i915/kvmgt: avoid dereferencing a potentially null info pointer

2017-03-23 Thread Zhenyu Wang
On 2017.03.23 14:43:44 +0100, Frans Klaver wrote: > On Thu, Mar 23, 2017 at 1:22 PM, Colin King wrote: > > From: Colin Ian King > > > > info is being checked to see if it is a null pointer, however, vpgu is > > dereferencing info before this

Re: [Intel-gfx] [patch v2] drm/i915/gvt/kvmgt: remove some dead code

2017-02-08 Thread Zhenyu Wang
On 2017.02.08 14:49:22 +0200, Joonas Lahtinen wrote: > On ti, 2017-02-07 at 17:53 +0300, Dan Carpenter wrote: > > "caps.buf" is always NULL here and "caps.size" is always zero.  The code > > is a no-op and can be removed. > > > > Signed-off-by: Dan Carpenter > >

Re: [igvt-g-dev] [PATCH] drm/i915/gvt: Fix kmem_cache_create() name

2017-01-24 Thread Zhenyu Wang
On 2017.01.24 13:15:43 -0700, Alex Williamson wrote: > According to kmem_cache_sanity_check(), spaces are not allowed in the > name of a cache and results in a kernel oops with CONFIG_DEBUG_VM. > Convert to underscores. > > Signed-off-by: Alex Williamson > --- Will

Re: [igvt-g-dev] [PATCH] drm/i915/gvt/kvmgt: mdev ABI is available_instances, not available_instance

2017-01-24 Thread Zhenyu Wang
On 2017.01.24 12:53:45 -0700, Alex Williamson wrote: > Per the ABI specification[1], each mdev_supported_types entry should > have an available_instances, with an "s", not available_instance. > > [1] Documentation/ABI/testing/sysfs-bus-vfio-mdev > > Signed-off-by: Alex Williamson

  1   2   >