RE: [PATCH v18 3/3] vfio/nvgrace-gpu: Add vfio pci variant module for grace hopper

2024-02-17 Thread Tian, Kevin
> From: ank...@nvidia.com > Sent: Friday, February 16, 2024 11:01 AM > > From: Ankit Agrawal > > NVIDIA's upcoming Grace Hopper Superchip provides a PCI-like device > for the on-chip GPU that is the logical OS representation of the > internal proprietary chip-to-chip cache coherent

RE: [PATCH v17 3/3] vfio/nvgrace-gpu: Add vfio pci variant module for grace hopper

2024-02-07 Thread Tian, Kevin
> From: Ankit Agrawal > Sent: Thursday, February 8, 2024 3:13 PM > >> > +    * Determine how many bytes to be actually read from the > >> > device memory. > >> > +    * Read request beyond the actual device memory size is > >> > filled with ~0, > >> > +    * while those beyond the actual reported

RE: [PATCH v17 3/3] vfio/nvgrace-gpu: Add vfio pci variant module for grace hopper

2024-02-07 Thread Tian, Kevin
> From: ank...@nvidia.com > Sent: Tuesday, February 6, 2024 7:01 AM > > Note that the usemem memory is added by the VM Nvidia device driver [5] > to the VM kernel as memblocks. Hence make the usable memory size > memblock > aligned. Is memblock size defined in spec or purely a guest

RE: [PATCH v17 1/3] vfio/pci: rename and export do_io_rw()

2024-02-07 Thread Tian, Kevin
> From: ank...@nvidia.com > Sent: Tuesday, February 6, 2024 7:01 AM > > From: Ankit Agrawal > > do_io_rw() is used to read/write to the device MMIO. The grace hopper > VFIO PCI variant driver require this functionality to read/write to > its memory. > > Rename this as vfio_pci_core functions

RE: [PATCH v17 2/3] vfio/pci: rename and export range_intesect_range

2024-02-07 Thread Tian, Kevin
> From: ank...@nvidia.com > Sent: Tuesday, February 6, 2024 7:01 AM > > From: Ankit Agrawal > > range_intesect_range determines an overlap between two ranges. If an s/intesect/intersect/ > overlap, the helper function returns the overlapping offset and size. > > The VFIO PCI variant driver

RE: [PATCH] vfio: fix virtio-pci dependency

2024-01-09 Thread Tian, Kevin
> From: Arnd Bergmann > Sent: Tuesday, January 9, 2024 3:57 PM > > From: Arnd Bergmann > > The new vfio-virtio driver already has a dependency on > VIRTIO_PCI_ADMIN_LEGACY, > but that is a bool symbol and allows vfio-virtio to be built-in even if > virtio-pci itself is a loadable module. This

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

2021-04-07 Thread Tian, Kevin
> From: Jason Gunthorpe > Sent: Wednesday, April 7, 2021 8:21 PM > > On Wed, Apr 07, 2021 at 02:08:33AM +, Tian, Kevin wrote: > > > > Because if you don't then we enter insane world where a PASID is being > > > created under /dev/ioasid but its tra

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

2021-04-07 Thread Tian, Kevin
> From: Jason Gunthorpe > Sent: Tuesday, April 6, 2021 8:43 PM > > On Tue, Apr 06, 2021 at 09:35:17AM +0800, Jason Wang wrote: > > > > VFIO and VDPA has no buisness having map/unmap interfaces once we > have > > > /dev/ioasid. That all belongs in the iosaid side. > > > > > > I know they have

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

2021-04-06 Thread Tian, Kevin
> From: Jason Gunthorpe > Sent: Tuesday, April 6, 2021 8:21 PM > > On Tue, Apr 06, 2021 at 01:02:05AM +, Tian, Kevin wrote: > > > From: Jason Gunthorpe > > > Sent: Tuesday, April 6, 2021 7:40 AM > > > > > > On Fri, Apr 02, 2021 at 07:58:02AM

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

2021-04-06 Thread Tian, Kevin
> From: Jason Gunthorpe > Sent: Tuesday, April 6, 2021 8:35 PM > > On Tue, Apr 06, 2021 at 01:27:15AM +, Tian, Kevin wrote: > > > > and here is one example why using existing VFIO/VDPA interface makes > > sense. say dev1 (w/ sva) and dev2 (w/o sva) are placed

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

2021-04-05 Thread Tian, Kevin
> From: Tian, Kevin > Sent: Tuesday, April 6, 2021 9:02 AM > > > From: Jason Gunthorpe > > Sent: Tuesday, April 6, 2021 7:40 AM > > > > On Fri, Apr 02, 2021 at 07:58:02AM +, Tian, Kevin wrote: > > > > From: Jason Gunthorpe > > > > Sen

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

2021-04-05 Thread Tian, Kevin
> From: Jason Gunthorpe > Sent: Tuesday, April 6, 2021 7:43 AM > > On Fri, Apr 02, 2021 at 08:22:28AM +, Tian, Kevin wrote: > > > From: Jason Gunthorpe > > > Sent: Tuesday, March 30, 2021 9:29 PM > > > > > > > > > > > Fir

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

2021-04-05 Thread Tian, Kevin
> From: Jason Gunthorpe > Sent: Tuesday, April 6, 2021 7:40 AM > > On Fri, Apr 02, 2021 at 07:58:02AM +, Tian, Kevin wrote: > > > From: Jason Gunthorpe > > > Sent: Thursday, April 1, 2021 9:47 PM > > > > > > On Thu, Apr 01, 2021 at 01:43:36

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

