[PATCH] vfio: add a singleton check for vfio_group_pin_pages

2020-09-14 Thread Yan Zhao
. Fixes: 95fc87b44104 (vfio: Selective dirty page tracking if IOMMU backed device pins pages) Signed-off-by: Yan Zhao --- drivers/vfio/vfio.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/vfio/vfio.c b/drivers/vfio/vfio.c index 5e6e0511b5aa..2f0fa272ebf2 100644 --- a/drivers/vfio

[PATCH] vfio/type1: fix dirty bitmap calculation in vfio_dma_rw

2020-09-14 Thread Yan Zhao
Signed-off-by: Yan Zhao --- drivers/vfio/vfio_iommu_type1.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/vfio/vfio_iommu_type1.c b/drivers/vfio/vfio_iommu_type1.c index 5fbf0c1f7433..d0438388feeb 100644 --- a/drivers/vfio/vfio_iommu_type1.c +++ b/drivers/vfio/vfio_iom

[PATCH] vfio: fix a missed vfio group put in vfio_pin_pages

2020-09-14 Thread Yan Zhao
when error occurs, need to put vfio group after a successful get. Fixes: 95fc87b44104 (vfio: Selective dirty page tracking if IOMMU backed device pins pages) Signed-off-by: Yan Zhao --- drivers/vfio/vfio.c | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/vfio

Re: [PATCH] vfio: add a singleton check for vfio_group_pin_pages

2020-09-15 Thread Yan Zhao
On Tue, Sep 15, 2020 at 01:30:11PM -0600, Alex Williamson wrote: > On Tue, 15 Sep 2020 13:03:01 -0600 > Alex Williamson wrote: > > > On Tue, 15 Sep 2020 08:30:42 +0800 > > Yan Zhao wrote: > > > > > vfio_pin_pages() and vfio_group_pin_pages() are used purely

Re: [PATCH] vfio: fix a missed vfio group put in vfio_pin_pages

2020-09-15 Thread Yan Zhao
On Tue, Sep 15, 2020 at 11:06:01AM +0200, Cornelia Huck wrote: > On Tue, 15 Sep 2020 08:28:35 +0800 > Yan Zhao wrote: > > > when error occurs, need to put vfio group after a successful get. > > > > Fixes: 95fc87b44104 (vfio: Selective dirty page tracking if IOMMU b

[PATCH v2] vfio: add a singleton check for vfio_group_pin_pages

2020-09-15 Thread Yan Zhao
to only singleton groups such that the IOMMU backend can consider dirty page scope only at the group level. Implement the same requirement for the vfio_group_pin_pages() interface. Fixes: 95fc87b44104 ("vfio: Selective dirty page tracking if IOMMU backed device pins pages") Signed-off-by

[PATCH v2] vfio: fix a missed vfio group put in vfio_pin_pages

2020-09-15 Thread Yan Zhao
when error occurs, need to put vfio group after a successful get. Fixes: 95fc87b44104 ("vfio: Selective dirty page tracking if IOMMU backed device pins pages") Reviewed-by: Cornelia Huck Signed-off-by: Yan Zhao --- v2: updated the format of the Fixes: line. (Cornelia) --- dr

[PATCH v2] vfio/type1: fix dirty bitmap calculation in vfio_dma_rw

2020-09-15 Thread Yan Zhao
;) Signed-off-by: Yan Zhao --- v2: updated the format of the Fixes: line. --- drivers/vfio/vfio_iommu_type1.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/vfio/vfio_iommu_type1.c b/drivers/vfio/vfio_iommu_type1.c index 5fbf0c1f7433..d0438388feeb 100644 --- a/dr

Re: [RFC PATCH v4 07/10] vfio/pci: introduce a new irq type VFIO_IRQ_TYPE_REMAP_BAR_REGION

2020-06-01 Thread Yan Zhao
On Fri, May 29, 2020 at 03:45:47PM -0600, Alex Williamson wrote: > On Sun, 17 May 2020 22:52:45 -0400 > Yan Zhao wrote: > > > This is a virtual irq type. > > vendor driver triggers this irq when it wants to notify userspace to > > remap PCI BARs. > > >

