Re: [PATCH v2] iommu/iova: put free_iova_mem() outside of spinlock iova_rbtree_lock

2021-04-15 Thread chenxiang (M)
在 2021/4/15 17:49, John Garry 写道: On 15/04/2021 04:52, chenxiang wrote: From: Xiang Chen It is not necessary to put free_iova_mem() inside of spinlock/unlock iova_rbtree_lock which only leads to more completion for the spinlock. It has a small promote on the performance after the change.

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

2021-04-15 Thread Jason Gunthorpe
On Thu, Apr 15, 2021 at 03:11:19PM +0200, Auger Eric wrote: > Hi Jason, > > On 4/1/21 6:03 PM, Jason Gunthorpe wrote: > > 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

Re: [PATCH v2 2/2] iommu/sva: Remove mm parameter from SVA bind API

2021-04-15 Thread Jacob Pan
Hi Christoph, On Thu, 15 Apr 2021 07:44:59 +0100, Christoph Hellwig wrote: > > * > > * Returns 0 on success and < 0 on error. > > @@ -28,6 +28,9 @@ int iommu_sva_alloc_pasid(struct mm_struct *mm, > > ioasid_t min, ioasid_t max) int ret = 0; > > ioasid_t pasid; > > > > + if (mm !=

Re: [Resend RFC PATCH V2 09/12] swiotlb: Add bounce buffer remap address setting function

2021-04-15 Thread Konrad Rzeszutek Wilk
On Wed, Apr 14, 2021 at 10:49:42AM -0400, Tianyu Lan wrote: > From: Tianyu Lan > > For Hyper-V isolation VM with AMD SEV SNP, the bounce buffer(shared memory) > needs to be accessed via extra address space(e.g address above bit39). > Hyper-V code may remap extra address space outside of swiotlb.

Re: [Resend RFC PATCH V2 07/12] HV/Vmbus: Initialize VMbus ring buffer for Isolation VM

2021-04-15 Thread Konrad Rzeszutek Wilk
On Wed, Apr 14, 2021 at 10:49:40AM -0400, Tianyu Lan wrote: > From: Tianyu Lan > > VMbus ring buffer are shared with host and it's need to > be accessed via extra address space of Isolation VM with > SNP support. This patch is to map the ring buffer > address in extra address space via

Re: [Resend RFC PATCH V2 06/12] HV/Vmbus: Add SNP support for VMbus channel initiate message

2021-04-15 Thread Konrad Rzeszutek Wilk
On Wed, Apr 14, 2021 at 10:49:39AM -0400, Tianyu Lan wrote: > From: Tianyu Lan > > The physical address of monitor pages in the CHANNELMSG_INITIATE_CONTACT > msg should be in the extra address space for SNP support and these What is this 'extra address space'? Is that just normal virtual

Re: [PATCH v2 1/2] iommu/sva: Tighten SVA bind API with explicit flags

2021-04-15 Thread Jacob Pan
Hi Christoph, Thanks for the review. On Thu, 15 Apr 2021 07:40:33 +0100, Christoph Hellwig wrote: > On Wed, Apr 14, 2021 at 08:27:56AM -0700, Jacob Pan wrote: > > static int idxd_enable_system_pasid(struct idxd_device *idxd) > > { > > - int flags; > > + unsigned int flags; > >

Re: [Resend RFC PATCH V2 04/12] HV: Add Write/Read MSR registers via ghcb

2021-04-15 Thread Konrad Rzeszutek Wilk
On Wed, Apr 14, 2021 at 10:49:37AM -0400, Tianyu Lan wrote: > From: Tianyu Lan > > Hyper-V provides GHCB protocol to write Synthetic Interrupt > Controller MSR registers and these registers are emulated by > Hypervisor rather than paravisor. What is paravisor? Is that the VMPL0 to borrow AMD

Re: [PATCH 2/2] iommu/amd: Remove performance counter pre-initialization test

2021-04-15 Thread David Coe
Hi Suravee! On 15/04/2021 10:28, Suthikulpanit, Suravee wrote: David, On 4/14/2021 10:33 PM, David Coe wrote: Hi Suravee! I've re-run your revert+update patch on Ubuntu's latest kernel 5.11.0-14 partly to check my mailer's 'mangling' hadn't also reached the code! There are 3 sets of

Re: [PATCH 3/3] iommu/virtio: Enable x86 support

2021-04-15 Thread Jean-Philippe Brucker
On Thu, Mar 18, 2021 at 02:28:02PM -0400, Michael S. Tsirkin wrote: > On Tue, Mar 16, 2021 at 08:16:54PM +0100, Jean-Philippe Brucker wrote: > > With the VIOT support in place, x86 platforms can now use the > > virtio-iommu. > > > > The arm64 Kconfig selects IOMMU_DMA, while x86 IOMMU drivers

Re: [PATCH 3/3] iommu/virtio: Enable x86 support

2021-04-15 Thread Jean-Philippe Brucker
On Thu, Mar 18, 2021 at 11:43:38AM +, Robin Murphy wrote: > On 2021-03-16 19:16, Jean-Philippe Brucker wrote: > > With the VIOT support in place, x86 platforms can now use the > > virtio-iommu. > > > > The arm64 Kconfig selects IOMMU_DMA, while x86 IOMMU drivers select it > > themselves. > >

Re: [PATCH] iommu/fsl-pamu: Fix uninitialized variable warning

2021-04-15 Thread Christoph Hellwig
On Thu, Apr 15, 2021 at 04:44:42PM +0200, Joerg Roedel wrote: > From: Joerg Roedel > > The variable 'i' in the function update_liodn_stash() is not > initialized and only used in a debug printk(). So it has no > meaning at all, remove it. > > Reported-by: kernel test robot > Signed-off-by:

Re: [PATCH 2/3] ACPI: Add driver for the VIOT table

2021-04-15 Thread Jean-Philippe Brucker
On Fri, Mar 19, 2021 at 11:44:26AM +0100, Auger Eric wrote: > add some kernel-doc comments matching the explanation in the commit message? Yes, I'll add some comments. I got rid of the other issues you pointed out while reworking the driver, should be more straightforward now Thanks, Jean

[PATCH] iommu/fsl-pamu: Fix uninitialized variable warning

2021-04-15 Thread Joerg Roedel
From: Joerg Roedel The variable 'i' in the function update_liodn_stash() is not initialized and only used in a debug printk(). So it has no meaning at all, remove it. Reported-by: kernel test robot Signed-off-by: Joerg Roedel --- drivers/iommu/fsl_pamu_domain.c | 5 ++--- 1 file changed, 2

Re: [PATCH 2/2] iommu/amd: Remove performance counter pre-initialization test

2021-04-15 Thread David Coe
I think you've put your finger on it, Suravee! On 15/04/2021 10:28, Suthikulpanit, Suravee wrote: David, On 4/14/2021 10:33 PM, David Coe wrote: Hi Suravee! I've re-run your revert+update patch on Ubuntu's latest kernel 5.11.0-14 partly to check my mailer's 'mangling' hadn't also reached

Re: [PATCH 1/3] ACPICA: iASL: Add definitions for the VIOT table

2021-04-15 Thread Jean-Philippe Brucker
On Thu, Mar 18, 2021 at 06:52:44PM +0100, Auger Eric wrote: > Besides > Reviewed-by: Eric Auger Thanks, though this patch comes from ACPICA and has now been merged with the other ACPICA updates: https://lore.kernel.org/linux-acpi/20210406213028.718796-1-erik.kan...@intel.com/ Thanks, Jean

Re: [PATCH 2/3] ACPI: Add driver for the VIOT table

2021-04-15 Thread Jean-Philippe Brucker
On Thu, Mar 18, 2021 at 07:36:50PM +, Robin Murphy wrote: > On 2021-03-16 19:16, Jean-Philippe Brucker wrote: > > The ACPI Virtual I/O Translation Table describes topology of > > para-virtual platforms. For now it describes the relation between > > virtio-iommu and the endpoints it manages.

Re: [PATCH v2] iommu/vt-d: Force to flush iotlb before creating superpage

2021-04-15 Thread Joerg Roedel
On Thu, Apr 15, 2021 at 08:46:28AM +0800, Longpeng(Mike) wrote: > Fixes: 6491d4d02893 ("intel-iommu: Free old page tables before creating > superpage") > Cc: # v3.0+ > Link: > https://lore.kernel.org/linux-iommu/670baaf8-4ff8-4e84-4be3-030b95ab5...@huawei.com/ > Suggested-by: Lu Baolu >

Re: [PATCH] iommu/amd: Put newline after closing bracket in warning

2021-04-15 Thread Jörg Rödel
On Mon, Apr 12, 2021 at 08:01:41PM +0200, Paul Menzel wrote: > drivers/iommu/amd/init.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) Applied, thanks. ___ iommu mailing list iommu@lists.linux-foundation.org

Re: [PATCH 1/2] iommu/mediatek-v1: Avoid build fail when build as module

2021-04-15 Thread Joerg Roedel
On Mon, Apr 12, 2021 at 02:48:42PM +0800, Yong Wu wrote: > When this driver build as module, It build fail like: > > ERROR: modpost: "of_phandle_iterator_args" > [drivers/iommu/mtk_iommu_v1.ko] undefined! > > This patch remove this interface to avoid this build fail. > > Reported-by: Valdis

Re: [PATCH] iommu/vt-d: Fix an error handling path in 'intel_prepare_irq_remapping()'

2021-04-15 Thread Joerg Roedel
On Sun, Apr 11, 2021 at 09:08:17AM +0200, Christophe JAILLET wrote: > drivers/iommu/intel/irq_remapping.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) Applied, thanks. ___ iommu mailing list iommu@lists.linux-foundation.org