2021-04-05 Thread Tian, Kevin
> From: Jason Gunthorpe > Sent: Tuesday, April 6, 2021 7:35 AM > > On Fri, Apr 02, 2021 at 07:30:23AM +, Tian, Kevin wrote: > > > From: Jason Gunthorpe > > > Sent: Friday, April 2, 2021 12:04 AM > > > > > > On Thu, Apr 01, 2021 at 02:08:17P

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

2021-04-02 Thread Tian, Kevin
> From: Tian, Kevin > Sent: Friday, April 2, 2021 3:58 PM > > > From: Jason Gunthorpe > > Sent: Thursday, April 1, 2021 9:47 PM > > > > On Thu, Apr 01, 2021 at 01:43:36PM +, Liu, Yi L wrote: > > > > From: Jason Gunthorpe > > > > Sen

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

2021-04-02 Thread Tian, Kevin
> From: Jason Gunthorpe > Sent: Tuesday, March 30, 2021 9:29 PM > > > > > First, userspace may use ioasid in a non-SVA scenario where ioasid is > > bound to specific security context (e.g. a control vq in vDPA) instead of > > tying to mm. In this case there is no pgtable binding initiated from

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

2021-04-02 Thread Tian, Kevin
> From: Jason Gunthorpe > Sent: Thursday, April 1, 2021 9:47 PM > > On Thu, Apr 01, 2021 at 01:43:36PM +, Liu, Yi L wrote: > > > From: Jason Gunthorpe > > > Sent: Thursday, April 1, 2021 9:16 PM > > > > > > On Thu, Apr 01, 2021 at 01:10:48PM +, Liu, Yi L wrote: > > > > > From: Jason

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

2021-04-02 Thread Tian, Kevin
> From: Jason Gunthorpe > Sent: Friday, April 2, 2021 12:04 AM > > On Thu, Apr 01, 2021 at 02:08:17PM +, Liu, Yi L wrote: > > > DMA page faults are delivered to root-complex via page request message > and > > it is per-device according to PCIe spec. Page request handling flow is: > > > > 1)

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

2021-03-29 Thread Tian, Kevin
> From: Tian, Kevin > Sent: Tuesday, March 30, 2021 10:24 AM > > > From: Jason Gunthorpe > > Sent: Tuesday, March 30, 2021 12:32 AM > > > In terms of usage for guest SVA, an ioasid_set is mostly tied to a host > > > mm, > > > the use

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

2021-03-29 Thread Tian, Kevin
> From: Jason Gunthorpe > Sent: Tuesday, March 30, 2021 12:32 AM > > In terms of usage for guest SVA, an ioasid_set is mostly tied to a host mm, > > the use case is as the following: > > From that doc: > > It is imperative to enforce > VM-IOASID ownership such that a malicious guest cannot

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

2021-03-29 Thread Tian, Kevin
> From: Jason Gunthorpe > Sent: Tuesday, March 30, 2021 12:32 AM > > On Wed, Mar 24, 2021 at 12:05:28PM -0700, Jacob Pan wrote: > > > > IMHO a use created PASID is either bound to a mm (current) at creation > > > time, or it will never be bound to a mm and its page table is under > > > user

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

2021-03-18 Thread Tian, Kevin
> From: Shenming Lu > Sent: Thursday, March 18, 2021 7:54 PM > > On 2021/3/18 17:07, Tian, Kevin wrote: > >> From: Shenming Lu > >> Sent: Thursday, March 18, 2021 3:53 PM > >> > >> On 2021/2/4 14:52, Tian, Kevin wrote:>>> In reality,

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

2021-03-18 Thread Tian, Kevin
> From: Shenming Lu > Sent: Thursday, March 18, 2021 3:53 PM > > On 2021/2/4 14:52, Tian, Kevin wrote:>>> In reality, many > >>> devices allow I/O faulting only in selective contexts. However, there > >>> is no standard way (e.g. PCISIG) for the devic

RE: A problem of Intel IOMMU hardware ?