Re: [RFC PATCH v4 07/10] vfio/pci: introduce a new irq type VFIO_IRQ_TYPE_REMAP_BAR_REGION

2020-06-02 Thread Yan Zhao
On Mon, Jun 01, 2020 at 10:43:07AM -0600, Alex Williamson wrote: > On Mon, 1 Jun 2020 02:57:26 -0400 > Yan Zhao wrote: > > > On Fri, May 29, 2020 at 03:45:47PM -0600, Alex Williamson wrote: > > > On Sun, 17 May 2020 22:52:45 -0400 > > > Yan Zhao wrote: >

Re: [RFC PATCH v4 07/10] vfio/pci: introduce a new irq type VFIO_IRQ_TYPE_REMAP_BAR_REGION

2020-06-04 Thread Yan Zhao
On Wed, Jun 03, 2020 at 10:10:58PM -0600, Alex Williamson wrote: > On Wed, 3 Jun 2020 22:42:28 -0400 > Yan Zhao wrote: > > > On Wed, Jun 03, 2020 at 05:04:52PM -0600, Alex Williamson wrote: > > > On Tue, 2 Jun 2020 21:40:58 -0400 > > > Yan Zhao wrote: > >

Re: [RFC PATCH v4 02/10] vfio/pci: macros to generate module_init and module_exit for vendor modules

2020-06-04 Thread Yan Zhao
On Thu, Jun 04, 2020 at 05:01:06PM +0200, Cornelia Huck wrote: > On Sun, 17 May 2020 22:45:10 -0400 > Yan Zhao wrote: > > > vendor modules call macro module_vfio_pci_register_vendor_handler to > > generate module_init and module_exit. > > It is necessary to ensure that

Re: [RFC PATCH v4 04/10] vfio/pci: let vfio_pci know number of vendor regions and vendor irqs

2020-06-04 Thread Yan Zhao
On Thu, Jun 04, 2020 at 05:25:15PM +0200, Cornelia Huck wrote: > On Sun, 17 May 2020 22:49:44 -0400 > Yan Zhao wrote: > > > This allows a simpler VFIO_DEVICE_GET_INFO ioctl in vendor driver > > > > Cc: Kevin Tian > > Signed-off-by: Yan Zhao > &g

Re: [PATCH v5 0/4] introduction of migration_version attribute for VFIO live migration

2020-04-29 Thread Yan Zhao
On Tue, Apr 28, 2020 at 10:14:37PM +0800, Dr. David Alan Gilbert wrote: > * Yan Zhao (yan.y.z...@intel.com) wrote: > > On Mon, Apr 27, 2020 at 11:37:43PM +0800, Dr. David Alan Gilbert wrote: > > > * Yan Zhao (yan.y.z...@intel.com) wrote: > > > > On Sat, Apr 25, 2020

Re: [PATCH v5 0/4] introduction of migration_version attribute for VFIO live migration

2020-04-29 Thread Yan Zhao
On Wed, Apr 29, 2020 at 04:22:01PM +0800, Dr. David Alan Gilbert wrote: > * Yan Zhao (yan.y.z...@intel.com) wrote: > > On Tue, Apr 28, 2020 at 10:14:37PM +0800, Dr. David Alan Gilbert wrote: > > > * Yan Zhao (yan.y.z...@intel.com) wrote: > > > > On Mon, Apr 27, 2020

Re: [PATCH v5 0/4] introduction of migration_version attribute for VFIO live migration

2020-04-29 Thread Yan Zhao
On Wed, Apr 29, 2020 at 05:48:44PM +0800, Dr. David Alan Gilbert wrote: > > > > > > > > > > > > > An mdev type is meant to define a software compatible > > > > > > > > > > > > > interface, so in > > > > > > > > > > > > > the case of mdev->mdev migration, doesn't migrating > > > > > > > > > > >

