RE: [PATCH 1/3] iommu/vt-d: Missing checks for pasid tables if allocation fails

2017-10-18 Thread Liu, Yi L
index > f6697e5..43280ca 100644 > --- a/drivers/iommu/intel-svm.c > +++ b/drivers/iommu/intel-svm.c > @@ -292,7 +292,7 @@ int intel_svm_bind_mm(struct device *dev, int *pasid, int > flags, struct svm_dev_ > int pasid_max; > int ret; > > - if (WARN_ON(!iom

RE: [PATCH v5 02/12] iommu/vt-d: Manage scalalble mode PASID tables

2018-12-03 Thread Liu, Yi L
Hi Joerg, > From: Joerg Roedel [mailto:j...@8bytes.org] > Sent: Monday, December 3, 2018 5:44 AM > To: Lu Baolu > Subject: Re: [PATCH v5 02/12] iommu/vt-d: Manage scalalble mode PASID tables > > Hi Baolu, > > On Wed, Nov 28, 2018 at 11:54:39AM +0800, Lu Baolu wrote: > > @@ -2482,12 +2482,13 @@

RE: [PATCH v4 17/22] iommu/intel-svm: report device page request

2018-05-13 Thread Liu, Yi L
Hi Jacob, Same comment with the one to patch 16, pci_get_bus_and_slot() is deprecated, may update accordingly. Thanks, Yi Liu > From: Jacob Pan [mailto:jacob.jun@linux.intel.com] > Sent: Friday, March 23, 2018 11:12 AM > > If the source device of a page request has its PASID table pointer b

RE: [PATCH v4 16/22] iommu/vt-d: report non-recoverable faults to device

2018-05-14 Thread Liu, Yi L
A and > interrupt remapping which has to be set up early before threaded IRQ is > available. > This patch adds an option and a workqueue such that when faults are requested, > DMAR fault IRQ handler can use the IOMMU fault reporting API to report. > > Signed-off-by: Jacob Pan >

RE: [PATCH v5 13/23] iommu: introduce device fault report API

2018-05-17 Thread Liu, Yi L
> From: Jacob Pan [mailto:jacob.jun@linux.intel.com] > Sent: Saturday, May 12, 2018 4:54 AM > > Traditionally, device specific faults are detected and handled within their > own device > drivers. When IOMMU is enabled, faults such as DMA related transactions are > detected by IOMMU. There is

RE: [PATCH v5 13/23] iommu: introduce device fault report API

2018-05-17 Thread Liu, Yi L
> From: Jacob Pan [mailto:jacob.jun@linux.intel.com] > Sent: Thursday, May 17, 2018 11:59 PM > On Thu, 17 May 2018 11:41:56 +0000 > "Liu, Yi L" wrote: > > > > +int iommu_report_device_fault(struct device *dev, struct > > > +iommu_fault_event

RE: [RFC PATCH 1/5] iommu: Add APIs for IOMMU PASID management

2018-12-15 Thread Liu, Yi L
> From: Lu Baolu [mailto:baolu...@linux.intel.com] > Sent: Sunday, November 11, 2018 10:45 PM > Subject: [RFC PATCH 1/5] iommu: Add APIs for IOMMU PASID management > > This adds APIs for IOMMU drivers and device drivers to manage the PASIDs used > for > DMA transfer and translation. It bases on I

RE: [PATCH 2/9] iommu/vt-d: Decouple idr bond pointer from svm

2018-05-01 Thread Liu, Yi L
. > > Cc: Ashok Raj > Cc: Jacob Pan > Cc: Kevin Tian > Cc: Liu Yi L > Signed-off-by: Lu Baolu > Reviewed-by: Kevin Tian Looks good to me. Reviewed-by: Liu, Yi L Regards, Yi Liu > drivers/iommu/intel-svm.c | 14 ++ > include/linux/intel-iommu.h | 1

RE: [PATCH 1/9] iommu/vt-d: Global PASID name space

2018-05-01 Thread Liu, Yi L
mple, one application (associated with a PASID) might > talk to two physical devices simultaneously while the two > devices could reside behind two different IOMMU units. Looks good to me. Reviewed-by: Liu, Yi L > Cc: Ashok Raj > Cc: Jacob Pan > Cc: Kevin Tian > Cc: Liu Yi L

RE: [PATCH 4/9] iommu/vt-d: Move device_domain_info to header

2018-05-01 Thread Liu, Yi L
> From: Lu Baolu [mailto:baolu...@linux.intel.com] > Sent: Tuesday, April 17, 2018 11:03 AM > > This allows the per device iommu data to be accessed from other > files. > > Cc: Ashok Raj > Cc: Jacob Pan > Cc: Kevin Tian > Cc: Liu Yi L > Signed-off-by: Lu Baol

RE: [PATCH 6/9] iommu/vt-d: Allocate and free pasid table

2018-05-01 Thread Liu, Yi L
ed. > > Cc: Ashok Raj > Cc: Jacob Pan > Cc: Kevin Tian > Cc: Liu Yi L > Signed-off-by: Lu Baolu > --- > drivers/iommu/intel-iommu.c | 13 + > drivers/iommu/intel-svm.c | 8 > include/linux/intel-iommu.h | 10 -- > 3 files changed,

RE: [PATCH 5/9] iommu/vt-d: Per domain pasid table interfaces

2018-05-01 Thread Liu, Yi L
> cases where multiple devices under one single IOMMU unit > support PASID feature. With per domain pasid table, we can > achieve finer protection and isolation granularity. > > Cc: Ashok Raj > Cc: Jacob Pan > Cc: Kevin Tian > Cc: Liu Yi L > Suggested-by: Ashok Raj

RE: [PATCH 3/9] iommu/vt-d: Use global PASID for SVM usage

2018-05-01 Thread Liu, Yi L
> From: Lu Baolu [mailto:baolu...@linux.intel.com] > Sent: Tuesday, April 17, 2018 11:03 AM > This patch switches PASID management for SVM from per iommu idr to the global > idr. > > Cc: Ashok Raj > Cc: Jacob Pan > Cc: Kevin Tian > Cc: Liu Yi L > Signed-off-by:

RE: [PATCH 7/9] iommu/vt-d: Calculate PTS value

2018-05-01 Thread Liu, Yi L
> From: Lu Baolu [mailto:baolu...@linux.intel.com] > Sent: Tuesday, April 17, 2018 11:03 AM > > Calculate PTS (PASID Table Size) value for the extended > context entry from the real size of the PASID table for > a domain. > > Cc: Ashok Raj > Cc: Jacob Pan >

RE: [PATCH 9/9] iommu/vt-d: Clean up PASID talbe management for SVM

2018-05-01 Thread Liu, Yi L
asid_tables and intel_svm_free_pasid_tables. Actually, only PASID State table allocation is remained in these two functions. Since PASID Table is modified to be per-iommu domain. How about the PASID State Table? Should it also be per-iommu domain? Thanks, Yi Liu > Cc: Ashok Raj > Cc: Jacob Pan > Cc: Ke

RE: [PATCH 8/9] iommu/vt-d: Use per-domain pasid table

2018-05-01 Thread Liu, Yi L
pasid table is per-iommu domain. May more accurate "Each svm-capable PCI device will be configed with a pasid table which shares with other svm-capable device within its iommu domain" Can include my reviewed by after refining the description. Reviewed-by: Liu, Yi L Thanks, Yi Liu > &

[RFC v2 2/2] vfio/pci: add vfio-pci-mdev driver

2019-03-13 Thread Liu, Yi L
ci,\ sysfsdev=/sys/bus/mdev/devices/83b8f4f2-509f-382f-3c1e-e6bfe0fa1003 g) destroy mdev > echo 1 > /sys/bus/mdev/devices/83b8f4f2-509f-382f-3c1e-e6bfe0fa1003/\ remove Cc: Kevin Tian Cc: Lu Baolu Suggested-by: Alex Williamson Signed-off-by: Liu, Yi L --- drivers/vfio/pci/Kconfig

[RFC v2 0/2] vfio/pci: wrap pci device as a mediated device

2019-03-13 Thread Liu, Yi L
ject: "vfio/pci: wrap pci device as a mediated device" Liu, Yi L (2): vfio/pci: export common symbols in vfio-pci vfio/pci: add vfio-pci-mdev driver drivers/vfio/pci/Kconfig| 11 ++ drivers/vfio/pci/Makefile | 5 + drivers/vfio/pci/vfio_pci.c

[RFC v2 1/2] vfio/pci: export common symbols in vfio-pci

2019-03-13 Thread Liu, Yi L
(); *) vfio_pci_request(); *) vfio_pci_probe_misc(); *) vfio_pci_remove_misc(); *) vfio_err_handlers; *) vfio_pci_reflck_attach(); *) vfio_pci_reflck_put(); Cc: Kevin Tian Cc: Lu Baolu Signed-off-by: Liu, Yi L --- drivers/vfio/pci/vfio_pci.c | 101 ++-- drivers/vfio/pci

