[Intel-gfx] misc vgaarb cleanups

2021-07-16 Thread Christoph Hellwig
Hi all, this series cleans up a bunch of lose ends in the vgaarb code. Diffstat: drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 11 +- drivers/gpu/drm/drm_irq.c |4 drivers/gpu/drm/i915/display/intel_vga.c |9 +- drivers/gpu/drm/nouveau/nouveau_vga.c |8 -

[Intel-gfx] [PATCH 2/7] vgaarb: remove vga_conflicts

2021-07-16 Thread Christoph Hellwig
vga_conflicts only has a single caller and none of the arch overrides mentioned in the comment. Just remove it and the thus dead check in the caller. Signed-off-by: Christoph Hellwig --- drivers/gpu/vga/vgaarb.c | 6 -- include/linux/vgaarb.h | 12 2 files changed, 18

[Intel-gfx] [PATCH 1/7] vgaarb: remove VGA_DEFAULT_DEVICE

2021-07-16 Thread Christoph Hellwig
The define is entirely unused. Signed-off-by: Christoph Hellwig --- include/linux/vgaarb.h | 6 -- 1 file changed, 6 deletions(-) diff --git a/include/linux/vgaarb.h b/include/linux/vgaarb.h index dc6ddce92066..26ec8a057d2a 100644 --- a/include/linux/vgaarb.h +++ b/include/linux/vgaarb.h

[Intel-gfx] [PATCH 4/7] vgaarb: cleanup vgaarb.h

2021-07-16 Thread Christoph Hellwig
Merge the different CONFIG_VGA_ARB ifdef blocks, remove superflous externs, and regularize the stubs for !CONFIG_VGA_ARB. Signed-off-by: Christoph Hellwig --- include/linux/vgaarb.h | 90 -- 1 file changed, 42 insertions(+), 48 deletions(-) diff --git

[Intel-gfx] [PATCH 3/7] vgaarb: move the kerneldoc for vga_set_legacy_decoding to vgaarb.c

2021-07-16 Thread Christoph Hellwig
Kerneldoc comments should be at the implementation side, not in the header just declaring the prototype. Signed-off-by: Christoph Hellwig --- drivers/gpu/vga/vgaarb.c | 11 +++ include/linux/vgaarb.h | 13 - 2 files changed, 11 insertions(+), 13 deletions(-) diff --git

[Intel-gfx] [PATCH 5/7] vgaarb: provide a vga_client_unregister wrapper

2021-07-16 Thread Christoph Hellwig
Add a trivial wrapper for the unregister case that sets all fields to NULL. Signed-off-by: Christoph Hellwig --- drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 2 +- drivers/gpu/drm/drm_irq.c | 4 ++-- drivers/gpu/drm/i915/display/intel_vga.c | 2 +- drivers/gpu/drm/nouveau

[Intel-gfx] [PATCH 7/7] vgaarb: don't pass a cookie to vga_client_register

2021-07-16 Thread Christoph Hellwig
The VGA arbitration is entirely based on pci_dev structures, so just pass that back to the set_vga_decode callback. Signed-off-by: Christoph Hellwig --- drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 9 drivers/gpu/drm/i915/display/intel_vga.c | 7 --- drivers/gpu/drm/nouveau

[Intel-gfx] [PATCH 6/7] vgaarb: remove the unused irq_set_state argument to vga_client_register

2021-07-16 Thread Christoph Hellwig
All callers pass NULL as the irq_set_state argument, so remove it and the ->irq_set_state member in struct vga_device. Signed-off-by: Christoph Hellwig --- drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 2 +- drivers/gpu/drm/i915/display/intel_vga.c | 2 +- drivers/gpu/drm/nouv

Re: [Intel-gfx] [PATCH RFC 0/3] MAP_POPULATE for device memory

2022-03-06 Thread Christoph Hellwig
On Sun, Mar 06, 2022 at 11:33:02AM +, Matthew Wilcox wrote: > On Sun, Mar 06, 2022 at 07:32:04AM +0200, Jarkko Sakkinen wrote: > > For device memory (aka VM_IO | VM_PFNMAP) MAP_POPULATE does nothing. Allow > > to use that for initializing the device memory by providing a new callback > >

Re: [Intel-gfx] [PATCH RFC 0/3] MAP_POPULATE for device memory

2022-03-07 Thread Christoph Hellwig
On Mon, Mar 07, 2022 at 03:29:35PM +0200, Jarkko Sakkinen wrote: > So what would you suggest to sort out the issue? I'm happy to go with > ioctl if nothing else is acceptable. PLenty of drivers treat all mmaps as if MAP_POPULATE was specified, typically by using (io_)remap_pfn_range. If there

Re: [Intel-gfx] [PATCH v6 1/3] i915/gvt: Introduce the mmio table to support VFIO new mdev API

2022-03-15 Thread Christoph Hellwig
Just curious, what is the state of this seris? It would be good to have it ready early on for the next merge window as there is quite a backlog that depends on it.

Re: [Intel-gfx] [PATCH v6 1/3] i915/gvt: Introduce the mmio table to support VFIO new mdev API

2022-03-15 Thread Christoph Hellwig
On Tue, Mar 15, 2022 at 10:46:53AM +0200, Jani Nikula wrote: > On Tue, 15 Mar 2022, Christoph Hellwig wrote: > > Just curious, what is the state of this seris? It would be good to > > have it ready early on for the next merge window as there is quite > > a backlog that depe

Re: [Intel-gfx] [PATCH] Kbuild: remove -std=gnu89 from compiler arguments