Re: [PATCH v5 0/4] introduction of migration_version attribute for VFIO live migration

2020-04-29 Thread Yan Zhao
On Wed, Apr 29, 2020 at 10:13:01PM +0800, Eric Blake wrote: > [meta-comment] > > On 4/29/20 4:35 AM, Yan Zhao wrote: > > On Wed, Apr 29, 2020 at 04:22:01PM +0800, Dr. David Alan Gilbert wrote: > [...] > >>>>>>>>>>>>>

Re: [PATCH v4 0/2] introduction of migration_version attribute for VFIO live migration

2019-06-03 Thread Yan Zhao
On Tue, Jun 04, 2019 at 03:29:32AM +0800, Alex Williamson wrote: > On Thu, 30 May 2019 20:44:38 -0400 > Yan Zhao wrote: > > > This patchset introduces a migration_version attribute under sysfs of VFIO > > Mediated devices. > > > > This migration_version att

[RFC PATCH v4 00/10] Introduce vendor ops in vfio-pci

2020-05-17 Thread Yan Zhao
part: https://www.spinics.net/lists/kernel/msg3337337.html. qemu part: https://www.spinics.net/lists/kernel/msg3337337.html. Tina Zhang (1): vfio: Define device specific irq type capability Yan Zhao (9): vfio/pci: register/unregister vfio_pci_vendor_driver_ops vfio/pci: macros to

[RFC PATCH v4 01/10] vfio/pci: register/unregister vfio_pci_vendor_driver_ops

2020-05-17 Thread Yan Zhao
vfio_pci_vendor_driver_ops includes two parts: (1) .probe() and .remove() interface to be called by vfio_pci_probe() and vfio_pci_remove(). (2) pointer to struct vfio_device_ops. It will be registered as ops of vfio device if .probe() succeeds. Suggested-by: Alex Williamson Signed-off-by: Yan

[RFC PATCH v4 02/10] vfio/pci: macros to generate module_init and module_exit for vendor modules

2020-05-17 Thread Yan Zhao
() in its module_exit, vfio_pci may hold a stale pointer to vendor module. Cc: Kevin Tian Suggested-by: Alex Williamson Signed-off-by: Yan Zhao --- include/linux/vfio.h | 27 +++ 1 file changed, 27 insertions(+) diff --git a/include/linux/vfio.h b/include/linux/vfio.h

[RFC PATCH v4 03/10] vfio/pci: export vendor_data, irq_type, num_regions, pdev and functions in vfio_pci_ops

2020-05-17 Thread Yan Zhao
-by: Alex Williamson Signed-off-by: Yan Zhao --- drivers/vfio/pci/vfio_pci.c | 56 +++-- include/linux/vfio.h| 18 2 files changed, 66 insertions(+), 8 deletions(-) diff --git a/drivers/vfio/pci/vfio_pci.c b/drivers/vfio/pci/vfio_pci.c index

[RFC PATCH v4 04/10] vfio/pci: let vfio_pci know number of vendor regions and vendor irqs

2020-05-17 Thread Yan Zhao
This allows a simpler VFIO_DEVICE_GET_INFO ioctl in vendor driver Cc: Kevin Tian Signed-off-by: Yan Zhao --- drivers/vfio/pci/vfio_pci.c | 23 +-- drivers/vfio/pci/vfio_pci_private.h | 2 ++ include/linux/vfio.h| 3 +++ 3 files changed, 26

[RFC PATCH v4 05/10] vfio/pci: export vfio_pci_get_barmap

2020-05-17 Thread Yan Zhao
This allows vendor driver to read/write to bars directly which is useful in security checking condition. Cc: Kevin Tian Signed-off-by: Yan Zhao --- drivers/vfio/pci/vfio_pci_rdwr.c | 10 ++ include/linux/vfio.h | 1 + 2 files changed, 11 insertions(+) diff --git a/drivers

[RFC PATCH v4 06/10] vfio: Define device specific irq type capability