RE: [RFC v2 1/2] vfio/pci: export common symbols in vfio-pci

2019-03-26 Thread Liu, Yi L
> From: Alex Williamson [mailto:alex.william...@redhat.com] > Sent: Tuesday, March 26, 2019 2:17 AM > To: Liu, Yi L > Subject: Re: [RFC v2 1/2] vfio/pci: export common symbols in vfio-pci > > On Sat, 23 Mar 2019 11:06:44 + > "Liu, Yi L" wrote: > > Hi A

RE: [RFC v2 1/2] vfio/pci: export common symbols in vfio-pci

2019-03-27 Thread Liu, Yi L
> From: Alex Williamson [mailto:alex.william...@redhat.com] > Sent: Tuesday, March 26, 2019 11:35 PM > To: Liu, Yi L > Subject: Re: [RFC v2 1/2] vfio/pci: export common symbols in vfio-pci > > On Tue, 26 Mar 2019 12:37:37 + > "Liu, Yi L" wrote:

RE: [RFC PATCH v1 0/4] vfio: Add IOPF support for VFIO passthrough

2021-02-09 Thread Liu, Yi L
> From: Tian, Kevin > Sent: Thursday, February 4, 2021 2:52 PM > > > From: Shenming Lu > > Sent: Tuesday, February 2, 2021 2:42 PM > > > > On 2021/2/1 15:56, Tian, Kevin wrote: > > >> From: Alex Williamson > > >> Sent: Saturday, January 30, 2021 6:58 AM > > >> > > >> On Mon, 25 Jan 2021 17:03:5

RE: [PATCH v3 4/4] vfio/type1: Use iommu_aux_at(de)tach_group() APIs

2020-07-30 Thread Liu, Yi L
> From: Lu Baolu > Sent: Tuesday, July 14, 2020 1:57 PM > > Replace iommu_aux_at(de)tach_device() with iommu_aux_at(de)tach_group(). > It also saves the IOMMU_DEV_FEAT_AUX-capable physcail device in the vfio_group > data structure so that it could be reused in other places. > > Signed-off-by: Lu

RE: [PATCH v6 08/15] iommu: Pass domain to sva_unbind_gpasid()

2020-08-20 Thread Liu, Yi L
Hi Alex, > From: Alex Williamson > Sent: Friday, August 21, 2020 5:06 AM > > On Mon, 27 Jul 2020 23:27:37 -0700 > Liu Yi L wrote: > > > From: Yi Sun > > > > Current interface is good enough for SVA virtualization on an assigned > > physical PCI dev

RE: [PATCH v6 07/15] vfio/type1: Add VFIO_IOMMU_PASID_REQUEST (alloc/free)

2020-08-20 Thread Liu, Yi L
Hi Alex, > From: Alex Williamson > Sent: Friday, August 21, 2020 4:51 AM > > On Mon, 27 Jul 2020 23:27:36 -0700 > Liu Yi L wrote: > > > This patch allows userspace to request PASID allocation/free, e.g. > > when serving the request from the guest. > &

RE: [PATCH v6 04/15] vfio/type1: Report iommu nesting info to userspace