Re: [PATCH 1/1] iommu/vt-d: Fix build error of pasid_enable_wpe() with !X86

2021-04-15 Thread Joerg Roedel
On Sun, Apr 11, 2021 at 02:23:12PM +0800, Lu Baolu wrote: > drivers/iommu/intel/pasid.c | 2 ++ > 1 file changed, 2 insertions(+) Applied, thanks. ___ iommu mailing list iommu@lists.linux-foundation.org

Re: [PATCH 0/2] iommu/amd: Revert and remove failing PMC test

2021-04-15 Thread Joerg Roedel
On Fri, Apr 09, 2021 at 03:58:46AM -0500, Suravee Suthikulpanit wrote: > Paul Menzel (1): > Revert "iommu/amd: Fix performance counter initialization" > > Suravee Suthikulpanit (1): > iommu/amd: Remove performance counter pre-initialization test Applied, thanks Paul and Suravee.

Re: [PATCH RESEND] iommu/amd: Remove duplicate check of devid

2021-04-15 Thread Joerg Roedel
On Fri, Apr 09, 2021 at 11:30:40AM +0800, Shaokun Zhang wrote: > drivers/iommu/amd/iommu.c | 9 + > 1 file changed, 1 insertion(+), 8 deletions(-) Applied, thanks. ___ iommu mailing list iommu@lists.linux-foundation.org