2020-05-17 Thread Yan Zhao
From: Tina Zhang Cap the number of irqs with fixed indexes and use capability chains to chain device specific irqs. v2: - Irq capability index starts from 1. Signed-off-by: Tina Zhang Signed-off-by: Eric Auger --- include/uapi/linux/vfio.h | 19 ++- 1 file changed, 18

[RFC PATCH v4 08/10] i40e/vf_migration: VF live migration - pass-through VF first

2020-05-17 Thread Yan Zhao
VFs to guest by calling to exported handlers from driver vfio-pci. Cc: Shaopeng He Signed-off-by: Yan Zhao --- drivers/net/ethernet/intel/Kconfig| 10 ++ drivers/net/ethernet/intel/i40e/Makefile | 2 + .../ethernet/intel/i40e/i40e_vf_migration.c | 165

[RFC PATCH v4 07/10] vfio/pci: introduce a new irq type VFIO_IRQ_TYPE_REMAP_BAR_REGION

2020-05-17 Thread Yan Zhao
rresponding qemu implementation from the reply of this patch, and a sample usage in vendor driver in patch [10/10]. Cc: Kevin Tian Signed-off-by: Yan Zhao --- include/uapi/linux/vfio.h | 11 +++ 1 file changed, 11 insertions(+) diff --git a/include/uapi/linux/vfio.h b/include/uapi/linux/vfio.h in

[RFC PATCH v4 09/10] i40e/vf_migration: register a migration vendor region

2020-05-17 Thread Yan Zhao
: [1] kernel v17: https://patchwork.kernel.org/cover/11466129/ [2] qemu v16: https://patchwork.kernel.org/cover/11456557/ Cc: Shaopeng He Signed-off-by: Yan Zhao --- .../ethernet/intel/i40e/i40e_vf_migration.c | 429 +- .../ethernet/intel/i40e/i40e_vf_migration.h | 34 ++ 2

[RFC PATCH v4 10/10] i40e/vf_migration: vendor defined irq_type to support dynamic bar map

2020-05-17 Thread Yan Zhao
resources to vendor defined irqs. Cc: Kevin Tian Cc: Shaopeng He Signed-off-by: Yan Zhao --- drivers/net/ethernet/intel/Kconfig| 2 +- .../ethernet/intel/i40e/i40e_vf_migration.c | 322 +- .../ethernet/intel/i40e/i40e_vf_migration.h | 26 ++ 3 files ch

[QEMU RFC PATCH v4] hw/vfio/pci: remap bar region irq

2020-05-17 Thread Yan Zhao
] "vfio: Add a funtion to return a specific irq capabilities" [1] https://www.mail-archive.com/qemu-devel@nongnu.org/msg621645.html Signed-off-by: Yan Zhao --- hw/vfio/common.c | 50 hw/vfio/pci.c | 90 +

Re: [PATCH v5 0/4] introduction of migration_version attribute for VFIO live migration

2020-06-09 Thread Yan Zhao
On Fri, Jun 05, 2020 at 03:39:50PM +0100, Dr. David Alan Gilbert wrote: > > > > I tried to simplify the problem a bit, but we keep going backwards. If > > > > the requirement is that potentially any source device can migrate to any > > > > target device and we cannot provide any means other than

Re: [RFC PATCH v4 07/10] vfio/pci: introduce a new irq type VFIO_IRQ_TYPE_REMAP_BAR_REGION

2020-06-09 Thread Yan Zhao
On Fri, Jun 05, 2020 at 10:13:01AM -0600, Alex Williamson wrote: > On Thu, 4 Jun 2020 22:02:31 -0400 > Yan Zhao wrote: > > > On Wed, Jun 03, 2020 at 10:10:58PM -0600, Alex Williamson wrote: > > > On Wed, 3 Jun 2020 22:42:28 -0400 > > > Yan Zhao wrote: > >

Re: [RFC PATCH v4 08/10] i40e/vf_migration: VF live migration - pass-through VF first