2022-02-28 Thread Christoph Hellwig
Mark actually has a tree that switches to gnu99 with a lot of the issues already sortd out and keeping sane default for things like the absolutely horrible declarations in the middle of code here:

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

2022-03-28 Thread Christoph Hellwig
On Fri, Mar 25, 2022 at 01:52:49PM -0400, Zhi Wang wrote: > > v7: > > - Keep the marcos of device generation in GVT-g. (Christoph, Jani) The changelog go under the "---" line (also for the other patches). Otherwise looks good: Reviewed-by: Christoph Hellwig

Re: [Intel-gfx] [PATCH v7 2/3] i915/gvt: Save the initial HW state snapshot in i915

2022-03-28 Thread Christoph Hellwig
Looks good: Reviewed-by: Christoph Hellwig

Re: [Intel-gfx] [PATCH v7 3/3] i915/gvt: Use the initial HW state snapshot saved in i915

2022-03-28 Thread Christoph Hellwig
Looks good: Reviewed-by: Christoph Hellwig

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

2022-03-31 Thread Christoph Hellwig
On Thu, Mar 31, 2022 at 08:04:04AM +, Wang, Zhi A wrote: > Hi Chris: > > Thanks for the testing. Can you attach the dmesg? I tested mostly on my > skylake desktop with some 3D workload. Sure, I should have done that from the beginning: [ 25.354587] vfio_mdev

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

2022-03-31 Thread Christoph Hellwig
igs are also attached. commit 659b61b08dc3c66228a9dd139068bf2ca5096e13 Author: Christoph Hellwig Date: Thu Mar 31 09:17:09 2022 +0200 fix diff --git a/drivers/gpu/drm/i915/intel_gvt_mmio_table.c b/drivers/gpu/drm/i915/intel_gvt_mmio_table.c index 40b844eb07263..007b965067ea1 100644 --- a/dri

Re: [Intel-gfx] [PATCH v8 3/3] i915/gvt: Use the initial HW state snapshot saved in i915

2022-04-01 Thread Christoph Hellwig
This version still seems unhappy (same hardware as the last report): [ 38.650768] vfio_mdev 6814f392-50ac-4236-ae3d-26d472fd8aae: Adding to iommu group 0 [ 38.880317] L1TF CPU bug present and SMT on, data leak possible. See CVE-2018-3646 and

Re: [Intel-gfx] [PATCH 2/3] i915/gvt: save the initial HW state snapshot in i915.