Re: [PATCH] iommu: exynos: remove unneeded local variable initialization

2021-04-15 Thread Joerg Roedel
On Thu, Apr 08, 2021 at 10:16:22PM +0200, Krzysztof Kozlowski wrote: > drivers/iommu/exynos-iommu.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) Applied, thanks. ___ iommu mailing list iommu@lists.linux-foundation.org

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

2021-04-15 Thread Auger Eric
Hi Jason, On 4/1/21 6:03 PM, Jason Gunthorpe wrote: > 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) iommu driver

Re: [Resend RFC PATCH V2 08/12] UIO/Hyper-V: Not load UIO HV driver in the isolation VM.

2021-04-15 Thread Tianyu Lan
On 4/14/2021 11:45 PM, Greg KH wrote: On Wed, Apr 14, 2021 at 10:49:41AM -0400, Tianyu Lan wrote: From: Tianyu Lan UIO HV driver should not load in the isolation VM for security reason. Return ENOTSUPP in the hv_uio_probe() in the isolation VM. Signed-off-by: Tianyu Lan ---

Re: [Resend RFC PATCH V2 08/12] UIO/Hyper-V: Not load UIO HV driver in the isolation VM.

2021-04-15 Thread Tianyu Lan
Hi Stephen: Thanks for your review. On 4/15/2021 12:17 AM, Stephen Hemminger wrote: On Wed, 14 Apr 2021 17:45:51 +0200 Greg KH wrote: On Wed, Apr 14, 2021 at 10:49:41AM -0400, Tianyu Lan wrote: From: Tianyu Lan UIO HV driver should not load in the isolation VM for security