2020-08-20 Thread Liu, Yi L
Hi Alex, > From: Alex Williamson > Sent: Friday, August 21, 2020 3:52 AM > > On Mon, 27 Jul 2020 23:27:33 -0700 > Liu Yi L wrote: > > > This patch exports iommu nesting capability info to user space through > > VFIO. Userspace is expected to check this info for s

RE: [PATCH v6 12/15] vfio/type1: Add vSVA support for IOMMU-backed mdevs

2020-08-20 Thread Liu, Yi L
Hi Alex, > From: Alex Williamson > Sent: Friday, August 21, 2020 5:49 AM > > On Mon, 27 Jul 2020 23:27:41 -0700 > Liu Yi L wrote: > > > Recent years, mediated device pass-through framework (e.g. vfio-mdev) > > is used to achieve flexible device sharing acros

RE: [PATCH v6 07/15] vfio/type1: Add VFIO_IOMMU_PASID_REQUEST (alloc/free)

2020-08-20 Thread Liu, Yi L
Hi Alex, > From: Alex Williamson > Sent: Friday, August 21, 2020 9:49 AM > > On Fri, 21 Aug 2020 00:37:19 +0000 > "Liu, Yi L" wrote: > > > Hi Alex, > > > > > From: Alex Williamson > > > Sent: Friday, August 21, 2020 4:51 AM > >

[PATCH v2 0/3] iommu/vt-d: Misc fixes on scalable mode

2020-12-22 Thread Liu Yi L
This patchset aims to fix a bug regards to native SVM usage, and also several bugs around subdevice (attached to device via auxiliary manner) tracking and ineffective device_tlb flush. Liu Yi L (3): iommu/vt-d: Move intel_iommu info from struct intel_svm to struct intel_svm_dev iommu/vt-d

[PATCH v2 3/3] iommu/vt-d: Fix ineffective devTLB invalidation for subdevices

2020-12-22 Thread Liu Yi L
-> has_iotlb_device needs to be updated when attaching to subdevices. Fixes: 67b8e02b5e761 ("iommu/vt-d: Aux-domain specific domain attach/detach") Signed-off-by: Liu Yi L --- drivers/iommu/intel/iommu.c | 63 +++-- 1 file changed, 47 insertions(+), 16 delet

[PATCH v2 2/3] iommu/vt-d: Track device aux-attach with subdevice_domain_info

2020-12-22 Thread Liu Yi L
er cases. For example, flushing device_iotlb for a domain which has sub-devices attached by auxiliary manner. Co-developed-by: Xin Zeng Signed-off-by: Xin Zeng Signed-off-by: Liu Yi L --- drivers/iommu/intel/iommu.c | 95 +++-- include/linux/intel-iommu.h | 16 ++

[PATCH v2 1/3] iommu/vt-d: Move intel_iommu info from struct intel_svm to struct intel_svm_dev

2020-12-22 Thread Liu Yi L
/vt-d: Shared virtual address in scalable mode") Cc: Lu Baolu Cc: Jacob Pan Cc: Raj Ashok Cc: David Woodhouse Reported-by: Guo Kaijie Reported-by: Xin Zeng Signed-off-by: Guo Kaijie Signed-off-by: Xin Zeng Signed-off-by: Liu Yi L Tested-by: Guo Kaijie --- drivers/iommu/intel/s

[PATCH v3 0/3] iommu/vt-d: Misc fixes on scalable mode

2020-12-28 Thread Liu Yi L
t; - Rename "iommu/vt-d: A fix to iommu_flush_dev_iotlb() for aux-domain" to be "iommu/vt-d: Fix ineffective devTLB invalidation for subdevices" - Refined the commit messages v1: https://lore.kernel.org/linux-iommu/2020122352.183523-1-yi.l@intel.com/ Liu Yi L (3):

[PATCH v3 2/3] iommu/vt-d: Track device aux-attach with subdevice_domain_info

2020-12-28 Thread Liu Yi L
er cases. For example, flushing device_iotlb for a domain which has sub-devices attached by auxiliary manner. Co-developed-by: Xin Zeng Signed-off-by: Xin Zeng Signed-off-by: Liu Yi L --- drivers/iommu/intel/iommu.c | 95 +++-- include/linux/intel-iommu.h | 16 ++

[PATCH v3 1/3] iommu/vt-d: Move intel_iommu info from struct intel_svm to struct intel_svm_dev

2020-12-28 Thread Liu Yi L
/vt-d: Shared virtual address in scalable mode") Cc: Lu Baolu Cc: Jacob Pan Cc: Raj Ashok Cc: David Woodhouse Reported-by: Guo Kaijie Reported-by: Xin Zeng Signed-off-by: Guo Kaijie Signed-off-by: Xin Zeng Signed-off-by: Liu Yi L --- drivers/iommu/intel/svm.c | 9 + include/l

[PATCH v3 3/3] iommu/vt-d: Fix ineffective devTLB invalidation for subdevices

2020-12-28 Thread Liu Yi L
-> has_iotlb_device needs to be updated when attaching to subdevices. Fixes: 67b8e02b5e761 ("iommu/vt-d: Aux-domain specific domain attach/detach") Signed-off-by: Liu Yi L --- drivers/iommu/intel/iommu.c | 53 ++--- 1 file changed, 37 insertions(+), 16 delet

RE: [PATCH v2 3/3] iommu/vt-d: Fix ineffective devTLB invalidation for subdevices

2020-12-25 Thread Liu, Yi L
Hi Baolu, Well received, all comments accepted. thanks. Regards, Yi Liu > From: Lu Baolu > Sent: Wednesday, December 23, 2020 6:10 PM > > Hi Yi, > > On 2020/12/23 14:27, Liu Yi L wrote: > > iommu_flush_dev_iotlb() is called to invalidate caches on device. It only >

RE: [PATCH V4 05/18] iommu/ioasid: Redefine IOASID set and allocation APIs