2020-06-10 Thread Yan Zhao
On Wed, Jun 10, 2020 at 04:59:43PM +0800, Xiang Zheng wrote: > Hi Yan, > > few nits below... > > On 2020/5/18 10:53, Yan Zhao wrote: > > This driver intercepts all device operations as long as it's probed > > successfully by vfio-pci driver. > > > >

Re: [RFC PATCH] vfio: type1: fix kthread use case

2020-07-06 Thread Yan Zhao
e current mm first as > the kthread may hold a mm struct atm and it's not the right place > to switch mm. > > Fixes: 8d46c0cca5f4 ("vfio: introduce vfio_dma_rw to read/write a range of > IOVAs") > Cc: Yan Zhao > Cc: Markus Elfring > Cc: Christoph Hellwig > Sig

Re: [PATCH v5 0/4] introduction of migration_version attribute for VFIO live migration

2020-06-21 Thread Yan Zhao
On Fri, Jun 19, 2020 at 04:40:46PM -0600, Alex Williamson wrote: > On Tue, 9 Jun 2020 20:37:31 -0400 > Yan Zhao wrote: > > > On Fri, Jun 05, 2020 at 03:39:50PM +0100, Dr. David Alan Gilbert wrote: > > > > > > I tried to simplify the problem a

Re: [RFC PATCH v4 07/10] vfio/pci: introduce a new irq type VFIO_IRQ_TYPE_REMAP_BAR_REGION

2020-06-21 Thread Yan Zhao
On Fri, Jun 19, 2020 at 04:55:34PM -0600, Alex Williamson wrote: > On Wed, 10 Jun 2020 01:23:14 -0400 > Yan Zhao wrote: > > > On Fri, Jun 05, 2020 at 10:13:01AM -0600, Alex Williamson wrote: > > > On Thu, 4 Jun 2020 22:02:31 -0400 > > > Yan Zhao wrote: >

Re: [RFC PATCH v4 04/10] vfio/pci: let vfio_pci know number of vendor regions and vendor irqs

2020-06-11 Thread Yan Zhao
On Thu, Jun 11, 2020 at 01:31:05PM +0100, David Edmondson wrote: > On Thursday, 2020-06-04 at 22:15:42 -04, Yan Zhao wrote: > > > On Thu, Jun 04, 2020 at 05:25:15PM +0200, Cornelia Huck wrote: > >> On Sun, 17 May 2020 22:49:44 -0400 > >> Yan Zhao wrote: >

Re: [RFC PATCH v4 08/10] i40e/vf_migration: VF live migration - pass-through VF first

2020-06-11 Thread Yan Zhao
On Thu, Jun 11, 2020 at 10:27:34AM +0800, Xiang Zheng wrote: > > > On 2020/6/11 8:23, Yan Zhao wrote: > > On Wed, Jun 10, 2020 at 04:59:43PM +0800, Xiang Zheng wrote: > >> Hi Yan, > >> > >> few nits below... > >> > >> On 2020/5/18 10

Re: [RFC PATCH v4 07/10] vfio/pci: introduce a new irq type VFIO_IRQ_TYPE_REMAP_BAR_REGION

2020-06-02 Thread Yan Zhao
On Tue, Jun 02, 2020 at 01:34:35PM -0600, Alex Williamson wrote: > I'm not at all happy with this. Why do we need to hide the migration > sparse mmap from the user until migration time? What if instead we > introduced a new VFIO_REGION_INFO_CAP_SPARSE_MMAP_SAVING capability > where the existing

Re: [PATCH v5 0/4] introduction of migration_version attribute for VFIO live migration

2020-06-02 Thread Yan Zhao
On Tue, Jun 02, 2020 at 04:55:27PM -0600, Alex Williamson wrote: > On Wed, 29 Apr 2020 20:39:50 -0400 > Yan Zhao wrote: > > > On Wed, Apr 29, 2020 at 05:48:44PM +0800, Dr. David Alan Gilbert wrote: > > > > > > > > > > > > &

Re: [PATCH v5 0/4] introduction of migration_version attribute for VFIO live migration