Re: [PATCH 2/2] iommu/sva: Remove mm parameter from SVA bind API

2021-04-15 Thread Jason Gunthorpe
On Thu, Apr 15, 2021 at 01:33:24PM +0800, Lu Baolu wrote: > Hi Jason, > > On 4/14/21 7:26 PM, Jason Gunthorpe wrote: > > On Wed, Apr 14, 2021 at 02:22:09PM +0800, Lu Baolu wrote: > > > > > I still worry about supervisor pasid allocation. > > > > > > If we use iommu_sva_alloc_pasid() to allocate

RE: [RFC PATCH v2 0/8] ACPI/IORT: Support for IORT RMR node

2021-04-15 Thread Shameerali Kolothum Thodi
[+Lorenzo] > -Original Message- > From: Auger Eric [mailto:eric.au...@redhat.com] > Sent: 15 April 2021 10:49 > To: Shameerali Kolothum Thodi ; > linux-arm-ker...@lists.infradead.org; linux-a...@vger.kernel.org; > iommu@lists.linux-foundation.org; de...@acpica.org > Cc: Linuxarm ;

RE: [RFC PATCH v2 2/8] ACPI/IORT: Add support for RMR node parsing

2021-04-15 Thread Shameerali Kolothum Thodi
Hi Eric, > -Original Message- > From: Auger Eric [mailto:eric.au...@redhat.com] > Sent: 15 April 2021 10:39 > To: Shameerali Kolothum Thodi ; > linux-arm-ker...@lists.infradead.org; linux-a...@vger.kernel.org; > iommu@lists.linux-foundation.org; de...@acpica.org > Cc: Linuxarm ;

Re: [PATCH v3 01/12] iommu: Introduce dirty log tracking framework

2021-04-15 Thread Lu Baolu
Hi, On 2021/4/15 15:43, Keqian Zhu wrote: design it as not switchable. I will modify the commit message of patch#12, thanks! I am not sure that I fully get your point. But I can't see any gaps of using iommu_dev_enable/disable_feature() to switch dirty log on and off. Probably I missed

Re: [PATCH v2] iommu/iova: put free_iova_mem() outside of spinlock iova_rbtree_lock

2021-04-15 Thread John Garry
On 15/04/2021 04:52, chenxiang wrote: From: Xiang Chen It is not necessary to put free_iova_mem() inside of spinlock/unlock iova_rbtree_lock which only leads to more completion for the spinlock. It has a small promote on the performance after the change. And also rename private_free_iova() as

Re: [RFC PATCH v2 0/8] ACPI/IORT: Support for IORT RMR node

2021-04-15 Thread Auger Eric
Hi Shameer, + Jean-Philippe On 11/19/20 1:11 PM, Shameer Kolothum wrote: > RFC v1 --> v2: >  - Added a generic interface for IOMMU drivers to retrieve all the >    RMR info associated with a given IOMMU. >  - SMMUv3 driver gets the RMR list during probe() and installs >    bypass STEs for all

Re: [RFC PATCH v2 2/8] ACPI/IORT: Add support for RMR node parsing

2021-04-15 Thread Auger Eric
Hi Shameer, On 11/19/20 1:11 PM, Shameer Kolothum wrote: > Add support for parsing RMR node information from ACPI. > Find associated stream ids and smmu node info from the > RMR node and populate a linked list with RMR memory > descriptors. > > Signed-off-by: Shameer Kolothum > --- >

Re: [PATCH 2/2] iommu/amd: Remove performance counter pre-initialization test

2021-04-15 Thread Suthikulpanit, Suravee
David, On 4/14/2021 10:33 PM, David Coe wrote: Hi Suravee! I've re-run your revert+update patch on Ubuntu's latest kernel 5.11.0-14 partly to check my mailer's 'mangling' hadn't also reached the code! There are 3 sets of results in the attachment, all for the Ryzen 2400G. The as-distributed

Re: [Resend RFC PATCH V2 11/12] HV/Netvsc: Add Isolation VM support for netvsc driver