2021-03-31 Thread Liu, Yi L
Hi Jason, > From: Jason Gunthorpe > Sent: Tuesday, March 30, 2021 9:29 PM > > On Tue, Mar 30, 2021 at 01:37:05AM +, Tian, Kevin wrote: [...] > > Hi, Jason, > > > > Actually above is a major open while we are refactoring vSVA uAPI toward > > this direction. We have two concerns about merging

RE: [PATCH V4 05/18] iommu/ioasid: Redefine IOASID set and allocation APIs

2021-03-31 Thread Liu, Yi L
> From: Jason Gunthorpe > Sent: Tuesday, March 30, 2021 9:28 PM > > On Tue, Mar 30, 2021 at 04:14:58AM +, Tian, Kevin wrote: > > > One correction. The mdev should still construct the list of allowed PASID's > as > > you said (by listening to IOASID_BIND/UNBIND event), in addition to the > io

RE: [PATCH V4 05/18] iommu/ioasid: Redefine IOASID set and allocation APIs

2021-03-31 Thread Liu, Yi L
> From: Jason Gunthorpe > Sent: Tuesday, March 30, 2021 9:43 PM [..] > No, the mdev device driver must enforce this directly. It is the one > that programms the physical shared HW, it is the one that needs a list > of PASID's it is allowed to program *for each mdev* > > ioasid_set doesn't seem to

RE: [PATCH V4 05/18] iommu/ioasid: Redefine IOASID set and allocation APIs

2021-03-31 Thread Liu, Yi L
> From: Jason Gunthorpe > Sent: Wednesday, March 31, 2021 8:41 PM > > On Wed, Mar 31, 2021 at 07:38:36AM +0000, Liu, Yi L wrote: > > > The reason is /dev/ioasid FD is per-VM since the ioasid allocated to > > the VM should be able to be shared by all assigned device

RE: [PATCH V4 05/18] iommu/ioasid: Redefine IOASID set and allocation APIs

2021-04-01 Thread Liu, Yi L
Hi Jason, > From: Liu, Yi L > Sent: Thursday, April 1, 2021 12:39 PM > > > From: Jason Gunthorpe > > Sent: Wednesday, March 31, 2021 8:41 PM > > > > On Wed, Mar 31, 2021 at 07:38:36AM +, Liu, Yi L wrote: > > > > > The reason is /dev/i

RE: [PATCH V4 05/18] iommu/ioasid: Redefine IOASID set and allocation APIs

2021-04-01 Thread Liu, Yi L
> From: Jean-Philippe Brucker > Sent: Thursday, April 1, 2021 8:05 PM [...] > > Also wondering about: > > * Querying IOMMU nesting capabilities before binding page tables (which > page table formats are supported?). We were planning to have a VFIO cap, > but I'm guessing we need to go back t

RE: [PATCH V4 05/18] iommu/ioasid: Redefine IOASID set and allocation APIs

2021-04-01 Thread Liu, Yi L
> From: Jason Gunthorpe > Sent: Thursday, April 1, 2021 9:16 PM > > On Thu, Apr 01, 2021 at 01:10:48PM +0000, Liu, Yi L wrote: > > > From: Jason Gunthorpe > > > Sent: Thursday, April 1, 2021 7:47 PM > > [...] > > > I'm worried Intel views the

RE: [PATCH V4 05/18] iommu/ioasid: Redefine IOASID set and allocation APIs

2021-04-01 Thread Liu, Yi L
> From: Jason Gunthorpe > Sent: Thursday, April 1, 2021 9:43 PM > > On Thu, Apr 01, 2021 at 01:38:46PM +0000, Liu, Yi L wrote: > > > From: Jean-Philippe Brucker > > > Sent: Thursday, April 1, 2021 8:05 PM > > [...] > > > > > > Also

RE: [PATCH V4 05/18] iommu/ioasid: Redefine IOASID set and allocation APIs

2021-04-01 Thread Liu, Yi L
> From: Jason Gunthorpe > Sent: Thursday, April 1, 2021 7:47 PM [...] > I'm worried Intel views the only use of PASID in a guest is with > ENQCMD, but that is not consistent with the industry. We need to see > normal nested PASID support with assigned PCI VFs. I'm not quire flow here. Intel also

RE: [PATCH V4 05/18] iommu/ioasid: Redefine IOASID set and allocation APIs

2021-04-02 Thread Liu, Yi L
Hi Jason, > From: Jason Gunthorpe > Sent: Thursday, April 1, 2021 7:54 PM > > On Thu, Apr 01, 2021 at 07:04:01AM +0000, Liu, Yi L wrote: > > > After reading your reply in https://lore.kernel.org/linux- > iommu/20210331123801.gd1463...@nvidia.com/#t > > So you

RE: [PATCH v2 1/1] vfio/type1: Add vfio_group_domain()

2020-11-25 Thread Liu, Yi L
On Thurs, Nov 26, 2020, at 9:27 AM, Lu Baolu wrote: > Add the API for getting the domain from a vfio group. This could be used > by the physical device drivers which rely on the vfio/mdev framework for > mediated device user level access. The typical use case like below: > > unsigned int pas

RE: [PATCH V4 00/18] IOASID extensions for guest SVA

2021-03-02 Thread Liu, Yi L
> From: Jacob Pan > Sent: Sunday, February 28, 2021 6:01 AM > > I/O Address Space ID (IOASID) core code was introduced in v5.5 as a generic > kernel allocator service for both PCIe Process Address Space ID (PASID) and > ARM SMMU's Substream ID. IOASIDs are used to associate DMA requests > with > v

RE: [PATCH v3 3/3] iommu/vt-d: Fix ineffective devTLB invalidation for subdevices

2021-01-04 Thread Liu, Yi L
Hi Baolu, > From: Lu Baolu > Sent: Tuesday, December 29, 2020 4:42 PM > > Hi Yi, > > On 2020/12/29 11:25, Liu Yi L wrote: > > iommu_flush_dev_iotlb() is called to invalidate caches on device. It only > > loops the devices which are full-attached to the domain

RE: [PATCH v3 2/3] iommu/vt-d: Track device aux-attach with subdevice_domain_info

