Re: [PATCH 5/8] x86/mmu: Add mm-based PASID refcounting

2021-09-22 Thread Lu Baolu
Hi Fenghua, On 9/21/21 3:23 AM, Fenghua Yu wrote: PASIDs are fundamentally hardware resources in a shared address space. There is a limited number of them to use ENQCMD on shared workqueue. They must be shared and managed. They can not, for instance, be statically allocated to processes. Free

[PATCH AUTOSEL 5.14 08/34] dma-debug: prevent an error message from causing runtime problems

2021-09-22 Thread Sasha Levin
From: Hamza Mahfooz [ Upstream commit 510e1a724ab1bf38150be2c1acabb303f98d0047 ] For some drivers, that use the DMA API. This error message can be reached several millions of times per second, causing spam to the kernel's printk buffer and bringing the CPU usage up to 100% (so, it should be

RE: [RFC 10/20] iommu/iommufd: Add IOMMU_DEVICE_GET_INFO

2021-09-22 Thread Tian, Kevin
> From: Tian, Kevin > Sent: Thursday, September 23, 2021 11:11 AM > > > > > The required behavior for iommufd is to have the IOMMU ignore the > > no-snoop bit so that Intel HW can disable wbinvd. This bit should be > > clearly documented for its exact purpose and if other arches also have > >

RE: [RFC 10/20] iommu/iommufd: Add IOMMU_DEVICE_GET_INFO