2022-01-30 Thread Christoph Hellwig
On Thu, Jan 27, 2022 at 07:05:07AM -0500, Zhi Wang wrote: > +static void save_mmio(struct intel_gvt_mmio_table_iter *iter, u32 offset, > + u32 size) > +{ > + struct drm_i915_private *dev_priv = iter->i915; > + void *mmio = iter->data; > + u32 start, end, i; > + > +

Re: [Intel-gfx] [PATCH 1/3] i915/gvt: Introduce the mmio_table.c to support VFIO new mdev API

2022-01-30 Thread Christoph Hellwig
> ifeq ($(CONFIG_DRM_I915_GVT),y) > -i915-y += intel_gvt.o > +i915-y += intel_gvt.o gvt/mmio_table.o With the split from my series in mind that builds all of the gvt/ subdirectory into a separate module I'd be tempted to places this new file into the main i915 directory as e.g.

Re: [Intel-gfx] [PATCH v6 1/3] i915/gvt: Introduce the mmio table to support VFIO new mdev API

2022-02-08 Thread Christoph Hellwig
On Tue, Feb 08, 2022 at 05:15:00PM +0200, Jani Nikula wrote: > > #ifdef CONFIG_DRM_I915_GVT > > + > > +#define D_BDW (1 << 0) > > +#define D_SKL (1 << 1) > > +#define D_KBL (1 << 2) > > +#define D_BXT (1 << 3) > > +#define D_CFL (1 << 4) > > + > > +#define D_GEN9PLUS (D_SKL

Re: [Intel-gfx] [PATCH v6 2/3] i915/gvt: Save the initial HW state snapshot in i915

2022-02-08 Thread Christoph Hellwig
On Tue, Feb 08, 2022 at 06:11:50AM -0500, Zhi Wang wrote: > + struct drm_i915_private *dev_priv = iter->i915; > + u32 *mmio, i; > + > + for (i = offset; i < offset + size; i += 4) { > + mmio = iter->data + i; > + *mmio =

Re: [Intel-gfx] [PATCH v6 3/3] i915/gvt: Use the initial HW state snapshot saved in i915

2022-02-08 Thread Christoph Hellwig
On Tue, Feb 08, 2022 at 06:11:51AM -0500, Zhi Wang wrote: > The code of saving initial HW state snapshot has been moved into i915. > Let the GVT-g core logic use that snapshot. Looks good: Reviewed-by: Christoph Hellwig

Re: [Intel-gfx] [PATCH v6 1/3] i915/gvt: Introduce the mmio table to support VFIO new mdev API

2022-02-08 Thread Christoph Hellwig
A cover letter with the changelog, the base and maybe a pointer to a git tree would be nice. > +static int handle_mmio_cb(struct intel_gvt_mmio_table_iter *iter, u32 offset, > + u32 device, u32 size) > +{ > + if (size < 1024 || offset ==

Re: [Intel-gfx] [PATCH 1/3] i915/gvt: Introduce the mmio_table.c to support VFIO new mdev API

2022-02-07 Thread Christoph Hellwig
On Mon, Feb 07, 2022 at 08:28:13AM +, Wang, Zhi A wrote: > 1) About having the mmio_table.h, I would like to keep the stuff in a > dedicated header as putting them in intel_gvt.h might needs i915 guys to > maintain it. > 2) The other one is about if we should move the mmio_table.c into i915

Re: [Intel-gfx] [PATCH 1/3] i915/gvt: Introduce the mmio_table.c to support VFIO new mdev API

2022-02-07 Thread Christoph Hellwig
On Mon, Feb 07, 2022 at 06:57:13AM -0500, Zhi Wang wrote: > Hi Christoph and Jani: > > Thanks for the comments. It would be nice that people can achieve a > agreement. I am OK with both of the options and also moving some files into > different folders doesn't needs me to do the full test run

Re: [Intel-gfx] [PATCH 1/3] i915/gvt: Introduce the mmio_table.c to support VFIO new mdev API

2022-01-27 Thread Christoph Hellwig
What tree is this series against? It doesn't seem to apply to Linus' current tree or 5.17-rc1.

Re: [Intel-gfx] [PATCH v4 1/2] i915/gvt: Introduce the mmio_info_table.c to support VFIO new mdev API

2022-01-24 Thread Christoph Hellwig
On Fri, Dec 17, 2021 at 08:52:53AM +, Wang, Zhi A wrote: > Sorry for the late reply as I am supporting the customers recently. I > will refresh this after the christmas. Did you find some time to look into it? Do you want some help?

Re: [Intel-gfx] [PATCH 5/9] vfio: Pass in a struct vfio_device * to vfio_dma_rw()

2022-04-13 Thread Christoph Hellwig
This looks good execept the extern nitpick: Reviewed-by: Christoph Hellwig However I'd move this before the previous patch. More of the explanation there.

Re: [Intel-gfx] [PATCH 3/9] vfio/mdev: Pass in a struct vfio_device * to vfio_pin/unpin_pages()

2022-04-12 Thread Christoph Hellwig
unpin_pages(struct device *dev, unsigned long *user_pfn, > + extern int vfio_unpin_pages(struct vfio_device *vdev, unsigned long > *user_pfn, Please drop the externs when you touch this (also for the actual header). Otherwise looks good: Reviewed-by: Christoph Hellwig

Re: [Intel-gfx] [PATCH 0/9] Make the rest of the VFIO driver interface use vfio_device

2022-04-12 Thread Christoph Hellwig
On Tue, Apr 12, 2022 at 12:53:27PM -0300, Jason Gunthorpe wrote: > There is a conflict with Christoph's gvt rework here: > > https://lore.kernel.org/all/20220411141403.86980-1-...@lst.de/ > > I've organized this so it is independent of Christoph's series, by adding > the temporary

Re: [Intel-gfx] [PATCH 1/9] vfio: Make vfio_(un)register_notifier accept a vfio_device

2022-04-12 Thread Christoph Hellwig
On Tue, Apr 12, 2022 at 12:53:28PM -0300, Jason Gunthorpe wrote: > All callers have a struct vfio_device trivially available, pass it in > directly and avoid calling the expensive vfio_group_get_from_dev(). Instead of bothering the drivers with the notifiers at all, the two notifier_blocks should

Re: [Intel-gfx] [PATCH 6/9] drm/i915/gvt: Add missing module_put() in error unwind

2022-04-12 Thread Christoph Hellwig
On Tue, Apr 12, 2022 at 12:53:33PM -0300, Jason Gunthorpe wrote: > try_module_get() must be undone if kvmgt_guest_init() fails or we leak the > module reference count on the failure path since the close_device op is > never called in this case. > > Fixes: 9bdb073464d6 ("drm/i915/gvt: Change KVMGT

Re: [Intel-gfx] [PATCH 8/9] vfio: Remove dead code

2022-04-13 Thread Christoph Hellwig
Looks good: Reviewed-by: Christoph Hellwig

Re: [Intel-gfx] [PATCH 4/9] drm/i915/gvt: Change from vfio_group_(un)pin_pages to vfio_(un)pin_pages

2022-04-13 Thread Christoph Hellwig
On Tue, Apr 12, 2022 at 12:53:31PM -0300, Jason Gunthorpe wrote: > Use the existing vfio_device versions of vfio_(un)pin_pages(). There is no > reason to use a group interface here, kvmgt has easy access to a > vfio_device. Once this is moved after the vfio_dma_rw, this is the last user of the

Re: [Intel-gfx] [PATCH 9/9] vfio: Remove calls to vfio_group_add_container_user()

2022-04-13 Thread Christoph Hellwig
ever gets the API wrong. Otherwise looks good: Reviewed-by: Christoph Hellwig

[Intel-gfx] [PATCH 23/34] drm/i915/gvt: remove struct intel_gvt_mpt

2022-04-11 Thread Christoph Hellwig
Just call the initializion and exit functions directly and remove this abstraction entirely. Signed-off-by: Christoph Hellwig --- drivers/gpu/drm/i915/gvt/gvt.c | 11 - drivers/gpu/drm/i915/gvt/gvt.h | 12 ++--- drivers/gpu/drm/i915/gvt/hypercall.h | 50

[Intel-gfx] [PATCH 24/34] drm/i915/gvt: remove the extra vfio_device refcounting for dmabufs

2022-04-11 Thread Christoph Hellwig
All the dmabufs are torn down when th VGPU is released, so there is no need for extra refcounting here. Based on an patch from Jason Gunthorpe. Signed-off-by: Christoph Hellwig --- drivers/gpu/drm/i915/gvt/dmabuf.c | 12 drivers/gpu/drm/i915/gvt/gvt.h| 1 - 2 files changed

[Intel-gfx] [PATCH 25/34] drm/i915/gvt: streamline intel_vgpu_create

2022-04-11 Thread Christoph Hellwig
Initialize variables at declaration time, avoid pointless gotos and cater for the fact that intel_gvt_create_vgpu can't return NULL. Signed-off-by: Christoph Hellwig --- drivers/gpu/drm/i915/gvt/kvmgt.c | 28 +--- 1 file changed, 9 insertions(+), 19 deletions(-) diff

[Intel-gfx] [PATCH 26/34] drm/i915/gvt: pass a struct intel_vgpu to the vfio read/write helpers

2022-04-11 Thread Christoph Hellwig
Pass the structure we actually care about instead of deriving it from the mdev_device in the lower level code. Signed-off-by: Christoph Hellwig --- drivers/gpu/drm/i915/gvt/kvmgt.c | 28 ++-- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/drivers/gpu/drm

[Intel-gfx] [PATCH 27/34] drm/i915/gvt: remove kvmgt_guest_{init, exit}

2022-04-11 Thread Christoph Hellwig
Merge these into their only callers. Signed-off-by: Christoph Hellwig --- drivers/gpu/drm/i915/gvt/kvmgt.c | 129 ++- 1 file changed, 60 insertions(+), 69 deletions(-) diff --git a/drivers/gpu/drm/i915/gvt/kvmgt.c b/drivers/gpu/drm/i915/gvt/kvmgt.c index

[Intel-gfx] [PATCH 17/34] drm/i915/gvt: devirtualize ->inject_msi

2022-04-11 Thread Christoph Hellwig
Just open code the MSI injection in a single place instead of going through the method table. Signed-off-by: Christoph Hellwig --- drivers/gpu/drm/i915/gvt/hypercall.h | 1 - drivers/gpu/drm/i915/gvt/interrupt.c | 38 +++- drivers/gpu/drm/i915/gvt/kvmgt.c | 24

[Intel-gfx] [PATCH 18/34] drm/i915/gvt: devirtualize ->is_valid_gfn

2022-04-11 Thread Christoph Hellwig
Just call the code directly and move towards the callers. Signed-off-by: Christoph Hellwig --- drivers/gpu/drm/i915/gvt/gtt.c | 20 ++-- drivers/gpu/drm/i915/gvt/hypercall.h | 1 - drivers/gpu/drm/i915/gvt/kvmgt.c | 17 - drivers/gpu/drm/i915/gvt/mpt.h

[Intel-gfx] [PATCH 19/34] drm/i915/gvt: devirtualize ->gfn_to_mfn

2022-04-11 Thread Christoph Hellwig
Just open code it in the only caller. Signed-off-by: Christoph Hellwig --- drivers/gpu/drm/i915/gvt/gtt.c | 9 + drivers/gpu/drm/i915/gvt/hypercall.h | 1 - drivers/gpu/drm/i915/gvt/kvmgt.c | 16 drivers/gpu/drm/i915/gvt/mpt.h | 14 -- 4

[Intel-gfx] [PATCH 20/34] drm/i915/gvt: devirtualize ->{enable, disable}_page_track

2022-04-11 Thread Christoph Hellwig
Just call the kvmgt functions directly. Signed-off-by: Christoph Hellwig --- drivers/gpu/drm/i915/gvt/gvt.h| 3 +++ drivers/gpu/drm/i915/gvt/hypercall.h | 2 -- drivers/gpu/drm/i915/gvt/kvmgt.c | 6 ++ drivers/gpu/drm/i915/gvt/mpt.h| 28

[Intel-gfx] [PATCH 21/34] drm/i915/gvt: devirtualize ->dma_{, un}map_guest_page

2022-04-11 Thread Christoph Hellwig
Just call the functions directly. Also remove a pointless wrapper. Signed-off-by: Christoph Hellwig --- drivers/gpu/drm/i915/gvt/dmabuf.c| 10 ++ drivers/gpu/drm/i915/gvt/gtt.c | 20 +-- drivers/gpu/drm/i915/gvt/gvt.h | 4 drivers/gpu/drm/i915/gvt

[Intel-gfx] [PATCH 28/34] drm/i915/gvt: convert to use vfio_register_emulated_iommu_dev

2022-04-11 Thread Christoph Hellwig
This is straightforward conversion, the intel_vgpu already has a pointer to the vfio_dev, which can be replaced with the embedded structure and we can replace all the mdev_get_drvdata() with a simple container_of(). Based on an patch from Jason Gunthorpe. Signed-off-by: Christoph Hellwig

[Intel-gfx] [PATCH 29/34] drm/i915/gvt: merge gvt.c into kvmgvt.c

2022-04-11 Thread Christoph Hellwig
The code in both files is deeply interconnected, so merge it and keep a bunch of structures and functions static. Signed-off-by: Christoph Hellwig --- drivers/gpu/drm/i915/gvt/Makefile | 1 - drivers/gpu/drm/i915/gvt/gvt.c| 291 -- drivers/gpu/drm/i915/gvt

[Intel-gfx] [PATCH 31/34] vfio/mdev: Remove mdev_parent_ops dev_attr_groups

2022-04-11 Thread Christoph Hellwig
attribute to go back to any data owned by the device driver. Remove the general mechanism to create this abuse. Signed-off-by: Jason Gunthorpe Signed-off-by: Christoph Hellwig --- drivers/vfio/mdev/mdev_sysfs.c | 12 ++-- include/linux/mdev.h | 2 -- samples/vfio-mdev/mtty.c

[Intel-gfx] [PATCH 32/34] vfio/mdev: Remove mdev_parent_ops

2022-04-11 Thread Christoph Hellwig
From: Jason Gunthorpe The last useful member in this struct is the supported_type_groups, move it to the mdev_driver and delete mdev_parent_ops. Replace it with mdev_driver as an argument to mdev_register_device() Signed-off-by: Jason Gunthorpe Signed-off-by: Christoph Hellwig

[Intel-gfx] [PATCH 33/34] vfio/mdev: Use the driver core to create the 'remove' file

2022-04-11 Thread Christoph Hellwig
because the groups had been co-opted by the mdev driver, now that prior patches have moved the driver's groups to the struct device_driver the dev.group is properly free for use here. Signed-off-by: Jason Gunthorpe Signed-off-by: Christoph Hellwig --- drivers/vfio/mdev/mdev_core.c| 1

[Intel-gfx] [PATCH 30/34] vfio/mdev: Remove vfio_mdev.c

2022-04-11 Thread Christoph Hellwig
-by: Christoph Hellwig --- .../driver-api/vfio-mediated-device.rst | 3 - drivers/vfio/mdev/Makefile| 2 +- drivers/vfio/mdev/mdev_core.c | 40 + drivers/vfio/mdev/mdev_driver.c | 10 -- drivers/vfio/mdev/mdev_private.h

[Intel-gfx] [PATCH 22/34] drm/i915/gvt: devirtualize dma_pin_guest_page

2022-04-11 Thread Christoph Hellwig
Just call the function directly and remove a pointless wrapper. Signed-off-by: Christoph Hellwig --- drivers/gpu/drm/i915/gvt/dmabuf.c| 14 +- drivers/gpu/drm/i915/gvt/gvt.h | 1 + drivers/gpu/drm/i915/gvt/hypercall.h | 2 -- drivers/gpu/drm/i915/gvt/kvmgt.c | 4

[Intel-gfx] [PATCH 34/34] vfio/mdev: Remove mdev drvdata

2022-04-11 Thread Christoph Hellwig
From: Jason Gunthorpe This is no longer used, remove it. All usages were moved over to either use container_of() from a vfio_device or to use dev_drvdata() directly on the mdev. Signed-off-by: Jason Gunthorpe Signed-off-by: Christoph Hellwig --- include/linux/mdev.h | 9 - 1 file

[Intel-gfx] [PATCH 07/34] drm/i915/gvt: remove intel_gvt_ops

2022-04-11 Thread Christoph Hellwig
Remove these pointless indirect alls by just calling the only instance of each method directly. Signed-off-by: Christoph Hellwig --- drivers/gpu/drm/i915/gvt/gvt.c | 20 +-- drivers/gpu/drm/i915/gvt/gvt.h | 24 -- drivers/gpu/drm/i915/gvt/hypercall.h | 2

[Intel-gfx] [PATCH 06/34] drm/i915/gvt: move the gvt code into kvmgt.ko

2022-04-11 Thread Christoph Hellwig
device pointer. Signed-off-by: Christoph Hellwig --- drivers/gpu/drm/i915/Kconfig| 36 ++-- drivers/gpu/drm/i915/Makefile | 2 +- drivers/gpu/drm/i915/gvt/Makefile | 5 +- drivers/gpu/drm/i915/gvt/gvt.c | 55 ++ drivers/gpu/drm/i915/gvt

[Intel-gfx] [PATCH 08/34] drm/i915/gvt: remove the map_gfn_to_mfn and set_trap_area ops

2022-04-11 Thread Christoph Hellwig
The map_gfn_to_mfn and set_trap_area ops are never defined, so remove them and clean up code that depends on them in the callers. Signed-off-by: Christoph Hellwig --- drivers/gpu/drm/i915/gvt/cfg_space.c | 89 ++-- drivers/gpu/drm/i915/gvt/hypercall.h | 4 -- drivers

[Intel-gfx] [PATCH 12/34] drm/i915/gvt: remove vgpu->handle

2022-04-11 Thread Christoph Hellwig
Always pass the actual vgpu structure instead of encoding it as a "handle" and add a bool flag to denote if a VGPU is attached. Signed-off-by: Christoph Hellwig --- drivers/gpu/drm/i915/gvt/gvt.h | 3 +- drivers/gpu/drm/i915/gvt/hypercall.h | 32 +++ drivers/gpu/dr

[Intel-gfx] [PATCH 13/34] drm/i915/gvt: devirtualize ->{read, write}_gpa

2022-04-11 Thread Christoph Hellwig
Just call the VFIO functions directly instead of through the method table. Signed-off-by: Christoph Hellwig --- drivers/gpu/drm/i915/gvt/cmd_parser.c | 4 +-- drivers/gpu/drm/i915/gvt/execlist.c | 12 - drivers/gpu/drm/i915/gvt/gtt.c| 6 ++--- drivers/gpu/drm/i915/gvt/gvt.h

[Intel-gfx] [PATCH 14/34] drm/i915/gvt: devirtualize ->{get, put}_vfio_device

2022-04-11 Thread Christoph Hellwig
Just open code the calls to the VFIO APIs. Signed-off-by: Christoph Hellwig --- drivers/gpu/drm/i915/gvt/dmabuf.c| 12 ++- drivers/gpu/drm/i915/gvt/hypercall.h | 2 -- drivers/gpu/drm/i915/gvt/kvmgt.c | 22 drivers/gpu/drm/i915/gvt/mpt.h | 30

[Intel-gfx] [PATCH 10/34] drm/i915/gvt: merge struct kvmgt_vdev into struct intel_vgpu

2022-04-11 Thread Christoph Hellwig
Move towards having only a single structure for the per-VGPU state. Signed-off-by: Christoph Hellwig --- drivers/gpu/drm/i915/gvt/gvt.h | 31 ++- drivers/gpu/drm/i915/gvt/hypercall.h | 1 - drivers/gpu/drm/i915/gvt/kvmgt.c | 288 ++- drivers/gpu/drm/i915/gvt

[Intel-gfx] [PATCH 11/34] drm/i915/gvt: merge struct kvmgt_guest_info into strut intel_vgpu

2022-04-11 Thread Christoph Hellwig
Consolidate the per-VGPU structures into a single one. Signed-off-by: Christoph Hellwig --- drivers/gpu/drm/i915/gvt/gvt.h | 8 +++ drivers/gpu/drm/i915/gvt/kvmgt.c | 117 --- 2 files changed, 52 insertions(+), 73 deletions(-) diff --git a/drivers/gpu/drm/i915

[Intel-gfx] refactor the i915 GVT support and move to the modern mdev API v3

2022-04-11 Thread Christoph Hellwig
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 GVT code moves out of the main i915 driver and into the kvmgt module.

[Intel-gfx] [PATCH 01/34] drm/i915/gvt: remove module refcounting in intel_gvt_{, un}register_hypervisor

2022-04-11 Thread Christoph Hellwig
THIS_MODULE always is reference when a symbol called by it is used, so don't bother with the additional reference. Signed-off-by: Christoph Hellwig --- drivers/gpu/drm/i915/gvt/gvt.c | 6 -- 1 file changed, 6 deletions(-) diff --git a/drivers/gpu/drm/i915/gvt/gvt.c b/drivers/gpu/drm/i915

[Intel-gfx] [PATCH 02/34] drm/i915/gvt: remove enum hypervisor_type

2022-04-11 Thread Christoph Hellwig
The only supported hypervisor is KVM, so don't bother with dead code enumerating hypervisors. Signed-off-by: Christoph Hellwig --- drivers/gpu/drm/i915/gvt/gvt.c | 17 +-- drivers/gpu/drm/i915/gvt/gvt.h | 1 - drivers/gpu/drm/i915/gvt/hypercall.h | 6 -- drivers/gpu/drm/i915

[Intel-gfx] [PATCH 15/34] drm/i915/gvt: devirtualize ->set_edid and ->set_opregion

2022-04-11 Thread Christoph Hellwig
Just call the code to setup the opregions and EDID data directly. Signed-off-by: Christoph Hellwig --- drivers/gpu/drm/i915/gvt/gvt.h | 3 +++ drivers/gpu/drm/i915/gvt/hypercall.h | 3 --- drivers/gpu/drm/i915/gvt/kvmgt.c | 6 ++ drivers/gpu/drm/i915/gvt/mpt.h | 32

[Intel-gfx] [PATCH 16/34] drm/i915/gvt: devirtualize ->detach_vgpu

2022-04-11 Thread Christoph Hellwig
Just call the function directly. Signed-off-by: Christoph Hellwig --- drivers/gpu/drm/i915/gvt/gvt.h | 1 + drivers/gpu/drm/i915/gvt/hypercall.h | 1 - drivers/gpu/drm/i915/gvt/kvmgt.c | 3 +-- drivers/gpu/drm/i915/gvt/mpt.h | 16 drivers/gpu/drm/i915/gvt

[Intel-gfx] [PATCH 09/34] drm/i915/gvt: remove the unused from_virt_to_mfn op

2022-04-11 Thread Christoph Hellwig
Signed-off-by: Christoph Hellwig --- drivers/gpu/drm/i915/gvt/hypercall.h | 1 - drivers/gpu/drm/i915/gvt/kvmgt.c | 6 -- drivers/gpu/drm/i915/gvt/mpt.h | 12 3 files changed, 19 deletions(-) diff --git a/drivers/gpu/drm/i915/gvt/hypercall.h b/drivers/gpu/drm/i915

[Intel-gfx] [PATCH 04/34] drm/i915/gvt: don't override the include path

2022-04-11 Thread Christoph Hellwig
drivers/gpu/drm/i915/gvt/Makefile is included from drivers/gpu/drm/i915/Makefile and thus inherits the normal include path relative to drivers/gpu/drm/i915/. Fix up the gvt-specific trace header and just do away with the include path manipulation. Signed-off-by: Christoph Hellwig --- drivers

[Intel-gfx] [PATCH 03/34] drm/i915/gvt: rename intel_vgpu_ops to intel_vgpu_mdev_ops

2022-04-11 Thread Christoph Hellwig
Free the intel_vgpu_ops symbol name for something that fits better. Signed-off-by: Christoph Hellwig --- drivers/gpu/drm/i915/gvt/kvmgt.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/i915/gvt/kvmgt.c b/drivers/gpu/drm/i915/gvt/kvmgt.c index

[Intel-gfx] [PATCH 05/34] drm/i915/gvt: cleanup the Makefile

2022-04-11 Thread Christoph Hellwig
Match the style of the main i915 Makefile in the gvt-specfic one and remove the GVT_DIR and GVT_SOURCE variables. Signed-off-by: Christoph Hellwig --- drivers/gpu/drm/i915/gvt/Makefile | 29 +++-- 1 file changed, 23 insertions(+), 6 deletions(-) diff --git a/drivers/gpu

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

2022-04-07 Thread Christoph Hellwig
The whole series looks good and works fine on by Kaby Lake Thinkpad: Reviewed-by: Christoph Hellwig Tested-by: Christoph Hellwig

Re: [Intel-gfx] [PATCH 05/34] drm/i915/gvt: cleanup the Makefile

2022-04-11 Thread Christoph Hellwig
On Mon, Apr 11, 2022 at 07:11:03PM +0300, Jani Nikula wrote: > > Up to you but I usually sort these lists > > Yeah, please do. Otherwise matches what I sent, so ack. Let's just merge your 2 patch series ASAP and I'll rebase on top of that. What branch in drm-intel should I use as the base for

Re: [Intel-gfx] refactor the i915 GVT support and move to the modern mdev API v3

2022-04-13 Thread Christoph Hellwig
On Wed, Apr 13, 2022 at 06:58:47PM +0300, Jani Nikula wrote: > Acked-by: Jani Nikula I've only added this to the i915 patches for now, let me know if you also want me to add it to the vfio/mdev ones.

Re: [Intel-gfx] [PATCH 1/9] vfio: Make vfio_(un)register_notifier accept a vfio_device

2022-04-13 Thread Christoph Hellwig
On Wed, Apr 13, 2022 at 01:18:14PM -0300, Jason Gunthorpe wrote: > Yeah, I was thinking about that too, but on the other hand I think it > is completely wrong that gvt requires kvm at all. A vfio_device is not > supposed to be tightly linked to KVM - the only exception possibly > being s390.. So

Re: [Intel-gfx] [PATCH 2/2] drm/i915/gvt: better align the Makefile with i915 Makefile

2022-04-13 Thread Christoph Hellwig
Looks good: Reviewed-by: Christoph Hellwig

Re: [Intel-gfx] [PATCH 1/2] drm/i915/gvt: fix trace TRACE_INCLUDE_PATH

2022-04-13 Thread Christoph Hellwig
On Wed, Apr 13, 2022 at 03:25:38PM +0300, Jani Nikula wrote: > TRACE_INCLUDE_PATH should be a path relative to define_trace.h, not the > file including it. (See the comment in include/trace/define_trace.h.) Looks good: Reviewed-by: Christoph Hellwig

Re: [Intel-gfx] [PATCH 9/9] vfio: Remove calls to vfio_group_add_container_user()

2022-04-13 Thread Christoph Hellwig
On Wed, Apr 13, 2022 at 11:03:05AM -0300, Jason Gunthorpe wrote: > On Wed, Apr 13, 2022 at 08:11:05AM +0200, Christoph Hellwig wrote: > > On Tue, Apr 12, 2022 at 12:53:36PM -0300, Jason Gunthorpe wrote: > > > + if (WARN_ON(!READ_ONCE(vdev->open_count))) > > > +

Re: [Intel-gfx] [PATCH 0/2] drm/i915/gvt: clean up makefile

2022-04-13 Thread Christoph Hellwig
On Wed, Apr 13, 2022 at 07:04:54PM +0300, Jani Nikula wrote: > > v6: > > - Remove the reference of intel_gvt_device_info.(Christoph) > > - Refine the save_mmio() function. (Christoph) > > > > which don't belong in the commit log. It might be worth to fix that > > before sending a pull request.

Re: [Intel-gfx] [PATCH 0/2] drm/i915/gvt: clean up makefile

2022-04-13 Thread Christoph Hellwig
On Wed, Apr 13, 2022 at 03:25:37PM +0300, Jani Nikula wrote: > This is [1] rebased on gvt-next. (Which means it won't build on CI.) Btw, now that I found that gvt-next branch: Zhi, your commits still have per-commit changelog like: v6: - Remove the reference of

Re: [Intel-gfx] refactor the i915 GVT support and move to the modern mdev API v3

2022-04-13 Thread Christoph Hellwig
On Wed, Apr 13, 2022 at 01:47:05PM +, Wang, Zhi A wrote: > > 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: [Intel-gfx] [PATCH 1/9] vfio: Make vfio_(un)register_notifier accept a vfio_device

2022-04-13 Thread Christoph Hellwig
On Wed, Apr 13, 2022 at 08:39:52AM -0300, Jason Gunthorpe wrote: > I already looked into that for a while, it is a real mess too because > of how the notifiers are used by the current drivers, eg gvt assumes > the notifier is called during its open_device callback to setup its > kvm. gvt very

Re: [Intel-gfx] [PATCH v2 3/7] vfio/mdev: Pass in a struct vfio_device * to vfio_pin/unpin_pages()

2022-04-22 Thread Christoph Hellwig
Nit: why do some of these patches that don't touch the mdev code mdev in the subject?

Re: [Intel-gfx] [PATCH v2 1/7] vfio: Make vfio_(un)register_notifier accept a vfio_device

2022-04-22 Thread Christoph Hellwig
Looks good (for now): Reviewed-by: Christoph Hellwig

Re: [Intel-gfx] [PATCH v2 5/7] drm/i915/gvt: Change from vfio_group_(un)pin_pages to vfio_(un)pin_pages

2022-04-22 Thread Christoph Hellwig
Looks good: Reviewed-by: Christoph Hellwig

Re: [Intel-gfx] [PULL v2] gvt-next

2022-04-20 Thread Christoph Hellwig
On Thu, Apr 21, 2022 at 04:57:34AM +, Wang, Zhi A wrote: > Is it possible that I can send two different pull based on the same branch? > I was thinking I can remove this line in the original patch and then add a > small patch to add this line back on the top. Then make two different tags >

Re: [Intel-gfx] refactor the i915 GVT support and move to the modern mdev API v3

2022-04-20 Thread Christoph Hellwig
On Thu, Apr 14, 2022 at 11:38:59AM -0300, Jason Gunthorpe wrote: > pull requests can flow through more than one tree concurrently. The > purpose of the topic branch is to allow all the commits to be in all > the trees they need to be in at once. > > So you should send this branch as a PR to the

Re: [Intel-gfx] [PATCH v2 3/7] vfio/mdev: Pass in a struct vfio_device * to vfio_pin/unpin_pages()

2022-04-22 Thread Christoph Hellwig
On Fri, Apr 22, 2022 at 05:56:51PM -0300, Jason Gunthorpe wrote: > On Fri, Apr 22, 2022 at 08:22:32AM +0200, Christoph Hellwig wrote: > > Nit: why do some of these patches that don't touch the mdev code > > mdev in the subject? > > I consider these APIs to be 'mdev apis' beca

Re: [Intel-gfx] [PATCH 2/2] x86/pat: add functions to query specific cache mode availability

2022-05-18 Thread Christoph Hellwig
On Tue, May 03, 2022 at 03:22:07PM +0200, Juergen Gross wrote: > Some drivers are using pat_enabled() in order to test availability of > special caching modes (WC and UC-). This will lead to false negatives > in case the system was booted e.g. with the "nopat" variant and the > BIOS did setup the

Re: [Intel-gfx] [PATCH 1/1] vfio: remove VFIO_GROUP_NOTIFY_SET_KVM

2022-05-18 Thread Christoph Hellwig
> if (device->ops->flags & VFIO_DEVICE_NEEDS_KVM) > { Nit: this is not the normal brace placement. But what is you diff against anyway? The one Matthew sent did away with the VFIO_DEVICE_NEEDS_KVM flags, which does the wrong thing for zpci, so it can't be that.. Also if we want to

Re: [Intel-gfx] [PATCH 1/1] vfio: remove VFIO_GROUP_NOTIFY_SET_KVM

2022-05-18 Thread Christoph Hellwig
With this the release_work in gvt can go away as well: diff --git a/drivers/gpu/drm/i915/gvt/gvt.h b/drivers/gpu/drm/i915/gvt/gvt.h index 633acfcf76bf2..aee1a45da74bc 100644 --- a/drivers/gpu/drm/i915/gvt/gvt.h +++ b/drivers/gpu/drm/i915/gvt/gvt.h @@ -227,7 +227,6 @@ struct intel_vgpu {

Re: [Intel-gfx] [PATCH v3 1/1] vfio: remove VFIO_GROUP_NOTIFY_SET_KVM

2022-05-19 Thread Christoph Hellwig
Looks good: Reviewed-by: Christoph Hellwig

[Intel-gfx] susetting the remaining swioltb couplin in DRM

2022-07-11 Thread Christoph Hellwig
Hi i915 and nouveau maintainers, any chance I could get some help to remove the remaining direct driver calls into swiotlb, namely swiotlb_max_segment and is_swiotlb_active. Either should not matter to a driver as they should be written to the DMA API. In the i915 case it seems like the driver

Re: [Intel-gfx] susetting the remaining swioltb couplin in DRM

2022-07-11 Thread Christoph Hellwig
On Mon, Jul 11, 2022 at 04:31:49PM -0400, Rodrigo Vivi wrote: > On Mon, Jul 11, 2022 at 10:26:14AM +0200, Christoph Hellwig wrote: > > Hi i915 and nouveau maintainers, > > > > any chance I could get some help to remove the remaining direct > > driver calls into swiotlb,

Re: [Intel-gfx] [RFT][PATCH v2 4/9] vfio: Pass in starting IOVA to vfio_pin/unpin_pages API

2022-07-06 Thread Christoph Hellwig
> - vfio_unpin_pages(>matrix_mdev->vdev, >saved_pfn, 1); > + vfio_unpin_pages(>matrix_mdev->vdev, q->saved_pfn << > PAGE_SHIFT, 1); Overly long line here. Otherwise looks good: Reviewed-by: Christoph Hellwig

Re: [Intel-gfx] [RFT][PATCH v2 1/9] vfio: Make vfio_unpin_pages() return void

2022-07-06 Thread Christoph Hellwig
gracefully. Otherwise looks good: Reviewed-by: Christoph Hellwig

Re: [Intel-gfx] [RFT][PATCH v2 7/9] vfio: Rename user_iova of vfio_dma_rw()

2022-07-06 Thread Christoph Hellwig
Looks good: Reviewed-by: Christoph Hellwig

Re: [Intel-gfx] [RFT][PATCH v2 9/9] vfio: Replace phys_pfn with pages for vfio_pin_pages()

2022-07-06 Thread Christoph Hellwig
Looks good: Reviewed-by: Christoph Hellwig

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

2022-06-06 Thread Christoph Hellwig
evice *vfio_device = > + container_of(nb, struct vfio_device, iommu_nb); > + struct vfio_iommu_type1_dma_unmap *unmap = data; Using the iommu type 1 UAPI structure in the core vfio code for a subset of its field is kinda weird. But we can fix this later. Otherwise looks good: Reviewed-by: Christoph Hellwig

<    1   2   3   4   5   6   >