2021-01-04 Thread Liu, Yi L
Hi Baolu, > From: Lu Baolu > Sent: Tuesday, December 29, 2020 4:38 PM > > Hi Yi, > > On 2020/12/29 11:25, Liu Yi L wrote: > > In the existing code, loop all devices attached to a domain does not > > include sub-devices attached via iommu_aux_attach_device(). >

RE: [PATCH v3 3/3] iommu/vt-d: Fix ineffective devTLB invalidation for subdevices

2021-01-06 Thread Liu, Yi L
Hi Will, > From: Will Deacon > Sent: Wednesday, January 6, 2021 1:24 AM > > On Tue, Jan 05, 2021 at 05:50:22AM +0000, Liu, Yi L wrote: > > > > +static void __iommu_flush_dev_iotlb(struct device_domain_info > *info, > > > > +

[PATCH v4 0/3] iommu/vt-d: Misc fixes on scalable mode

2021-01-06 Thread Liu Yi L
ename "iommu/vt-d: A fix to iommu_flush_dev_iotlb() for aux-domain" to be "iommu/vt-d: Fix ineffective devTLB invalidation for subdevices" - Refined the commit messages v1: https://lore.kernel.org/linux-iommu/2020122352.183523-1-yi.l@intel.com/ Regards, Yi Liu Liu Y

[PATCH v4 1/3] iommu/vt-d: Move intel_iommu info from struct intel_svm to struct intel_svm_dev

2021-01-06 Thread Liu Yi L
/vt-d: Shared virtual address in scalable mode") Cc: Lu Baolu Cc: Jacob Pan Cc: Raj Ashok Cc: David Woodhouse Reported-by: Guo Kaijie Reported-by: Xin Zeng Signed-off-by: Guo Kaijie Signed-off-by: Xin Zeng Signed-off-by: Liu Yi L Tested-by: Guo Kaijie Cc: sta...@vger.kernel.org # v5.0

[PATCH v4 3/3] iommu/vt-d: Fix ineffective devTLB invalidation for subdevices

2021-01-06 Thread Liu Yi L
-> has_iotlb_device needs to be updated when attaching to subdevices. Fixes: 67b8e02b5e761 ("iommu/vt-d: Aux-domain specific domain attach/detach") Signed-off-by: Liu Yi L Acked-by: Lu Baolu --- drivers/iommu/intel/iommu.c | 53 +++-- 1 fil

[PATCH v4 2/3] iommu/vt-d: Track device aux-attach with subdevice_domain_info

2021-01-06 Thread Liu Yi L
er cases. For example, flushing device_iotlb for a domain which has sub-devices attached by auxiliary manner. Fixes: 67b8e02b5e761 ("iommu/vt-d: Aux-domain specific domain attach/detach") Co-developed-by: Xin Zeng Signed-off-by: Xin Zeng Signed-off-by: Liu Yi L Acked-by: Lu Baolu --- d

RE: [RFC v2 1/2] vfio/pci: export common symbols in vfio-pci

2019-03-20 Thread Liu, Yi L
> From: Alex Williamson [mailto:alex.william...@redhat.com] > Sent: Wednesday, March 20, 2019 2:14 AM > To: Liu, Yi L > Subject: Re: [RFC v2 1/2] vfio/pci: export common symbols in vfio-pci > > On Tue, 12 Mar 2019 16:18:22 +0800 > "Liu, Yi L" wrote: > &g

[PATCH v2 00/13] vfio_pci: wrap pci device as a mediated device

2019-09-06 Thread Liu Yi L
i-mdev module. - new patchset subject: "vfio/pci: wrap pci device as a mediated device" Alex Williamson (1): samples: refine vfio-mdev-pci driver Liu Yi L (12): vfio_pci: move vfio_pci_is_vga/vfio_vga_disabled to header vfio_pci: refine user config reference in vfio-pci module

[PATCH v2 02/13] vfio_pci: refine user config reference in vfio-pci module

2019-09-06 Thread Liu Yi L
This patch adds three fields in struct vfio_pci_device to pass the user configs of vfio-pci module to some functions which could be common in future usage. Cc: Kevin Tian Cc: Lu Baolu Signed-off-by: Liu Yi L --- drivers/vfio/pci/vfio_pci.c | 24 +++- drivers/vfio

[PATCH v2 05/13] vfio_pci: duplicate vfio_pci.c

2019-09-06 Thread Liu Yi L
Cc: Lu Baolu Signed-off-by: Liu Yi L --- drivers/vfio/pci/vfio_pci_common.c | 1688 1 file changed, 1688 insertions(+) create mode 100644 drivers/vfio/pci/vfio_pci_common.c diff --git a/drivers/vfio/pci/vfio_pci_common.c b/drivers/vfio/pci

[PATCH v2 01/13] vfio_pci: move vfio_pci_is_vga/vfio_vga_disabled to header

2019-09-06 Thread Liu Yi L
This patch fix an issue regards to always_inline. e.g.: "error: inlining failed in call to always_inline ‘vfio_pci_is_vga’: function body not available". Cc: Kevin Tian Cc: Lu Baolu Signed-off-by: Liu Yi L --- drivers/vfio/pci/vfio_pci.c | 14 -- driver

[PATCH v2 08/13] vfio/pci: protect cap/ecap_perm bits alloc/free with atomic op

2019-09-06 Thread Liu Yi L
vfio_pci_init_perm_bits() will initialize the bits. While the last caller of vfio_pci_uninit_perm_bits() will free the bits. Cc: Kevin Tian Cc: Lu Baolu Suggested-by: Alex Williamson Signed-off-by: Liu Yi L --- drivers/vfio/pci/vfio_pci_config.c | 9 + 1 file changed, 9 insertions(+) diff --git a

[PATCH v2 04/13] vfio_pci: make common functions be extern

2019-09-06 Thread Liu Yi L
*) vfio_pci_mmap *) vfio_pci_request *) vfio_pci_fill_ids *) vfio_pci_reflck_attach *) vfio_pci_reflck_put *) vfio_pci_probe_power_state Cc: Kevin Tian Cc: Lu Baolu Signed-off-by: Liu Yi L --- drivers/vfio/pci/vfio_pci.c | 30 +- drivers/vfio/pci