2021-04-15 Thread Tianyu Lan
On 4/14/2021 11:50 PM, Christoph Hellwig wrote: +struct dma_range { + dma_addr_t dma; + u32 mapping_size; +}; That's a rather generic name that is bound to create a conflict sooner or later. Good point. Will update. #include "hyperv_net.h" #include "netvsc_trace.h"

Re: [Resend RFC PATCH V2 04/12] HV: Add Write/Read MSR registers via ghcb

2021-04-15 Thread Tianyu Lan
On 4/14/2021 11:41 PM, Christoph Hellwig wrote: +EXPORT_SYMBOL_GPL(hv_ghcb_msr_write); Just curious, who is going to use all these exports? These seems like extremely low-level functionality. Isn't there a way to build a more useful higher level API? Yes, will remove it.

Re: [Resend RFC PATCH V2 03/12] x86/Hyper-V: Add new hvcall guest address host visibility support

2021-04-15 Thread Tianyu Lan
Hi Christoph: Thanks for your review. On 4/14/2021 11:40 PM, Christoph Hellwig wrote: +/* + * hv_set_mem_host_visibility - Set host visibility for specified memory. + */ I don't think this comment really clarifies anything over the function name. What is 'host visibility' OK. Will

Re: [PATCH v3 01/12] iommu: Introduce dirty log tracking framework

2021-04-15 Thread Keqian Zhu
On 2021/4/15 15:03, Lu Baolu wrote: > On 4/15/21 2:18 PM, Keqian Zhu wrote: >> Hi Baolu, >> >> Thanks for the review! >> >> On 2021/4/14 15:00, Lu Baolu wrote: >>> Hi Keqian, >>> >>> On 4/13/21 4:54 PM, Keqian Zhu wrote: Some types of IOMMU are capable of tracking DMA dirty log, such as

Re: [RFC PATCH v2 1/8] ACPICA: IORT: Update for revision E

2021-04-15 Thread Auger Eric
Hi Shameer, On 11/19/20 1:11 PM, Shameer Kolothum wrote: > IORT revision E contains a few additions like, >     -Added an identifier field in the node descriptors to aid table >      cross-referencing. >     -Introduced the Reserved Memory Range(RMR) node. This is used >     to describe memory

Re: [PATCH v3 01/12] iommu: Introduce dirty log tracking framework

2021-04-15 Thread Lu Baolu
On 4/15/21 2:18 PM, Keqian Zhu wrote: Hi Baolu, Thanks for the review! On 2021/4/14 15:00, Lu Baolu wrote: Hi Keqian, On 4/13/21 4:54 PM, Keqian Zhu wrote: Some types of IOMMU are capable of tracking DMA dirty log, such as ARM SMMU with HTTU or Intel IOMMU with SLADE. This introduces the

Re: [PATCH v2 2/2] iommu/sva: Remove mm parameter from SVA bind API

2021-04-15 Thread Christoph Hellwig
> * > * Returns 0 on success and < 0 on error. > @@ -28,6 +28,9 @@ int iommu_sva_alloc_pasid(struct mm_struct *mm, ioasid_t > min, ioasid_t max) > int ret = 0; > ioasid_t pasid; > > + if (mm != current->mm) > + return -EINVAL; > + Why not remove the parameter

Re: [PATCH v2 1/2] iommu/sva: Tighten SVA bind API with explicit flags

2021-04-15 Thread Christoph Hellwig
On Wed, Apr 14, 2021 at 08:27:56AM -0700, Jacob Pan wrote: > static int idxd_enable_system_pasid(struct idxd_device *idxd) > { > - int flags; > + unsigned int flags; > unsigned int pasid; > struct iommu_sva *sva; > > - flags = SVM_FLAG_SUPERVISOR_MODE; > + flags =

Re: [PATCH v3 01/12] iommu: Introduce dirty log tracking framework

2021-04-15 Thread Keqian Zhu
Hi Baolu, Thanks for the review! On 2021/4/14 15:00, Lu Baolu wrote: > Hi Keqian, > > On 4/13/21 4:54 PM, Keqian Zhu wrote: >> Some types of IOMMU are capable of tracking DMA dirty log, such as >> ARM SMMU with HTTU or Intel IOMMU with SLADE. This introduces the >> dirty log tracking framework