2020-06-02 Thread Yan Zhao
On Tue, Jun 02, 2020 at 09:55:28PM -0600, Alex Williamson wrote: > On Tue, 2 Jun 2020 23:19:48 -0400 > Yan Zhao wrote: > > > On Tue, Jun 02, 2020 at 04:55:27PM -0600, Alex Williamson wrote: > > > On Wed, 29 Apr 2020 20:39:50 -0400 > > > Yan Zhao wrote: >

Re: [RFC PATCH v4 07/10] vfio/pci: introduce a new irq type VFIO_IRQ_TYPE_REMAP_BAR_REGION

2020-06-03 Thread Yan Zhao
On Wed, Jun 03, 2020 at 05:04:52PM -0600, Alex Williamson wrote: > On Tue, 2 Jun 2020 21:40:58 -0400 > Yan Zhao wrote: > > > On Tue, Jun 02, 2020 at 01:34:35PM -0600, Alex Williamson wrote: > > > I'm not at all happy with this. Why do we need to hide the migratio

Re: [PATCH 1/2] vfio/mdev: add version field as mandatory attribute for mdev device

2019-04-25 Thread Yan Zhao
On Wed, Apr 24, 2019 at 10:14:50PM +0800, Alex Williamson wrote: > On Tue, 23 Apr 2019 23:39:34 -0400 > Yan Zhao wrote: > > > On Tue, Apr 23, 2019 at 11:02:56PM +0800, Alex Williamson wrote: > > > On Tue, 23 Apr 2019 01:41:57 -0400 > > > Yan Zhao wrote: >

Re: [PATCH 1/2] vfio/mdev: add version field as mandatory attribute for mdev device

2019-05-06 Thread Yan Zhao
On Tue, Apr 30, 2019 at 11:29:08PM +0800, Cornelia Huck wrote: > On Wed, 24 Apr 2019 04:15:58 -0400 > Yan Zhao wrote: > > > On Wed, Apr 24, 2019 at 03:56:24PM +0800, Cornelia Huck wrote: > > > On Tue, 23 Apr 2019 23:10:37 -0400 > > > Yan Zhao wrote: > >

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

2019-05-06 Thread Yan Zhao
On Mon, May 06, 2019 at 03:41:58PM +0800, Zhenyu Wang wrote: > 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. > > > >

[PATCH 0/2] introduction of version attribute for VFIO live migration

2019-04-19 Thread Yan Zhao
and check device compatibility in vendor driver. Yan Zhao (2): vfio/mdev: add version field as mandatory attribute for mdev device drm/i915/gvt: export mdev device version to sysfs for Intel vGPU Documentation/vfio-mediated-device.txt| 36 + drivers/gpu/drm/i915/gvt/Makefile

Re: [PATCH v2 1/2] vfio/mdev: add version attribute for mdev device

2019-05-15 Thread Yan Zhao
On Tue, May 14, 2019 at 11:01:42PM +0800, Alex Williamson wrote: > On Tue, 14 May 2019 09:43:44 +0200 > Erik Skultety wrote: > > > On Tue, May 14, 2019 at 03:32:19AM -0400, Yan Zhao wrote: > > > On Tue, May 14, 2019 at 03:20:40PM +0800, Erik Skultety wrote: > >

[PATCH 0/8] VFIO Device states interface in GVT

2019-02-18 Thread Yan Zhao
STATE_RUNNING | (vcpu stops) --> set device state --> VFIO_DEVICE_STATE_STOP | MIGRATION_STATUS_ACTIVE | .load state callback --> set device memory size, set device memory buffer, set device config size, set device config buffer | (vcpu starts) --> set device state --> VFIO_D

[PATCH 1/8] drm/i915/gvt: Apply g2h adjust for GTT mmio access

2019-02-18 Thread Yan Zhao
From: Yulei Zhang Apply guest to host gma conversion while guest try to access the GTT mmio registers, as after enable live migration the host gma will be changed due to the resourece re-allocation, but guest gma should be remaining unchanged, thus g2h conversion is request for it.