[PATCH v2 10/13] samples: refine vfio-mdev-pci driver

2019-09-06 Thread Liu Yi L
k the /sys/bus/pci/devices/$bdf/mdev_supported_types/ to ensure the final mdev_supported_types. Cc: Kevin Tian Cc: Lu Baolu Signed-off-by: Alex Williamson Signed-off-by: Liu Yi L --- drivers/vfio/pci/vfio_mdev_pci.c | 123 +++ 1 file changed, 72 insertions(+)

[PATCH v2 13/13] vfio/type1: track iommu backed group attach

2019-09-06 Thread Liu Yi L
ices (via vfio-pci or PF/VF wrapped mdev) to a single VM. This is aligned with current vfio passthru rules. Cc: Kevin Tian Cc: Lu Baolu Suggested-by: Alex Williamson Signed-off-by: Liu Yi L --- drivers/vfio/vfio_iommu_type1.c | 167 1 file changed, 154

[PATCH v2 03/13] vfio_pci: refine vfio_pci_driver reference in vfio_pci.c

2019-09-06 Thread Liu Yi L
This patch replaces the vfio_pci_driver reference in vfio_pci.c with pci_dev_driver(vdev->pdev) which is more helpful to make the functions be generic to module types. Cc: Kevin Tian Cc: Lu Baolu Signed-off-by: Liu Yi L --- drivers/vfio/pci/vfio_pci.c | 33 ++---

[PATCH v2 07/13] vfio_pci: shrink vfio_pci.c

2019-09-06 Thread Liu Yi L
This patch removes the common codes in vfio_pci.c, instead, vfio-pci module will leverage the common functions implemented in vfio_pci_common.c. Cc: Kevin Tian Cc: Lu Baolu Signed-off-by: Liu Yi L --- drivers/vfio/pci/Makefile |3 +- drivers/vfio/pci/vfio_pci.c | 1424

[PATCH v2 06/13] vfio_pci: shrink vfio_pci_common.c

2019-09-06 Thread Liu Yi L
This patch removes the vfio-pci module specific codes in vfio_pci_common.c to make vfio_pci_common.c be a common source file. Cc: Kevin Tian Cc: Lu Baolu Signed-off-by: Liu Yi L --- drivers/vfio/pci/vfio_pci_common.c | 233 - 1 file changed, 233 deletions

[PATCH v2 11/13] samples/vfio-mdev-pci: call vfio_add_group_dev()

2019-09-06 Thread Liu Yi L
should return -ENODEV to fail the VFIO_GET_DEVICE_FD request from userspace. Cc: Kevin Tian Cc: Lu Baolu Signed-off-by: Liu Yi L --- drivers/vfio/pci/vfio_mdev_pci.c | 91 1 file changed, 82 insertions(+), 9 deletions(-) diff --git a/drivers/vfio/pci

[PATCH v2 09/13] samples: add vfio-mdev-pci driver

2019-09-06 Thread Liu Yi L
sdev=/sys/bus/mdev/devices/83b8f4f2-509f-382f-3c1e-e6bfe0fa1003 g) destroy mdev > echo 1 > /sys/bus/mdev/devices/83b8f4f2-509f-382f-3c1e-e6bfe0fa1003/\ remove Cc: Kevin Tian Cc: Lu Baolu Cc: Masahiro Yamada Suggested-by: Alex Williamson Signed-off-by: Liu Yi L --- drivers/vfi

[PATCH v2 12/13] vfio/type1: use iommu_attach_group() for wrapping PF/VF as mdev

2019-09-06 Thread Liu Yi L
Baolu Suggested-by: Alex Williamson Signed-off-by: Liu Yi L --- drivers/vfio/vfio_iommu_type1.c | 22 ++ 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/drivers/vfio/vfio_iommu_type1.c b/drivers/vfio/vfio_iommu_type1.c index 054391f..317430d 100644 --- a/drivers

[PATCH v2 13/13] vfio/type1: track iommu backed group attach

2019-09-06 Thread Liu Yi L
ices (via vfio-pci or PF/VF wrapped mdev) to a single VM. This is aligned with current vfio passthru rules. Cc: Kevin Tian Cc: Lu Baolu Suggested-by: Alex Williamson Signed-off-by: Liu Yi L --- drivers/vfio/vfio_iommu_type1.c | 167 1 file changed, 154

RE: [PATCH v2 02/13] vfio_pci: refine user config reference in vfio-pci module

2019-09-30 Thread Liu, Yi L
Hi Alex, > From: Alex Williamson [mailto:alex.william...@redhat.com] > Sent: Thursday, September 26, 2019 10:36 AM > To: Liu, Yi L > Subject: Re: [PATCH v2 02/13] vfio_pci: refine user config reference in > vfio-pci > module > > On Thu, 5 Sep 2019 15:59:19 +0800 > L

RE: [PATCH v2 08/13] vfio/pci: protect cap/ecap_perm bits alloc/free with atomic op

2019-09-30 Thread Liu, Yi L
Hi Alex, > From: Alex Williamson [mailto:alex.william...@redhat.com] > Sent: Thursday, September 26, 2019 10:36 AM > To: Liu, Yi L > Subject: Re: [PATCH v2 08/13] vfio/pci: protect cap/ecap_perm bits alloc/free > with > atomic op > > On Thu, 5 Sep 2019 15:59:25

RE: [PATCH v2 10/13] samples: refine vfio-mdev-pci driver

2019-09-30 Thread Liu, Yi L
Hi Alex, > From: Alex Williamson [mailto:alex.william...@redhat.com] > Sent: Thursday, September 26, 2019 10:37 AM > To: Liu, Yi L > > Subject: Re: [PATCH v2 10/13] samples: refine vfio-mdev-pci driver > > On Thu, 5 Sep 2019 15:59:27 +0800 > Liu Yi L wrote: >

Re: [PATCH v2 12/13] vfio/type1: use iommu_attach_group() for wrapping PF/VF as mdev