2021-03-18 Thread Tian, Kevin
> From: Longpeng (Mike, Cloud Infrastructure Service Product Dept.) > > > > -Original Message- > > From: Tian, Kevin [mailto:kevin.t...@intel.com] > > Sent: Thursday, March 18, 2021 4:27 PM > > To: Longpeng (Mike, Cloud Infrastructure Service Produc

RE: A problem of Intel IOMMU hardware ?

2021-03-18 Thread Tian, Kevin
> From: Longpeng (Mike, Cloud Infrastructure Service Product Dept.) > > > > > -Original Message----- > > From: Tian, Kevin [mailto:kevin.t...@intel.com] > > Sent: Thursday, March 18, 2021 4:27 PM > > To: Longpeng (Mike, Cloud Infrastructure Service Pro

RE: A problem of Intel IOMMU hardware ?

2021-03-18 Thread Tian, Kevin
> From: iommu On Behalf Of > Longpeng (Mike, Cloud Infrastructure Service Product Dept.) > > > 2. Consider ensuring that the problem is not somehow related to queued > > invalidations. Try to use __iommu_flush_iotlb() instead of qi_flush_iotlb(). > > > > I tried to force to use

RE: [PATCH RFC v1 12/15] iommu/virtio: Add support for INVALIDATE request

2021-03-03 Thread Tian, Kevin
> From: Jacob Pan > Sent: Thursday, March 4, 2021 2:29 AM > > Hi Vivek, > > On Fri, 15 Jan 2021 17:43:39 +0530, Vivek Gautam > wrote: > > > From: Jean-Philippe Brucker > > > > Add support for tlb invalidation ops that can send invalidation > > requests to back-end virtio-iommu when stage-1

RE: [PATCH 2/4] iommu/vt-d: Enable write protect propagation from guest

2021-02-19 Thread Tian, Kevin
> From: Jacob Pan > Sent: Saturday, February 20, 2021 1:09 AM > > Hi Kevin, > > On Fri, 19 Feb 2021 06:19:04 +, "Tian, Kevin" > wrote: > > > > From: Jacob Pan > > > Sent: Friday, February 19, 2021 5:31 AM > > > > > &g

RE: [PATCH 2/4] iommu/vt-d: Enable write protect propagation from guest

2021-02-18 Thread Tian, Kevin
> From: Jacob Pan > Sent: Friday, February 19, 2021 5:31 AM > > Write protect bit, when set, inhibits supervisor writes to the read-only > pages. In guest supervisor shared virtual addressing (SVA), write-protect > should be honored upon guest bind supervisor PASID request. > > This patch

RE: [PATCH v5 05/14] vfio/mdev: idxd: add basic mdev registration and helper functions

2021-02-18 Thread Tian, Kevin
> From: Jason Gunthorpe > Sent: Wednesday, February 17, 2021 5:33 AM > > On Tue, Feb 16, 2021 at 12:04:55PM -0700, Dave Jiang wrote: > > > > > + return remap_pfn_range(vma, vma->vm_start, pgoff, req_size, > pg_prot); > > > Nothing validated req_size - did you copy this from the Intel RDMA

RE: [PATCH v2 0/9] Introduce vfio-pci-core subsystem

2021-02-09 Thread Tian, Kevin
Hi, Max, > From: Max Gurtovoy > Sent: Tuesday, February 2, 2021 12:28 AM > > Hi Alex and Cornelia, > > This series split the vfio_pci driver into 2 parts: pci driver and a > subsystem driver that will also be library of code. The pci driver, > vfio_pci.ko will be used as before and it will

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

2021-02-07 Thread Tian, Kevin
> From: Jean-Philippe Brucker > Sent: Friday, February 5, 2021 6:37 PM > > Hi, > > On Thu, Feb 04, 2021 at 06:52:10AM +, Tian, Kevin wrote: > > > >>> The static pinning and mapping problem in VFIO and possible > solutions > > > >>&g

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

2021-02-03 Thread Tian, Kevin
> 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:58 +0800 > >> Shenming

RE: [PATCH v2 3/3] iommu/vt-d: Apply SATC policy

2021-02-03 Thread Tian, Kevin
> From: Lu Baolu > Sent: Wednesday, February 3, 2021 5:33 PM > > From: Yian Chen > > Starting from Intel VT-d v3.2, Intel platform BIOS can provide a new SATC > table structure. SATC table lists a set of SoC integrated devices that > require ATC to work (VT-d specification v3.2, section 8.8).

RE: [RFC PATCH v2] uacce: Add uacce_ctrl misc device

2021-02-01 Thread Tian, Kevin
> From: Jason Gunthorpe > Sent: Tuesday, February 2, 2021 7:44 AM > > On Fri, Jan 29, 2021 at 10:09:03AM +, Tian, Kevin wrote: > > > SVA is not doom to work with IO page fault only. If we have SVA+pin, > > > we would get both sharing address and stable I/O

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

2021-02-01 Thread Tian, Kevin
> From: Alex Williamson > Sent: Saturday, January 30, 2021 6:58 AM > > On Mon, 25 Jan 2021 17:03:58 +0800 > Shenming Lu wrote: > > > Hi, > > > > The static pinning and mapping problem in VFIO and possible solutions > > have been discussed a lot [1, 2]. One of the solutions is to add I/O > >

RE: [PATCH 1/3] iommu/vt-d: Add rate limited information when PRQ overflows

2021-01-25 Thread Tian, Kevin
> From: Lu Baolu > Sent: Monday, January 25, 2021 2:29 PM > > Hi Kevin, > > On 2021/1/22 14:38, Tian, Kevin wrote: > >> From: Lu Baolu > >> Sent: Thursday, January 21, 2021 9:45 AM > >> > >> So that the uses could get chances to

RE: [PATCH 1/3] iommu/vt-d: Add rate limited information when PRQ overflows

2021-01-21 Thread Tian, Kevin
> From: Lu Baolu > Sent: Thursday, January 21, 2021 9:45 AM > > So that the uses could get chances to know what happened. > > Suggested-by: Ashok Raj > Signed-off-by: Lu Baolu > --- > drivers/iommu/intel/svm.c | 10 -- > 1 file changed, 8 insertions(+), 2 deletions(-) > > diff --git

RE: [RFC PATCH v3 2/2] platform-msi: Add platform check for subdevice irq domain

2021-01-13 Thread Tian, Kevin
> From: Lu Baolu > Sent: Thursday, January 14, 2021 9:30 AM > > The pci_subdevice_msi_create_irq_domain() should fail if the underlying > platform is not able to support IMS (Interrupt Message Storage). Otherwise, > the isolation of interrupt is not guaranteed. > > For x86, IMS is only supported

RE: [RFC PATCH v2 1/1] platform-msi: Add platform check for subdevice irq domain

2021-01-11 Thread Tian, Kevin
> From: Leon Romanovsky > Sent: Tuesday, January 12, 2021 1:53 PM > > On Tue, Jan 12, 2021 at 01:17:11PM +0800, Lu Baolu wrote: > > Hi, > > > > On 1/7/21 3:16 PM, Leon Romanovsky wrote: > > > On Thu, Jan 07, 2021 at 06:55:16AM +, Tian, Kevin

RE: [RFC PATCH 1/1] platform-msi: Add platform check for subdevice irq domain

2021-01-06 Thread Tian, Kevin
> From: David Woodhouse > Sent: Thursday, December 10, 2020 4:23 PM > > On Thu, 2020-12-10 at 08:46 +0800, Lu Baolu wrote: > > +/* > > + * We want to figure out which context we are running in. But the > hardware > > + * does not introduce a reliable way (instruction, CPUID leaf, MSR, >

RE: [RFC PATCH v2 1/1] platform-msi: Add platform check for subdevice irq domain

2021-01-06 Thread Tian, Kevin
> From: Leon Romanovsky > Sent: Thursday, January 7, 2021 2:09 PM > > On Thu, Jan 07, 2021 at 02:04:29AM +, Tian, Kevin wrote: > > > From: Leon Romanovsky > > > Sent: Thursday, January 7, 2021 12:02 AM > > > > > > On Wed, Jan 06,

RE: [RFC PATCH v2 1/1] platform-msi: Add platform check for subdevice irq domain

2021-01-06 Thread Tian, Kevin
> From: Leon Romanovsky > Sent: Thursday, January 7, 2021 12:02 AM > > On Wed, Jan 06, 2021 at 11:23:39AM -0400, Jason Gunthorpe wrote: > > On Wed, Jan 06, 2021 at 12:40:17PM +0200, Leon Romanovsky wrote: > > > > > I asked what will you do when QEMU will gain needed functionality? > > > Will you

RE: [PATCH v4 06/17] PCI: add SIOV and IMS capability detection

2020-11-16 Thread Tian, Kevin
> From: Jason Gunthorpe > Sent: Tuesday, November 17, 2020 2:03 AM > > On Mon, Nov 16, 2020 at 06:56:33PM +0100, Thomas Gleixner wrote: > > On Mon, Nov 16 2020 at 11:46, Jason Gunthorpe wrote: > > > > > On Mon, Nov 16, 2020 at 07:31:49AM +, Tian, Kevin wro

RE: [PATCH v4 06/17] PCI: add SIOV and IMS capability detection

2020-11-15 Thread Tian, Kevin
> From: Raj, Ashok > Sent: Monday, November 16, 2020 8:23 AM > > On Sun, Nov 15, 2020 at 11:11:27PM +0100, Thomas Gleixner wrote: > > On Sun, Nov 15 2020 at 11:31, Ashok Raj wrote: > > > On Sun, Nov 15, 2020 at 12:26:22PM +0100, Thomas Gleixner wrote: > > >> > opt-in by device or kernel? The way

RE: [PATCH v4 06/17] PCI: add SIOV and IMS capability detection

2020-11-12 Thread Tian, Kevin
> From: Thomas Gleixner > Sent: Friday, November 13, 2020 6:43 AM > > On Thu, Nov 12 2020 at 14:32, Konrad Rzeszutek Wilk wrote: > >> 4. Using CPUID to detect running as guest. But as Thomas pointed out, this > >> approach is less reliable as not all hypervisors do this way. > > > > Is that

RE: [PATCH v4 06/17] PCI: add SIOV and IMS capability detection

2020-11-10 Thread Tian, Kevin
> From: Raj, Ashok > Sent: Tuesday, November 10, 2020 10:13 PM > > Thomas, > > With all these interrupt message storms ;-), I'm missing how to move > towards > an end goal. > > On Tue, Nov 10, 2020 at 11:27:29AM +0100, Thomas Gleixner wrote: > > Ashok, > > > > On Mon, Nov 09 2020 at 21:14,

RE: [PATCH v4 06/17] PCI: add SIOV and IMS capability detection

2020-11-10 Thread Tian, Kevin
> From: Jason Gunthorpe > Sent: Tuesday, November 10, 2020 10:19 PM > On Mon, Nov 09, 2020 at 09:14:12PM -0800, Raj, Ashok wrote: > > > was used for interrupt message storage (on the wire they follow the > > same format), and also to ensure interoperability of devices > > supporting IMS across

RE: [PATCH v4 06/17] PCI: add SIOV and IMS capability detection

2020-11-10 Thread Tian, Kevin
> From: Jason Gunthorpe > Sent: Tuesday, November 10, 2020 10:24 PM > > On Tue, Nov 10, 2020 at 06:13:23AM -0800, Raj, Ashok wrote: > > > This isn't just for idxd, as I mentioned earlier, there are vendors other > > than Intel already working on this. In all cases the need for guest direct > >

RE: [PATCH v4 06/17] PCI: add SIOV and IMS capability detection

2020-11-08 Thread Tian, Kevin
> From: Raj, Ashok > Sent: Monday, November 9, 2020 7:59 AM > > Hi Thomas, > > [-] Jing, She isn't working at Intel anymore. > > Now this is getting compiled as a book :-).. Thanks a ton! > > One question on the hypercall case that isn't immediately > clear to me. > > On Sun, Nov 08, 2020 at

RE: [PATCH v4 06/17] PCI: add SIOV and IMS capability detection

2020-11-08 Thread Tian, Kevin
> From: Jason Gunthorpe > Sent: Monday, November 9, 2020 7:24 AM > > On Sun, Nov 08, 2020 at 07:47:24PM +0100, Thomas Gleixner wrote: > > > > That means the guest needs a way to ask the hypervisor for a proper > > translation, i.e. a hypercall. Now where to do that? Looking at the > > above

RE: [PATCH v4 06/17] PCI: add SIOV and IMS capability detection

2020-11-08 Thread Tian, Kevin
> -Original Message- > From: Thomas Gleixner > Sent: Saturday, November 7, 2020 8:32 AM > To: Tian, Kevin ; Jason Gunthorpe > Cc: Jiang, Dave ; Bjorn Helgaas ; > vk...@kernel.org; Dey, Megha ; m...@kernel.org; > bhelg...@google.com; alex.william...@redhat.com; P

RE: [PATCH v4 06/17] PCI: add SIOV and IMS capability detection

2020-11-06 Thread Tian, Kevin
> From: Jason Gunthorpe > Sent: Wednesday, November 4, 2020 9:54 PM > > On Wed, Nov 04, 2020 at 01:34:08PM +, Tian, Kevin wrote: > > > From: Jason Gunthorpe > > > Sent: Wednesday, November 4, 2020 8:40 PM > > > > > > On Wed, Nov

RE: [PATCH v4 06/17] PCI: add SIOV and IMS capability detection

2020-11-04 Thread Tian, Kevin
> From: Jason Gunthorpe > Sent: Wednesday, November 4, 2020 8:40 PM > > On Wed, Nov 04, 2020 at 03:41:33AM +, Tian, Kevin wrote: > > > From: Jason Gunthorpe > > > Sent: Tuesday, November 3, 2020 8:44 PM > > > > > > On Tue, Nov

RE: [PATCH v4 06/17] PCI: add SIOV and IMS capability detection

2020-11-03 Thread Tian, Kevin
> From: Jason Gunthorpe > Sent: Tuesday, November 3, 2020 8:44 PM > > On Tue, Nov 03, 2020 at 02:49:27AM +, Tian, Kevin wrote: > > > > There is a missing hypercall to allow the guest to do this on its own, > > > presumably it will someday b

RE: [PATCH v4 06/17] PCI: add SIOV and IMS capability detection

2020-11-02 Thread Tian, Kevin
> From: Jason Gunthorpe > Sent: Monday, November 2, 2020 9:22 PM > > On Fri, Oct 30, 2020 at 03:49:22PM -0700, Dave Jiang wrote: > > > > > > On 10/30/2020 3:45 PM, Jason Gunthorpe wrote: > > > On Fri, Oct 30, 2020 at 02:20:03PM -0700, Dave Jiang wrote: > > > > So the intel-iommu driver checks

RE: [PATCH v6 5/5] vfio/type1: Use mdev bus iommu_ops for IOMMU callbacks

2020-10-30 Thread Tian, Kevin
> From: Lu Baolu > Sent: Friday, October 30, 2020 12:58 PM > > With the IOMMU driver registering iommu_ops for the mdev_bus, the > IOMMU > operations on an mdev could be done in the same way as any normal device > (for example, PCI/PCIe). There's no need to distinguish an mdev from > others for

RE: [PATCH v6 4/5] iommu/vt-d: Add iommu_ops support for subdevice bus

2020-10-30 Thread Tian, Kevin
> From: Lu Baolu > Sent: Friday, October 30, 2020 12:58 PM > > The iommu_ops will only take effect when INTEL_IOMMU_SCALABLE_IOV > kernel > option is selected. It applies to any device passthrough framework which > implements an underlying bus for the subdevices. > > - Subdevice probe: > When

RE: [PATCH v6 2/5] iommu: Use bus iommu ops for aux related callback

2020-10-29 Thread Tian, Kevin
> From: Lu Baolu > Sent: Friday, October 30, 2020 12:58 PM > > The aux-domain apis were designed for macro driver where the subdevices > are created and used inside a device driver. Use the device's bus iommu > ops instead of that in iommu domain for various callbacks. IIRC there are only two

RE: [PATCH v2 1/1] iommu/vt-d: Use device numa domain if RHSA is missing

2020-09-03 Thread Tian, Kevin
> From: Lu Baolu > Sent: Friday, September 4, 2020 9:03 AM > > If there are multiple NUMA domains but the RHSA is missing in ACPI/DMAR > table, we could default to the device NUMA domain as fall back. This could > also benefit a vIOMMU use case where only single vIOMMU is exposed, > hence > no

RE: [PATCH v3] PCI: Introduce flag for detached virtual functions

2020-09-01 Thread Tian, Kevin
> From: kvm-ow...@vger.kernel.org On Behalf > Of Niklas Schnelle > Sent: Friday, August 28, 2020 5:10 PM > To: Bjorn Helgaas ; Alex Williamson > > [...] > >> > >> FWIW, pci_physfn() never returns NULL, it returns the provided pdev if > >> is_virtfn is not set. This proposal wouldn't change

RE: [PATCH 1/1] iommu/vt-d: Use device numa domain if RHSA is missing

2020-08-27 Thread Tian, Kevin
> From: Lu Baolu > Sent: Thursday, August 27, 2020 1:57 PM > > If there are multiple NUMA domains but the RHSA is missing in ACPI/DMAR > table, we could default to the device NUMA domain as fall back. This also > benefits the vIOMMU use case where only a single vIOMMU is exposed, > hence > no

RE: [PATCH v3 1/1] iommu/vt-d: Serialize IOMMU GCMD register modifications

2020-08-27 Thread Tian, Kevin
> From: Lu Baolu > Sent: Friday, August 28, 2020 8:06 AM > > The VT-d spec requires (10.4.4 Global Command Register, GCMD_REG > General > Description) that: > > If multiple control fields in this register need to be modified, software > must serialize the modifications through multiple writes

RE: [PATCH v2 1/1] iommu/vt-d: Serialize IOMMU GCMD register modifications

2020-08-26 Thread Tian, Kevin
> From: Lu Baolu > Sent: Thursday, August 27, 2020 12:25 PM > > The VT-d spec requires (10.4.4 Global Command Register, GCMD_REG > General > Description) that: > > If multiple control fields in this register need to be modified, software > must serialize the modifications through multiple

RE: [PATCH 1/1] iommu/vt-d: Serialize IOMMU GCMD register modifications

2020-08-25 Thread Tian, Kevin
> From: Lu Baolu > Sent: Wednesday, August 26, 2020 10:58 AM > > The VT-d spec requires (10.4.4 Global Command Register, GCMD_REG > General > Description) that: > > If multiple control fields in this register need to be modified, software > must serialize the modifications through multiple

RE: [PATCH RFC v2 00/18] Add VFIO mediated device support and DEV-MSI support for the idxd driver

2020-08-19 Thread Tian, Kevin
> From: Jason Gunthorpe > Sent: Tuesday, August 18, 2020 7:50 PM > > On Tue, Aug 18, 2020 at 01:09:01AM +, Tian, Kevin wrote: > > The difference in my reply is not just about the implementation gap > > of growing a userspace DMA framework to a passthrough fram

RE: [PATCH RFC v2 00/18] Add VFIO mediated device support and DEV-MSI support for the idxd driver

2020-08-17 Thread Tian, Kevin
> From: Jason Gunthorpe > Sent: Tuesday, August 18, 2020 8:44 AM > > On Mon, Aug 17, 2020 at 02:12:44AM +, Tian, Kevin wrote: > > > From: Jason Gunthorpe > > > Sent: Friday, August 14, 2020 9:35 PM > > > > > > On Mon, Aug 10, 2020 at 07:32:

RE: [PATCH RFC v2 00/18] Add VFIO mediated device support and DEV-MSI support for the idxd driver

2020-08-16 Thread Tian, Kevin
> From: Jason Gunthorpe > Sent: Friday, August 14, 2020 9:24 PM > > The same basic argument goes for all the points - the issue is really > the only uAPI we have for this stuff is under VFIO, and the better > solution is to disagregate that uAPI, not to try and make everything > pretend to be a

RE: [PATCH RFC v2 00/18] Add VFIO mediated device support and DEV-MSI support for the idxd driver

2020-08-16 Thread Tian, Kevin
> From: Jason Gunthorpe > Sent: Friday, August 14, 2020 9:35 PM > > On Mon, Aug 10, 2020 at 07:32:24AM +, Tian, Kevin wrote: > > > > I would prefer to see that the existing userspace interface have the > > > extra needed bits for virtualization (eg by having

RE: [PATCH RFC v2 00/18] Add VFIO mediated device support and DEV-MSI support for the idxd driver

2020-08-12 Thread Tian, Kevin
> From: Jason Wang > Sent: Thursday, August 13, 2020 12:34 PM > > > On 2020/8/12 下午12:05, Tian, Kevin wrote: > >> The problem is that if we tie all controls via VFIO uAPI, the other > >> subsystem like vDPA is likely to duplicate them. I wonder if there is a

RE: [PATCH RFC v2 00/18] Add VFIO mediated device support and DEV-MSI support for the idxd driver

2020-08-11 Thread Tian, Kevin
> From: Jason Wang > Sent: Wednesday, August 12, 2020 11:28 AM > > > On 2020/8/10 下午3:32, Tian, Kevin wrote: > >> From: Jason Gunthorpe > >> Sent: Friday, August 7, 2020 8:20 PM > >> > >> On Wed, Aug 05, 2020 at 07:22:58PM -0600, Alex Willi

RE: [PATCH RFC v2 00/18] Add VFIO mediated device support and DEV-MSI support for the idxd driver

2020-08-11 Thread Tian, Kevin
> From: Alex Williamson > Sent: Wednesday, August 12, 2020 10:36 AM > On Wed, 12 Aug 2020 01:58:00 +0000 > "Tian, Kevin" wrote: > > > > > > > I'll also remind folks that LPC is coming up in just a couple short > > > weeks and this might be som

RE: [PATCH RFC v2 00/18] Add VFIO mediated device support and DEV-MSI support for the idxd driver

2020-08-11 Thread Tian, Kevin
> From: Alex Williamson > Sent: Wednesday, August 12, 2020 1:01 AM > > On Mon, 10 Aug 2020 07:32:24 +0000 > "Tian, Kevin" wrote: > > > > From: Jason Gunthorpe > > > Sent: Friday, August 7, 2020 8:20 PM > > > > > >

RE: [PATCH RFC v2 00/18] Add VFIO mediated device support and DEV-MSI support for the idxd driver

2020-08-10 Thread Tian, Kevin
> From: Jason Gunthorpe > Sent: Friday, August 7, 2020 8:20 PM > > On Wed, Aug 05, 2020 at 07:22:58PM -0600, Alex Williamson wrote: > > > If you see this as an abuse of the framework, then let's identify those > > specific issues and come up with a better approach. As we've discussed > >

RE: [PATCH v3 3/4] iommu: Add iommu_aux_get_domain_for_dev()

2020-07-30 Thread Tian, Kevin
> From: Tian, Kevin > Sent: Friday, July 31, 2020 8:26 AM > > > From: Alex Williamson > > Sent: Friday, July 31, 2020 4:17 AM > > > > On Wed, 29 Jul 2020 23:49:20 + > > "Tian, Kevin" wrote: > > > > > > F

RE: [PATCH v3 3/4] iommu: Add iommu_aux_get_domain_for_dev()

2020-07-30 Thread Tian, Kevin
> From: Alex Williamson > Sent: Friday, July 31, 2020 4:17 AM > > On Wed, 29 Jul 2020 23:49:20 +0000 > "Tian, Kevin" wrote: > > > > From: Alex Williamson > > > Sent: Thursday, July 30, 2020 4:25 AM > > > > > > On Tue, 14 Jul 202

RE: [PATCH v3 3/4] iommu: Add iommu_aux_get_domain_for_dev()

2020-07-29 Thread Tian, Kevin
> From: Alex Williamson > Sent: Thursday, July 30, 2020 4:25 AM > > On Tue, 14 Jul 2020 13:57:02 +0800 > Lu Baolu wrote: > > > The device driver needs an API to get its aux-domain. A typical usage > > scenario is: > > > > unsigned long pasid; > > struct iommu_domain *domain; >

RE: [PATCH v3 2/4] iommu: Add iommu_aux_at(de)tach_group()

2020-07-29 Thread Tian, Kevin
> From: Alex Williamson > Sent: Thursday, July 30, 2020 4:04 AM > > On Thu, 16 Jul 2020 09:07:46 +0800 > Lu Baolu wrote: > > > Hi Jacob, > > > > On 7/16/20 12:01 AM, Jacob Pan wrote: > > > On Wed, 15 Jul 2020 08:47:36 +0800 > > > Lu Baolu wrote: > > > > > >> Hi Jacob, > > >> > > >> On 7/15/20

RE: [PATCH v6 1/6] docs: IOMMU user API

2020-07-28 Thread Tian, Kevin
> From: Alex Williamson > Sent: Wednesday, July 29, 2020 3:20 AM > [...] > > + > > +For example, IOTLB invalidations should always succeed. There is no > > +architectural way to report back to the vIOMMU if the UAPI data is > > +incompatible. If that happens, in order to guarantee IOMMU

RE: [PATCH RFC v2 00/18] Add VFIO mediated device support and DEV-MSI support for the idxd driver

2020-07-21 Thread Tian, Kevin
> From: Jason Gunthorpe > Sent: Wednesday, July 22, 2020 12:45 AM > > > Link to previous discussions with Jason: > > https://lore.kernel.org/lkml/57296ad1-20fe-caf2-b83f- > 46d823ca0...@intel.com/ > > The emulation part that can be moved to user space is very small due to > the majority of the >

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

2020-07-14 Thread Tian, Kevin
> From: Lu Baolu > Sent: Wednesday, July 15, 2020 9:00 AM > > Hi Christoph and Jacob, > > On 7/15/20 12:29 AM, Jacob Pan wrote: > > On Tue, 14 Jul 2020 09:25:14 +0100 > > Christoph Hellwig wrote: > > > >> On Tue, Jul 14, 2020 at 01:57:03PM +0800, Lu Baolu wrote: > >>> Replace

RE: [PATCH v3 4/4] iommu/vt-d: Add page response ops support

2020-07-09 Thread Tian, Kevin
> From: Lu Baolu > Sent: Friday, July 10, 2020 1:37 PM > > Hi Kevin, > > On 2020/7/10 10:42, Tian, Kevin wrote: > >> From: Lu Baolu > >> Sent: Thursday, July 9, 2020 3:06 PM > >> > >> After page requests are handled, software must re

RE: [PATCH v3 4/4] iommu/vt-d: Add page response ops support

2020-07-09 Thread Tian, Kevin
> From: Lu Baolu > Sent: Thursday, July 9, 2020 3:06 PM > > After page requests are handled, software must respond to the device > which raised the page request with the result. This is done through > the iommu ops.page_response if the request was reported to outside of > vendor iommu driver

RE: [PATCH v3 3/4] iommu/vt-d: Report page request faults for guest SVA

2020-07-09 Thread Tian, Kevin
> From: Lu Baolu > Sent: Thursday, July 9, 2020 3:06 PM > > A pasid might be bound to a page table from a VM guest via the iommu > ops.sva_bind_gpasid. In this case, when a DMA page fault is detected > on the physical IOMMU, we need to inject the page fault request into > the guest. After the

RE: [PATCH v3 06/14] vfio/type1: Add VFIO_IOMMU_PASID_REQUEST (alloc/free)

2020-07-08 Thread Tian, Kevin
> From: Liu, Yi L > Sent: Thursday, July 9, 2020 10:08 AM > > Hi Kevin, > > > From: Tian, Kevin > > Sent: Thursday, July 9, 2020 9:57 AM > > > > > From: Liu, Yi L > > > Sent: Thursday, July 9, 2020 8:32 AM > > > > > > H

RE: [PATCH v3 06/14] vfio/type1: Add VFIO_IOMMU_PASID_REQUEST (alloc/free)

2020-07-08 Thread Tian, Kevin
> From: Liu, Yi L > Sent: Thursday, July 9, 2020 8:32 AM > > Hi Alex, > > > Alex Williamson > > Sent: Thursday, July 9, 2020 3:55 AM > > > > On Wed, 8 Jul 2020 08:16:16 + > > "Liu, Yi L" wrote: > > > > > Hi Alex, > > > > > > > From: Liu, Yi L < yi.l@intel.com> > > > > Sent: Friday,

RE: [PATCH v2 4/4] iommu/vt-d: Add page response ops support

2020-07-05 Thread Tian, Kevin
> From: Lu Baolu > Sent: Monday, July 6, 2020 8:26 AM > > After a page request is handled, software must response the device which > raised the page request with the handling result. This is done through 'response' is a noun. > the iommu ops.page_response if the request was reported to outside

RE: [PATCH v2 3/4] iommu/vt-d: Report page request faults for guest SVA

2020-07-05 Thread Tian, Kevin
> From: Tian, Kevin > Sent: Monday, July 6, 2020 9:30 AM > > > From: Lu Baolu > > Sent: Monday, July 6, 2020 8:26 AM > > > > A pasid might be bound to a page table from a VM guest via the iommu > > ops.sva_bind_gpasid. In this case, when a DMA page fault is

RE: [PATCH v2 3/4] iommu/vt-d: Report page request faults for guest SVA

2020-07-05 Thread Tian, Kevin
> From: Lu Baolu > Sent: Monday, July 6, 2020 8:26 AM > > A pasid might be bound to a page table from a VM guest via the iommu > ops.sva_bind_gpasid. In this case, when a DMA page fault is detected > on the physical IOMMU, we need to inject the page fault request into > the guest. After the

RE: [PATCH v2 2/4] iommu/vt-d: Add a helper to get svm and sdev for pasid

2020-07-05 Thread Tian, Kevin
> From: Lu Baolu > Sent: Monday, July 6, 2020 8:26 AM > > There are several places in the code that need to get the pointers of > svm and sdev according to a pasid and device. Add a helper to achieve > this for code consolidation and readability. > > Signed-off-by: Lu Baolu > --- >

RE: [PATCH v2 1/4] iommu/vt-d: Refactor device_to_iommu() helper

2020-07-05 Thread Tian, Kevin
> From: Lu Baolu > Sent: Monday, July 6, 2020 8:26 AM > > It is refactored in two ways: > > - Make it global so that it could be used in other files. > > - Make bus/devfn optional so that callers could ignore these two returned > values when they only want to get the coresponding iommu

RE: [PATCH 4/4] iommu/vt-d: Add page response ops support

2020-06-30 Thread Tian, Kevin
> From: Lu Baolu > Sent: Sunday, June 28, 2020 8:34 AM > > After a page request is handled, software must response the device which > raised the page request with the handling result. This is done through > the iommu ops.page_response if the request was reported to outside of > vendor iommu

RE: [PATCH 3/4] iommu/vt-d: Report page request faults for guest SVA

2020-06-30 Thread Tian, Kevin
> From: Lu Baolu > Sent: Sunday, June 28, 2020 8:34 AM > > A pasid might be bound to a page table from a VM guest via the iommu > ops.sva_bind_gpasid. In this case, when a DMA page fault is detected > on the physical IOMMU, we need to inject the page fault request into > the guest. After the

RE: [PATCH 3/7] iommu/vt-d: Fix PASID devTLB invalidation

2020-06-29 Thread Tian, Kevin
> From: Lu Baolu > Sent: Thursday, June 25, 2020 3:26 PM > > On 2020/6/23 23:43, Jacob Pan wrote: > > DevTLB flush can be used for both DMA request with and without PASIDs. > > The former uses PASID#0 (RID2PASID), latter uses non-zero PASID for SVA > > usage. > > > > This patch adds a check for

RE: [PATCH v3 1/5] docs: IOMMU user API

2020-06-29 Thread Tian, Kevin
> From: Jacob Pan > Sent: Tuesday, June 30, 2020 7:05 AM > > On Fri, 26 Jun 2020 16:19:23 -0600 > Alex Williamson wrote: > > > On Tue, 23 Jun 2020 10:03:53 -0700 > > Jacob Pan wrote: > > > > > IOMMU UAPI is newly introduced to support communications between > > > guest virtual IOMMU and host

RE: [PATCH v3 02/14] iommu: Report domain nesting info

2020-06-29 Thread Tian, Kevin
> From: Liu, Yi L > Sent: Monday, June 29, 2020 8:23 PM > > Hi Stefan, > > > From: Stefan Hajnoczi > > Sent: Monday, June 29, 2020 5:25 PM > > > > On Wed, Jun 24, 2020 at 01:55:15AM -0700, Liu Yi L wrote: > > > +/* > > > + * struct iommu_nesting_info - Information for nesting-capable IOMMU. >

RE: [PATCH v3 02/14] iommu: Report domain nesting info

2020-06-29 Thread Tian, Kevin
> From: Liu, Yi L > Sent: Saturday, June 27, 2020 2:53 PM > > Hi Robin, > > > From: Robin Murphy > > Sent: Saturday, June 27, 2020 12:05 AM > > > > On 2020-06-26 08:47, Jean-Philippe Brucker wrote: > > > On Wed, Jun 24, 2020 at 01:55:15AM -0700, Liu Yi L wrote: > > >> IOMMUs that support

RE: [PATCH v2 1/3] docs: IOMMU user API

2020-06-17 Thread Tian, Kevin
> From: Liu, Yi L > Sent: Wednesday, June 17, 2020 2:20 PM > > > From: Jacob Pan > > Sent: Tuesday, June 16, 2020 11:22 PM > > > > On Thu, 11 Jun 2020 17:27:27 -0700 > > Jacob Pan wrote: > > > > > > > > > > But then I thought it even better if VFIO leaves the entire > > > > copy_from_user() to

RE: [PATCH v2 00/15] vfio: expose virtual Shared Virtual Addressing to VMs

2020-06-15 Thread Tian, Kevin
> From: Stefan Hajnoczi > Sent: Monday, June 15, 2020 6:02 PM > > On Thu, Jun 11, 2020 at 05:15:19AM -0700, Liu Yi L wrote: > > Shared Virtual Addressing (SVA), a.k.a, Shared Virtual Memory (SVM) on > > Intel platforms allows address space sharing between device DMA and > > applications. SVA can

RE: [PATCH v2 02/15] iommu: Report domain nesting info

2020-06-15 Thread Tian, Kevin
> From: Liu, Yi L > Sent: Monday, June 15, 2020 2:05 PM > > Hi Kevin, > > > From: Tian, Kevin > > Sent: Monday, June 15, 2020 9:23 AM > > > > > From: Liu, Yi L > > > Sent: Friday, June 12, 2020 5:05 PM > > > > > > Hi Ale

  1   2   3   >