2021-09-22 Thread Tian, Kevin
> From: Jason Gunthorpe > Sent: Thursday, September 23, 2021 7:50 AM > > On Wed, Sep 22, 2021 at 03:24:07PM -0600, Alex Williamson wrote: > > On Sun, 19 Sep 2021 14:38:38 +0800 > > Liu Yi L wrote: > > > > > +struct iommu_device_info { > > > + __u32 argsz; > > > + __u32 flags; > > > +#define

RE: [RFC 03/20] vfio: Add vfio_[un]register_device()

2021-09-22 Thread Tian, Kevin
> From: Jason Gunthorpe > Sent: Thursday, September 23, 2021 7:52 AM > > On Wed, Sep 22, 2021 at 11:45:33PM +, Tian, Kevin wrote: > > > From: Alex Williamson > > > btw I realized another related piece regarding to the new layout that > > Jason suggested, which have sys device node include

Re: [RFC 03/20] vfio: Add vfio_[un]register_device()

2021-09-22 Thread Jason Gunthorpe via iommu
On Wed, Sep 22, 2021 at 02:10:36PM -0600, Alex Williamson wrote: > But why would we create vfio device interface files at all if they > can't work? I'm not really on board with creating a try-and-fail > interface for a mechanism that cannot work for a given device. The > existence of the device

Re: [RFC 03/20] vfio: Add vfio_[un]register_device()

2021-09-22 Thread Jason Gunthorpe via iommu
On Wed, Sep 22, 2021 at 11:45:33PM +, Tian, Kevin wrote: > > From: Alex Williamson > btw I realized another related piece regarding to the new layout that > Jason suggested, which have sys device node include a link to the vfio > devnode: > >

Re: [RFC 10/20] iommu/iommufd: Add IOMMU_DEVICE_GET_INFO

2021-09-22 Thread Jason Gunthorpe via iommu
On Wed, Sep 22, 2021 at 03:24:07PM -0600, Alex Williamson wrote: > On Sun, 19 Sep 2021 14:38:38 +0800 > Liu Yi L wrote: > > > +struct iommu_device_info { > > + __u32 argsz; > > + __u32 flags; > > +#define IOMMU_DEVICE_INFO_ENFORCE_SNOOP(1 << 0) /* IOMMU enforced > > snoop */ > > Is

RE: [RFC 05/20] vfio/pci: Register device to /dev/vfio/devices

2021-09-22 Thread Tian, Kevin
> From: Alex Williamson > Sent: Thursday, September 23, 2021 5:17 AM > > On Wed, 22 Sep 2021 01:19:08 + > "Tian, Kevin" wrote: > > > > From: Alex Williamson > > > Sent: Wednesday, September 22, 2021 5:09 AM > > > > > > On Tue, 21 Sep 2021 13:40:01 -0300 > > > Jason Gunthorpe wrote: > > >

RE: [RFC 03/20] vfio: Add vfio_[un]register_device()

2021-09-22 Thread Tian, Kevin
> From: Alex Williamson > Sent: Thursday, September 23, 2021 6:45 AM > > On Wed, 22 Sep 2021 22:34:42 + > "Tian, Kevin" wrote: > > > > From: Alex Williamson > > > Sent: Thursday, September 23, 2021 4:11 AM > > > > > > On Wed, 22 Sep 2021 09:22:52 -0300 > > > Jason Gunthorpe wrote: > > >

Re: [PATCH 7/8] tools/objtool: Check for use of the ENQCMD instruction in the kernel

2021-09-22 Thread Fenghua Yu
Hi, Peter, On Wed, Sep 22, 2021 at 11:03:43PM +0200, Peter Zijlstra wrote: > On Mon, Sep 20, 2021 at 07:23:48PM +, Fenghua Yu wrote: > > + ret = validate_enqcmd(file); > > + if (ret < 0) > > + goto out; > > + warnings += ret; > > + > > if (vmlinux && !validate_dup) { > >

Re: [PATCH 4/8] x86/traps: Demand-populate PASID MSR via #GP

2021-09-22 Thread Fenghua Yu
Hi, Peter, On Wed, Sep 22, 2021 at 11:07:22PM +0200, Peter Zijlstra wrote: > On Mon, Sep 20, 2021 at 07:23:45PM +, Fenghua Yu wrote: > > > > + if (user_mode(regs) && fixup_pasid_exception()) > > + goto exit; > > + > > if (static_cpu_has(X86_FEATURE_UMIP)) { > >

Re: [RFC 08/20] vfio/pci: Add VFIO_DEVICE_BIND_IOMMUFD

2021-09-22 Thread Jason Gunthorpe via iommu
On Wed, Sep 22, 2021 at 03:01:01PM -0600, Alex Williamson wrote: > On Tue, 21 Sep 2021 14:29:39 -0300 > Jason Gunthorpe wrote: > > > On Sun, Sep 19, 2021 at 02:38:36PM +0800, Liu Yi L wrote: > > > +struct vfio_device_iommu_bind_data { > > > + __u32 argsz; > > > + __u32 flags; > > > + __s32

Re: [RFC 03/20] vfio: Add vfio_[un]register_device()

2021-09-22 Thread Alex Williamson
On Wed, 22 Sep 2021 22:34:42 + "Tian, Kevin" wrote: > > From: Alex Williamson > > Sent: Thursday, September 23, 2021 4:11 AM > > > > On Wed, 22 Sep 2021 09:22:52 -0300 > > Jason Gunthorpe wrote: > > > > > On Wed, Sep 22, 2021 at 09:23:34AM +, Tian, Kevin wrote: > > > > > > > >

RE: [RFC 03/20] vfio: Add vfio_[un]register_device()

2021-09-22 Thread Tian, Kevin
> From: Alex Williamson > Sent: Thursday, September 23, 2021 4:11 AM > > On Wed, 22 Sep 2021 09:22:52 -0300 > Jason Gunthorpe wrote: > > > On Wed, Sep 22, 2021 at 09:23:34AM +, Tian, Kevin wrote: > > > > > > Providing an ioctl to bind to a normal VFIO container or group might > > > > allow

[PATCH 1/3] iommu/io-pgtable-arm: Add way to debug pgtable walk

2021-09-22 Thread Rob Clark
From: Rob Clark Add an io-pgtable method to retrieve the raw PTEs that would be traversed for a given iova access. Signed-off-by: Rob Clark --- drivers/iommu/io-pgtable-arm.c | 40 +++--- include/linux/io-pgtable.h | 9 2 files changed, 41

[PATCH 0/3] io-pgtable-arm + drm/msm: Extend iova fault debugging

2021-09-22 Thread Rob Clark
From: Rob Clark This series extends io-pgtable-arm with a method to retrieve the page table entries traversed in the process of address translation, and then beefs up drm/msm gpu devcore dump to include this (and additional info) in the devcore dump. The motivation is tracking down an obscure

Re: [PATCH 4/8] x86/traps: Demand-populate PASID MSR via #GP

2021-09-22 Thread Fenghua Yu
Hi, Peter, On Wed, Sep 22, 2021 at 11:11:45PM +0200, Peter Zijlstra wrote: > On Wed, Sep 22, 2021 at 11:07:22PM +0200, Peter Zijlstra wrote: > > On Mon, Sep 20, 2021 at 07:23:45PM +, Fenghua Yu wrote: > > > +static bool fixup_pasid_exception(void) > > > +{ > > > + if

Re: [PATCH 4/8] x86/traps: Demand-populate PASID MSR via #GP

2021-09-22 Thread Dave Hansen
On 9/22/21 2:11 PM, Peter Zijlstra wrote: >>> +static bool fixup_pasid_exception(void) >>> +{ >>> + if (!cpu_feature_enabled(X86_FEATURE_ENQCMD)) >>> + return false; >>> + >>> + return __fixup_pasid_exception(); >>> +} > That is, shouldn't the above at the very least decode the

RE: [PATCH 4/8] x86/traps: Demand-populate PASID MSR via #GP

2021-09-22 Thread Luck, Tony
>> > +static bool fixup_pasid_exception(void) >> > +{ >> > + if (!cpu_feature_enabled(X86_FEATURE_ENQCMD)) >> > + return false; >> > + >> > + return __fixup_pasid_exception(); >> > +} > > That is, shouldn't the above at the very least decode the instruction > causing the #GP and check

Re: [RFC 10/20] iommu/iommufd: Add IOMMU_DEVICE_GET_INFO

2021-09-22 Thread Alex Williamson
On Sun, 19 Sep 2021 14:38:38 +0800 Liu Yi L wrote: > +struct iommu_device_info { > + __u32 argsz; > + __u32 flags; > +#define IOMMU_DEVICE_INFO_ENFORCE_SNOOP (1 << 0) /* IOMMU enforced > snoop */ Is this too PCI specific, or perhaps too much of the mechanism rather than the

Re: [RFC 05/20] vfio/pci: Register device to /dev/vfio/devices

2021-09-22 Thread Alex Williamson
On Wed, 22 Sep 2021 01:19:08 + "Tian, Kevin" wrote: > > From: Alex Williamson > > Sent: Wednesday, September 22, 2021 5:09 AM > > > > On Tue, 21 Sep 2021 13:40:01 -0300 > > Jason Gunthorpe wrote: > > > > > On Sun, Sep 19, 2021 at 02:38:33PM +0800, Liu Yi L wrote: > > > > This patch

Re: [PATCH 4/8] x86/traps: Demand-populate PASID MSR via #GP

2021-09-22 Thread Peter Zijlstra
On Wed, Sep 22, 2021 at 11:07:22PM +0200, Peter Zijlstra wrote: > On Mon, Sep 20, 2021 at 07:23:45PM +, Fenghua Yu wrote: > > diff --git a/arch/x86/kernel/traps.c b/arch/x86/kernel/traps.c > > index a58800973aed..a25d738ae839 100644 > > --- a/arch/x86/kernel/traps.c > > +++

Re: [PATCH 4/8] x86/traps: Demand-populate PASID MSR via #GP

2021-09-22 Thread Peter Zijlstra
On Mon, Sep 20, 2021 at 07:23:45PM +, Fenghua Yu wrote: > diff --git a/arch/x86/kernel/traps.c b/arch/x86/kernel/traps.c > index a58800973aed..a25d738ae839 100644 > --- a/arch/x86/kernel/traps.c > +++ b/arch/x86/kernel/traps.c > @@ -61,6 +61,7 @@ > #include > #include > #include >

Re: [PATCH v3 5/8] x86/sme: Replace occurrences of sme_active() with cc_platform_has()

2021-09-22 Thread Kirill A. Shutemov
On Wed, Sep 22, 2021 at 09:52:07PM +0200, Borislav Petkov wrote: > On Wed, Sep 22, 2021 at 05:30:15PM +0300, Kirill A. Shutemov wrote: > > Not fine, but waiting to blowup with random build environment change. > > Why is it not fine? > > Are you suspecting that the compiler might generate

Re: [PATCH 7/8] tools/objtool: Check for use of the ENQCMD instruction in the kernel

2021-09-22 Thread Peter Zijlstra
On Mon, Sep 20, 2021 at 07:23:48PM +, Fenghua Yu wrote: > diff --git a/tools/objtool/check.c b/tools/objtool/check.c > index e5947fbb9e7a..91d13521d9d6 100644 > --- a/tools/objtool/check.c > +++ b/tools/objtool/check.c > @@ -3133,6 +3133,21 @@ static int

Re: [RFC 08/20] vfio/pci: Add VFIO_DEVICE_BIND_IOMMUFD

2021-09-22 Thread Alex Williamson
On Tue, 21 Sep 2021 14:29:39 -0300 Jason Gunthorpe wrote: > On Sun, Sep 19, 2021 at 02:38:36PM +0800, Liu Yi L wrote: > > +struct vfio_device_iommu_bind_data { > > + __u32 argsz; > > + __u32 flags; > > + __s32 iommu_fd; > > + __u64 dev_cookie; > > Missing explicit padding > >

Re: [RFC 03/20] vfio: Add vfio_[un]register_device()

2021-09-22 Thread Alex Williamson
On Wed, 22 Sep 2021 09:22:52 -0300 Jason Gunthorpe wrote: > On Wed, Sep 22, 2021 at 09:23:34AM +, Tian, Kevin wrote: > > > > Providing an ioctl to bind to a normal VFIO container or group might > > > allow a reasonable fallback in userspace.. > > > > I didn't get this point though. An

Re: [PATCH v3 5/8] x86/sme: Replace occurrences of sme_active() with cc_platform_has()

2021-09-22 Thread Borislav Petkov
On Wed, Sep 22, 2021 at 05:30:15PM +0300, Kirill A. Shutemov wrote: > Not fine, but waiting to blowup with random build environment change. Why is it not fine? Are you suspecting that the compiler might generate something else and not a rip-relative access? -- Regards/Gruss, Boris.

Re: [RFC 0/7] Support in-kernel DMA with PASID and SVA

2021-09-22 Thread Jason Gunthorpe via iommu
On Tue, Sep 21, 2021 at 01:29:34PM -0700, Jacob Pan wrote: > Hi Joerg/Jason/Christoph et all, > > The current in-kernel supervisor PASID support is based on the SVM/SVA > machinery in sva-lib. Kernel SVA is achieved by extending a special flag > to indicate the binding of the device and a page

Re: [RFC 17/20] iommu/iommufd: Report iova range to userspace

2021-09-22 Thread Jean-Philippe Brucker
On Sun, Sep 19, 2021 at 02:38:45PM +0800, Liu Yi L wrote: > [HACK. will fix in v2] > > IOVA range is critical info for userspace to manage DMA for an I/O address > space. This patch reports the valid iova range info of a given device. > > Due to aforementioned hack, this info comes from the

Re: [PATCH v3 5/8] x86/sme: Replace occurrences of sme_active() with cc_platform_has()

2021-09-22 Thread Kirill A. Shutemov
On Wed, Sep 22, 2021 at 08:40:43AM -0500, Tom Lendacky wrote: > On 9/21/21 4:58 PM, Kirill A. Shutemov wrote: > > On Tue, Sep 21, 2021 at 04:43:59PM -0500, Tom Lendacky wrote: > > > On 9/21/21 4:34 PM, Kirill A. Shutemov wrote: > > > > On Tue, Sep 21, 2021 at 11:27:17PM +0200, Borislav Petkov

RE: [RFC 09/20] iommu: Add page size and address width attributes

2021-09-22 Thread Tian, Kevin
> From: Eric Auger > Sent: Wednesday, September 22, 2021 9:43 PM > > Hi, > > On 9/19/21 8:38 AM, Liu Yi L wrote: > > From: Lu Baolu > > > > This exposes PAGE_SIZE and ADDR_WIDTH attributes. The iommufd could > use > > them to define the IOAS. > > > > Signed-off-by: Lu Baolu > > --- > >

RE: [RFC 15/20] vfio/pci: Add VFIO_DEVICE_[DE]ATTACH_IOASID

2021-09-22 Thread Tian, Kevin
> From: Jason Gunthorpe > Sent: Wednesday, September 22, 2021 8:59 PM > > On Wed, Sep 22, 2021 at 03:56:18AM +, Tian, Kevin wrote: > > > From: Jason Gunthorpe > > > Sent: Wednesday, September 22, 2021 2:04 AM > > > > > > On Sun, Sep 19, 2021 at 02:38:43PM +0800, Liu Yi L wrote: > > > > This

RE: [RFC 14/20] iommu/iommufd: Add iommufd_device_[de]attach_ioasid()

2021-09-22 Thread Tian, Kevin
> From: Jason Gunthorpe > Sent: Wednesday, September 22, 2021 8:57 PM > > On Wed, Sep 22, 2021 at 03:53:52AM +, Tian, Kevin wrote: > > > Actually this was one open we closed in previous design proposal, but > > looks you have a different thought now. > > > > vfio maintains one ioas per

Re: [RFC 01/20] iommu/iommufd: Add /dev/iommu core

2021-09-22 Thread Jason Gunthorpe via iommu
On Wed, Sep 22, 2021 at 01:59:39PM +, Tian, Kevin wrote: > > From: Jason Gunthorpe > > Sent: Wednesday, September 22, 2021 8:41 PM > > > > On Wed, Sep 22, 2021 at 01:51:03AM +, Tian, Kevin wrote: > > > > From: Jason Gunthorpe > > > > Sent: Tuesday, September 21, 2021 11:42 PM > > > > >

RE: [RFC 02/20] vfio: Add device class for /dev/vfio/devices

2021-09-22 Thread Tian, Kevin
> From: Jason Gunthorpe > Sent: Wednesday, September 22, 2021 8:51 PM > > On Wed, Sep 22, 2021 at 03:22:42AM +, Tian, Kevin wrote: > > > From: Tian, Kevin > > > Sent: Wednesday, September 22, 2021 9:07 AM > > > > > > > From: Jason Gunthorpe > > > > Sent: Wednesday, September 22, 2021 8:55

Re: [RFC 11/20] iommu/iommufd: Add IOMMU_IOASID_ALLOC/FREE

2021-09-22 Thread Jason Gunthorpe via iommu
On Wed, Sep 22, 2021 at 03:40:25AM +, Tian, Kevin wrote: > > From: Jason Gunthorpe > > Sent: Wednesday, September 22, 2021 1:45 AM > > > > On Sun, Sep 19, 2021 at 02:38:39PM +0800, Liu Yi L wrote: > > > This patch adds IOASID allocation/free interface per iommufd. When > > > allocating an

RE: [RFC 01/20] iommu/iommufd: Add /dev/iommu core

2021-09-22 Thread Tian, Kevin
> From: Jason Gunthorpe > Sent: Wednesday, September 22, 2021 8:41 PM > > On Wed, Sep 22, 2021 at 01:51:03AM +, Tian, Kevin wrote: > > > From: Jason Gunthorpe > > > Sent: Tuesday, September 21, 2021 11:42 PM > > > > > > - Delete the iommufd_ctx->lock. Use RCU to protect load, erase/alloc >

RE: [RFC 06/20] iommu: Add iommu_device_init[exit]_user_dma interfaces

2021-09-22 Thread Tian, Kevin
> From: Jason Gunthorpe > Sent: Wednesday, September 22, 2021 8:40 PM > > On Wed, Sep 22, 2021 at 01:47:05AM +, Tian, Kevin wrote: > > > > IIRC in VFIO the container is the IOAS and when the group goes to > > > create the device fd it should simply do the > > > iommu_device_init_user_dma()

Re: [RFC 11/20] iommu/iommufd: Add IOMMU_IOASID_ALLOC/FREE

2021-09-22 Thread Jean-Philippe Brucker
On Sun, Sep 19, 2021 at 02:38:39PM +0800, Liu Yi L wrote: > This patch adds IOASID allocation/free interface per iommufd. When > allocating an IOASID, userspace is expected to specify the type and > format information for the target I/O page table. > > This RFC supports only one type

RE: [RFC 03/20] vfio: Add vfio_[un]register_device()

2021-09-22 Thread Tian, Kevin
> From: Jason Gunthorpe > Sent: Wednesday, September 22, 2021 8:23 PM > > On Wed, Sep 22, 2021 at 09:23:34AM +, Tian, Kevin wrote: > > > > Providing an ioctl to bind to a normal VFIO container or group might > > > allow a reasonable fallback in userspace.. > > > > I didn't get this point

Re: [RFC 09/20] iommu: Add page size and address width attributes

2021-09-22 Thread Eric Auger
Hi, On 9/19/21 8:38 AM, Liu Yi L wrote: > From: Lu Baolu > > This exposes PAGE_SIZE and ADDR_WIDTH attributes. The iommufd could use > them to define the IOAS. > > Signed-off-by: Lu Baolu > --- > include/linux/iommu.h | 4 > 1 file changed, 4 insertions(+) > > diff --git

Re: [PATCH v3 5/8] x86/sme: Replace occurrences of sme_active() with cc_platform_has()

2021-09-22 Thread Tom Lendacky via iommu
On 9/21/21 4:58 PM, Kirill A. Shutemov wrote: On Tue, Sep 21, 2021 at 04:43:59PM -0500, Tom Lendacky wrote: On 9/21/21 4:34 PM, Kirill A. Shutemov wrote: On Tue, Sep 21, 2021 at 11:27:17PM +0200, Borislav Petkov wrote: On Wed, Sep 22, 2021 at 12:20:59AM +0300, Kirill A. Shutemov wrote: I

Re: [RFC 11/20] iommu/iommufd: Add IOMMU_IOASID_ALLOC/FREE

2021-09-22 Thread Jason Gunthorpe via iommu
On Wed, Sep 22, 2021 at 12:51:38PM +, Liu, Yi L wrote: > > From: Jason Gunthorpe > > Sent: Wednesday, September 22, 2021 1:45 AM > > > [...] > > > diff --git a/drivers/iommu/iommufd/iommufd.c > > b/drivers/iommu/iommufd/iommufd.c > > > index 641f199f2d41..4839f128b24a 100644 > > > +++

Re: [RFC 15/20] vfio/pci: Add VFIO_DEVICE_[DE]ATTACH_IOASID

2021-09-22 Thread Jason Gunthorpe via iommu
On Wed, Sep 22, 2021 at 03:56:18AM +, Tian, Kevin wrote: > > From: Jason Gunthorpe > > Sent: Wednesday, September 22, 2021 2:04 AM > > > > On Sun, Sep 19, 2021 at 02:38:43PM +0800, Liu Yi L wrote: > > > This patch adds interface for userspace to attach device to specified > > > IOASID. > > >

Re: [RFC 14/20] iommu/iommufd: Add iommufd_device_[de]attach_ioasid()

2021-09-22 Thread Jason Gunthorpe via iommu
On Wed, Sep 22, 2021 at 03:53:52AM +, Tian, Kevin wrote: > Actually this was one open we closed in previous design proposal, but > looks you have a different thought now. > > vfio maintains one ioas per container. Devices in the container > can be attached to different domains (e.g. due to

Re: [RFC 12/20] iommu/iommufd: Add IOMMU_CHECK_EXTENSION

2021-09-22 Thread Jason Gunthorpe via iommu
On Wed, Sep 22, 2021 at 03:41:50AM +, Tian, Kevin wrote: > > From: Jason Gunthorpe > > Sent: Wednesday, September 22, 2021 1:47 AM > > > > On Sun, Sep 19, 2021 at 02:38:40PM +0800, Liu Yi L wrote: > > > As aforementioned, userspace should check extension for what formats > > > can be

RE: [RFC 11/20] iommu/iommufd: Add IOMMU_IOASID_ALLOC/FREE

2021-09-22 Thread Liu, Yi L
> From: Jason Gunthorpe > Sent: Wednesday, September 22, 2021 1:45 AM > [...] > > diff --git a/drivers/iommu/iommufd/iommufd.c > b/drivers/iommu/iommufd/iommufd.c > > index 641f199f2d41..4839f128b24a 100644 > > +++ b/drivers/iommu/iommufd/iommufd.c > > @@ -24,6 +24,7 @@ > > struct iommufd_ctx {

Re: [RFC 02/20] vfio: Add device class for /dev/vfio/devices

2021-09-22 Thread Jason Gunthorpe via iommu
On Wed, Sep 22, 2021 at 03:22:42AM +, Tian, Kevin wrote: > > From: Tian, Kevin > > Sent: Wednesday, September 22, 2021 9:07 AM > > > > > From: Jason Gunthorpe > > > Sent: Wednesday, September 22, 2021 8:55 AM > > > > > > On Tue, Sep 21, 2021 at 11:56:06PM +, Tian, Kevin wrote: > > > > >

Re: [RFC 10/20] iommu/iommufd: Add IOMMU_DEVICE_GET_INFO

2021-09-22 Thread Jason Gunthorpe via iommu
On Wed, Sep 22, 2021 at 03:30:09AM +, Tian, Kevin wrote: > > From: Jason Gunthorpe > > Sent: Wednesday, September 22, 2021 1:41 AM > > > > On Sun, Sep 19, 2021 at 02:38:38PM +0800, Liu Yi L wrote: > > > After a device is bound to the iommufd, userspace can use this interface > > > to query

Re: [RFC 01/20] iommu/iommufd: Add /dev/iommu core

2021-09-22 Thread Jason Gunthorpe via iommu
On Wed, Sep 22, 2021 at 01:51:03AM +, Tian, Kevin wrote: > > From: Jason Gunthorpe > > Sent: Tuesday, September 21, 2021 11:42 PM > > > > - Delete the iommufd_ctx->lock. Use RCU to protect load, erase/alloc does > >not need locking (order it properly too, it is in the wrong order), and

Re: [RFC 06/20] iommu: Add iommu_device_init[exit]_user_dma interfaces

2021-09-22 Thread Jason Gunthorpe via iommu
On Wed, Sep 22, 2021 at 01:47:05AM +, Tian, Kevin wrote: > > IIRC in VFIO the container is the IOAS and when the group goes to > > create the device fd it should simply do the > > iommu_device_init_user_dma() followed immediately by a call to bind > > the container IOAS as your #3. > > a

Re: [RFC 02/20] vfio: Add device class for /dev/vfio/devices

2021-09-22 Thread Jason Gunthorpe via iommu
On Wed, Sep 22, 2021 at 01:07:11AM +, Tian, Kevin wrote: > > From: Jason Gunthorpe > > Sent: Wednesday, September 22, 2021 8:55 AM > > > > On Tue, Sep 21, 2021 at 11:56:06PM +, Tian, Kevin wrote: > > > > The opened atomic is aweful. A newly created fd should start in a > > > > state

Re: [RFC 03/20] vfio: Add vfio_[un]register_device()

2021-09-22 Thread Jason Gunthorpe via iommu
On Wed, Sep 22, 2021 at 09:23:34AM +, Tian, Kevin wrote: > > Providing an ioctl to bind to a normal VFIO container or group might > > allow a reasonable fallback in userspace.. > > I didn't get this point though. An error in binding already allows the > user to fall back to the group path.

Re: [PATCH v4 02/14] x86/boot: Add setup_indirect support in early_memremap_is_setup_data

2021-09-22 Thread Daniel Kiper
On Fri, Aug 27, 2021 at 09:28:25AM -0400, Ross Philipson wrote: > The x86 boot documentation describes the setup_indirect structures and > how they are used. Only one of the two functions in ioremap.c that needed > to be modified to be aware of the introduction of setup_indirect > functionality

Re: [PATCH v4 01/14] x86/boot: Fix memremap of setup_indirect structures

2021-09-22 Thread Daniel Kiper
On Fri, Aug 27, 2021 at 09:28:24AM -0400, Ross Philipson wrote: > As documented, the setup_indirect structure is nested inside > the setup_data structures in the setup_data list. The code currently > accesses the fields inside the setup_indirect structure but only > the sizeof(struct setup_data)

Re: [PATCH V5 12/12] net: netvsc: Add Isolation VM support for netvsc driver

2021-09-22 Thread Tianyu Lan
Hi Christoph: This patch follows your purposal in the previous discussion. Could you have a look? "use vmap_pfn as in the current series. But in that case I think we should get rid of the other mapping created by vmalloc. I though a bit about finding a way to apply the offset in

RE: [RFC 03/20] vfio: Add vfio_[un]register_device()

2021-09-22 Thread Tian, Kevin
> From: Jason Gunthorpe > Sent: Wednesday, September 22, 2021 8:54 AM > > On Tue, Sep 21, 2021 at 11:10:15PM +, Tian, Kevin wrote: > > > From: Jason Gunthorpe > > > Sent: Wednesday, September 22, 2021 12:01 AM > > > > > > On Sun, Sep 19, 2021 at 02:38:31PM +0800, Liu Yi L wrote: > > > >

Re: [PATCH v4 00/13] MT8195 SMI support

2021-09-22 Thread Krzysztof Kozlowski
On Tue, 14 Sep 2021 19:36:50 +0800, Yong Wu wrote: > This patchset mainly adds SMI support for mt8195. > > Comparing with the previous version, add two new functions: > a) add smi sub common > b) add initial setting for smi-common and smi-larb. > > Change note: > v4:1) base on v5.15-rc1 >2)