2019-09-30 Thread Liu, Yi L
Hi Alex, > From: Alex Williamson [mailto:alex.william...@redhat.com] > Sent: Thursday, September 26, 2019 10:37 AM > To: Liu, Yi L > Subject: Re: [PATCH v2 12/13] vfio/type1: use iommu_attach_group() for > wrapping > PF/VF as mdev > > On Thu, 5 Sep 2019 15:59:29

RE: [PATCH v2 11/13] samples/vfio-mdev-pci: call vfio_add_group_dev()

2019-09-30 Thread Liu, Yi L
Hi Alex, > From: Alex Williamson [mailto:alex.william...@redhat.com] > Sent: Thursday, September 26, 2019 10:37 AM > To: Liu, Yi L > Subject: Re: [PATCH v2 11/13] samples/vfio-mdev-pci: call vfio_add_group_dev() > > On Thu, 5 Sep 2019 15:59:28 +0800 > Liu Yi L wrote: &

RE: [PATCH v2 13/13] vfio/type1: track iommu backed group attach

2019-09-30 Thread Liu, Yi L
Hi Alex, > From: Alex Williamson [mailto:alex.william...@redhat.com] > Sent: Thursday, September 26, 2019 10:37 AM > To: Liu, Yi L > Subject: Re: [PATCH v2 13/13] vfio/type1: track iommu backed group attach > > On Thu, 5 Sep 2019 16:08:43 +0800 > Liu Yi L wrote: > &

RE: [PATCH v2 00/13] vfio_pci: wrap pci device as a mediated device

2019-09-25 Thread Liu, Yi L
Hi Alex, Any comments on it? :-) With this version, the vfio-mdev-pci driver could work with non-singleton groups, also it works with vfio-pci as well. Regards, Yi Liu > From: Liu, Yi L > Sent: Thursday, September 5, 2019 3:59 PM > To: alex.william...@redhat.com; kwankh...@nvidia.com

RE: [PATCH v6 0/9] vfio/mdev: IOMMU aware mediated device

2019-02-19 Thread Liu, Yi L
> From: Alex Williamson [mailto:alex.william...@redhat.com] > Sent: Friday, February 15, 2019 4:15 AM > To: Lu Baolu > Subject: Re: [PATCH v6 0/9] vfio/mdev: IOMMU aware mediated device > > On Wed, 13 Feb 2019 12:02:52 +0800 > Lu Baolu wrote: > > > Hi, > > > > The Mediate Device is a framework

RE: [PATCH v1 9/9] smaples: add vfio-mdev-pci driver

2019-07-12 Thread Liu, Yi L
Hi Alex, > From: Alex Williamson [mailto:alex.william...@redhat.com] > Sent: Friday, July 12, 2019 3:08 AM > To: Liu, Yi L > Subject: Re: [PATCH v1 9/9] smaples: add vfio-mdev-pci driver > > On Thu, 11 Jul 2019 12:27:26 + > "Liu, Yi L" wrote: > &

RE: [PATCH v1 9/9] smaples: add vfio-mdev-pci driver

2019-07-26 Thread Liu, Yi L
Hi Alex, > From: Alex Williamson [mailto:alex.william...@redhat.com] > Sent: Saturday, July 20, 2019 4:58 AM > To: Liu, Yi L > Subject: Re: [PATCH v1 9/9] smaples: add vfio-mdev-pci driver > > On Fri, 12 Jul 2019 12:55:27 + > "Liu, Yi L" wrote: >

RE: [PATCH v1 9/9] smaples: add vfio-mdev-pci driver

2019-06-24 Thread Liu, Yi L
Hi Alex, > From: Alex Williamson [mailto:alex.william...@redhat.com] > Sent: Friday, June 21, 2019 11:58 PM > To: Liu, Yi L > Subject: Re: [PATCH v1 9/9] smaples: add vfio-mdev-pci driver > > On Fri, 21 Jun 2019 10:23:10 + > "Liu, Yi L" wrote: >

RE: [PATCH v1 9/9] smaples: add vfio-mdev-pci driver

2019-07-03 Thread Liu, Yi L
Hi Alex, Thanks for the comments. Have four inline responses below. And one of them need your further help. :-) . > From: Alex Williamson [mailto:alex.william...@redhat.com] > Sent: Friday, June 28, 2019 11:08 PM > To: Liu, Yi L > Subject: Re: [PATCH v1 9/9] smaples: add vfio-mde

RE: [PATCH v1 9/9] smaples: add vfio-mdev-pci driver

2019-07-04 Thread Liu, Yi L
Hi Alex, > From: Alex Williamson [mailto:alex.william...@redhat.com] > Sent: Thursday, July 4, 2019 1:22 AM > To: Liu, Yi L > Subject: Re: [PATCH v1 9/9] smaples: add vfio-mdev-pci driver > > On Wed, 3 Jul 2019 08:25:25 + > "Liu, Yi L" wrote: > > >

[PATCH v1 3/9] vfio_pci: refine vfio_pci_driver reference in vfio_pci.c

2019-06-09 Thread Liu Yi L
This patch replaces the vfio_pci_driver reference in vfio_pci.c with pci_dev_driver(vdev->pdev) which is more helpful to make the functions be generic to module types. Cc: Kevin Tian Cc: Lu Baolu Signed-off-by: Liu Yi L --- drivers/vfio/pci/vfio_pci.c | 33 ++---

[PATCH v1 0/9] vfio_pci: wrap pci device as a mediated device

2019-06-09 Thread Liu Yi L
v1, v2 follows Alex's suggestion to add a separate vfio-pci-mdev module. - new patchset subject: "vfio/pci: wrap pci device as a mediated device" Liu Yi L (9): vfio_pci: move vfio_pci_is_vga/vfio_vga_disabled to header vfio_pci: refine user config reference in vfio-

[PATCH v1 1/9] vfio_pci: move vfio_pci_is_vga/vfio_vga_disabled to header