[PATCH 3/8] drm/i915/gvt: Patch the gma in gpu commands during command parser

2019-02-18 Thread Yan Zhao
From: Yulei Zhang Adjust the graphics memory address in gpu commands according to the shift offset in guests' aperture and hidden gm address, and patch the commands before submit to execute. Signed-off-by: Yulei Zhang --- drivers/gpu/drm/i915/gvt/cmd_parser.c | 31 ---

[PATCH 4/8] drm/i915/gvt: Retrieve the guest gm base address from PVINFO

2019-02-18 Thread Yan Zhao
From: Yulei Zhang As after migration the host gm base address will be changed due to resource re-allocation, in order to make sure the guest gm address doesn't change with that to retrieve the guest gm base address from PVINFO. Signed-off-by: Yulei Zhang Signed-off-by: Zhenyu Wang ---

[PATCH 2/8] drm/i915/gvt: Apply g2h adjustment during fence mmio access

2019-02-18 Thread Yan Zhao
From: Yulei Zhang Apply the guest to host gma conversion while guest config the fence mmio registers due to the host gma change after the migration. Signed-off-by: Yulei Zhang --- drivers/gpu/drm/i915/gvt/aperture_gm.c | 6 -- drivers/gpu/drm/i915/gvt/gvt.h | 14 ++ 2

[PATCH 5/8] drm/i915/gvt: Align the guest gm aperture start offset for live migration

2019-02-18 Thread Yan Zhao
From: Yulei Zhang As guest gm aperture region start offset is initialized when vGPU created, in order to make sure that start offset is remain the same after migration, align the aperture start offset to 0 for guest. Signed-off-by: Yulei Zhang Signed-off-by: Zhenyu Wang ---

[PATCH 6/8] drm/i915/gvt: Apply g2h adjustment to buffer start gma for dmabuf

2019-02-18 Thread Yan Zhao
From: Yulei Zhang Adjust the buffer start gma in dmabuf for display in host domain. Signed-off-by: Yulei Zhang --- drivers/gpu/drm/i915/gvt/dmabuf.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/gpu/drm/i915/gvt/dmabuf.c b/drivers/gpu/drm/i915/gvt/dmabuf.c index

[PATCH 7/8] drm/i915/gvt: vGPU device config data save/restore interface

2019-02-18 Thread Yan Zhao
Zhang Signed-off-by: Xiao Zheng Signed-off-by: Zhenyu Wang Signed-off-by: Yan Zhao --- drivers/gpu/drm/i915/gvt/Makefile | 2 +- drivers/gpu/drm/i915/gvt/execlist.c | 2 +- drivers/gpu/drm/i915/gvt/gtt.c | 2 +- drivers/gpu/drm/i915/gvt/gtt.h | 3 + drivers/gpu/drm/i915/gvt

[PATCH 8/8] drm/i915/gvt: VFIO device states interfaces

2019-02-18 Thread Yan Zhao
s region dirty bitmap. Userspace VFIO can directly read dirty bitmap from mmaped region or through this region's read/write handlers. Signed-off-by: Yan Zhao Signed-off-by: Kevin Tian Signed-off-by: Yulei Zhang --- drivers/gpu/drm/i915/gvt/gvt.h | 3 + drivers/gpu/drm/i915/gvt/kvmgt

Re: [PATCH 0/4] apply page shift to PFN instead of VA in pfn_to_virt

2024-01-31 Thread Yan Zhao
On Wed, Jan 31, 2024 at 12:48:38PM +0100, Arnd Bergmann wrote: > On Wed, Jan 31, 2024, at 06:51, Yan Zhao wrote: > > This is a tiny fix to pfn_to_virt() for some platforms. > > > > The original implementaion of pfn_to_virt() takes PFN instead of PA as the > > input to

Re: [PATCH 0/4] apply page shift to PFN instead of VA in pfn_to_virt