2019-06-09 Thread Liu Yi L
This patch fix an issue regards to always_inline. e.g.: "error: inlining failed in call to always_inline ‘vfio_pci_is_vga’: function body not available". Cc: Kevin Tian Cc: Lu Baolu Signed-off-by: Liu Yi L --- drivers/vfio/pci/vfio_pci.c | 14 -- driver

[PATCH v1 7/9] vfio_pci: shrink vfio_pci.c

2019-06-09 Thread Liu Yi L
This patch removes the common codes in vfio_pci.c, instead, vfio-pci module will leverage the common functions implemented in vfio_pci_common.c. Cc: Kevin Tian Cc: Lu Baolu Signed-off-by: Liu Yi L --- drivers/vfio/pci/Makefile |3 +- drivers/vfio/pci/vfio_pci.c | 1424

[PATCH v1 9/9] smaples: add vfio-mdev-pci driver

2019-06-09 Thread Liu Yi L
s/mdev/devices/83b8f4f2-509f-382f-3c1e-e6bfe0fa1003 g) destroy mdev > echo 1 > /sys/bus/mdev/devices/83b8f4f2-509f-382f-3c1e-e6bfe0fa1003/\ remove Cc: Kevin Tian Cc: Lu Baolu Cc: Masahiro Yamada Suggested-by: Alex Williamson Signed-off-by: Liu Yi L --- drivers/vfi

[PATCH v1 2/9] vfio_pci: refine user config reference in vfio-pci module

2019-06-09 Thread Liu Yi L
This patch adds three fields in struct vfio_pci_device to pass the user configs of vfio-pci module to some functions which could be common in future usage. Cc: Kevin Tian Cc: Lu Baolu Signed-off-by: Liu Yi L --- drivers/vfio/pci/vfio_pci.c | 24 +++- drivers/vfio

[PATCH v1 5/9] vfio_pci: duplicate vfio_pci.c

2019-06-09 Thread Liu Yi L
Cc: Lu Baolu Signed-off-by: Liu Yi L --- drivers/vfio/pci/vfio_pci_common.c | 1691 1 file changed, 1691 insertions(+) create mode 100644 drivers/vfio/pci/vfio_pci_common.c diff --git a/drivers/vfio/pci/vfio_pci_common.c b/drivers/vfio/pci

[PATCH v1 6/9] vfio_pci: shrink vfio_pci_common.c

2019-06-09 Thread Liu Yi L
This patch removes the vfio-pci module specific codes in vfio_pci_common.c to make vfio_pci_common.c be a common source file. Cc: Kevin Tian Cc: Lu Baolu Signed-off-by: Liu Yi L --- drivers/vfio/pci/vfio_pci_common.c | 233 - 1 file changed, 233 deletions

[PATCH v1 4/9] vfio_pci: make common functions be extern

2019-06-09 Thread Liu Yi L
*) vfio_pci_mmap *) vfio_pci_request *) vfio_pci_fill_ids *) vfio_pci_reflck_attach *) vfio_pci_reflck_put *) vfio_pci_probe_power_state Cc: Kevin Tian Cc: Lu Baolu Signed-off-by: Liu Yi L --- drivers/vfio/pci/vfio_pci.c | 30 +- drivers/vfio/pci

[PATCH v1 8/9] vfio/pci: protect cap/ecap_perm bits alloc/free with atomic op

2019-06-09 Thread Liu Yi L
vfio_pci_init_perm_bits() will initialize the bits. While the last caller of vfio_pci_uninit_perm_bits() will free the bits. Cc: Kevin Tian Cc: Lu Baolu Suggested-by: Alex Williamson Signed-off-by: Liu Yi L --- drivers/vfio/pci/vfio_pci_config.c | 9 + 1 file changed, 9 insertions(+) diff --git a

RE: [PATCH v1 9/9] smaples: add vfio-mdev-pci driver

2019-07-11 Thread Liu, Yi L
Hi Alex, > From: kvm-ow...@vger.kernel.org [mailto:kvm-ow...@vger.kernel.org] On Behalf > Of Alex Williamson > Sent: Friday, July 5, 2019 11:55 PM > To: Liu, Yi L > Subject: Re: [PATCH v1 9/9] smaples: add vfio-mdev-pci driver > > On Thu, 4 Jul 2019 09:11:02 +

RE: [RFC v2 1/2] vfio/pci: export common symbols in vfio-pci

2019-03-23 Thread Liu, Yi L
> From: Alex Williamson [mailto:alex.william...@redhat.com] > Sent: Thursday, March 21, 2019 3:22 AM > To: Liu, Yi L > Subject: Re: [RFC v2 1/2] vfio/pci: export common symbols in vfio-pci > > On Wed, 20 Mar 2019 11:49:37 + > "Liu, Yi L" wrote:

[RFC v1 0/2] vfio/pci: wrap pci device as mdev with vfio-pci driver

2019-03-04 Thread Liu, Yi L
*) Link of "vfio/mdev: IOMMU aware mediated device" https://lwn.net/Articles/780522/ Liu, Yi L (2): vfio/pci: register vfio-pci driver to mdev framework vfio/pci: expose only mdev interface if in pci-mdev mode drivers/vfio/pci/vfio_pci.c | 199 +

[RFC v1 1/2] vfio/pci: register vfio-pci driver to mdev framework

2019-03-04 Thread Liu, Yi L
3b8f4f2-509f-382f-3c1e-e6bfe0fa1003/\ remove Cc: Kevin Tian Cc: Lu Baolu Signed-off-by: Liu, Yi L --- drivers/vfio/pci/vfio_pci.c | 180 1 file changed, 180 insertions(+) diff --git a/drivers/vfio/pci/vfio_pci.c b/drivers/vfio/pci/vfio_pci.c

[RFC v1 2/2] vfio/pci: expose only mdev interface if in pci-mdev mode

2019-03-04 Thread Liu, Yi L
in pci-mdev mode. Thus could prevent user from passthru device in legacy manner. Cc: Kevin Tian Cc: Lu Baolu Signed-off-by: Liu, Yi L --- drivers/vfio/pci/vfio_pci.c | 19 +-- 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/drivers/vfio/pci/vfio_pci.c b/drivers

  1   2   3   >