2024-02-01 Thread Yan Zhao
On Thu, Feb 01, 2024 at 06:46:46AM +0100, Arnd Bergmann wrote: > On Thu, Feb 1, 2024, at 01:01, Yan Zhao wrote: > > On Wed, Jan 31, 2024 at 12:48:38PM +0100, Arnd Bergmann wrote: > >> On Wed, Jan 31, 2024, at 06:51, Yan Zhao wrote: > >> > >> How exactly did

[PATCH] mm: Remove broken pfn_to_virt() on arch csky/hexagon/openrisc

2024-02-02 Thread Yan Zhao
including it. Link:https://lore.kernel.org/all/20240131055159.2506-1-yan.y.z...@intel.com [1] Cc: Linus Walleij Suggested-by: Arnd Bergmann Signed-off-by: Yan Zhao --- arch/csky/include/asm/page.h | 5 - arch/hexagon/include/asm/page.h | 6 -- arch/openrisc/include/asm/page.h | 5

Re: [PATCH 0/4] apply page shift to PFN instead of VA in pfn_to_virt

2024-02-02 Thread Yan Zhao
On Fri, Feb 02, 2024 at 08:04:34AM +0100, Arnd Bergmann wrote: > On Fri, Feb 2, 2024, at 02:02, Yan Zhao wrote: > > On Thu, Feb 01, 2024 at 06:46:46AM +0100, Arnd Bergmann wrote: > >> > >> I think it's fair to assume we won't need asm-generic/page.h any > >> mo

[PATCH 2/4] csky: apply page shift to PFN instead of VA in pfn_to_virt

2024-01-30 Thread Yan Zhao
Apply the page shift to PFN to get physical address for final VA. The macro __va should take physical address instead of PFN as input. Fixes: c1884e1e1164 ("csky: Make pfn accessors static inlines") Signed-off-by: Yan Zhao --- arch/csky/include/asm/page.h | 2 +- 1 file changed, 1

[PATCH 1/4] asm-generic/page.h: apply page shift to PFN instead of VA in pfn_to_virt

2024-01-30 Thread Yan Zhao
Apply the page shift to PFN to get physical address for final VA. The macro __va should take physical address instead of PFN as input. Fixes: 2d78057f0dd4 ("asm-generic/page.h: Make pfn accessors static inlines") Signed-off-by: Yan Zhao --- include/asm-generic/page.h | 2 +- 1 file

[PATCH 4/4] openrisc: apply page shift to PFN instead of VA in pfn_to_virt

2024-01-30 Thread Yan Zhao
Apply the page shift to PFN to get physical address for final VA. The macro __va should take physical address instead of PFN as input. Fixes: 232ba1630c66 ("openrisc: Make pfn accessors statics inlines") Signed-off-by: Yan Zhao --- arch/openrisc/include/asm/page.h | 2 +- 1 file

[PATCH 3/4] Hexagon: apply page shift to PFN instead of VA in pfn_to_virt

2024-01-30 Thread Yan Zhao
Apply the page shift to PFN to get physical address for final VA. The macro __va should take physical address instead of PFN as input. Fixes: d6e81532b10d ("Hexagon: Make pfn accessors statics inlines") Signed-off-by: Yan Zhao --- arch/hexagon/include/asm/page.h | 2 +- 1 file

[PATCH 0/4] apply page shift to PFN instead of VA in pfn_to_virt

2024-01-30 Thread Yan Zhao
This is a tiny fix to pfn_to_virt() for some platforms. The original implementaion of pfn_to_virt() takes PFN instead of PA as the input to macro __va, with PAGE_SHIFT applying to the converted VA, which is not right under most conditions, especially when there's an offset in __va. Yan Zhao (4

Re: [PATCH 1/4] asm-generic/page.h: apply page shift to PFN instead of VA in pfn_to_virt

2024-02-29 Thread Yan Zhao
On Thu, Feb 29, 2024 at 02:34:35PM +0100, Linus Walleij wrote: > On Wed, Jan 31, 2024 at 7:27 AM Yan Zhao wrote: > > > Apply the page shift to PFN to get physical address for final VA. > > The macro __va should take physical address instead of PFN as input. > > >