Re: [RFC PATCH 01/11] iommu/arm-smmu-v3: Add feature detection for HTTU

2021-02-05 Thread Keqian Zhu
Hi Robin and Jean, On 2021/2/5 3:50, Robin Murphy wrote: > On 2021-01-28 15:17, Keqian Zhu wrote: >> From: jiangkunkun >> >> The SMMU which supports HTTU (Hardware Translation Table Update) can >> update the access flag and the dirty state of TTD by hardware. It is >> essential to track dirty

Re: [RFC 2/3] arm64/hugetlb: Enable HUGETLB_PAGE_SIZE_VARIABLE

2021-02-05 Thread Anshuman Khandual
On 2/5/21 1:50 PM, David Hildenbrand wrote: > On 04.02.21 08:01, Anshuman Khandual wrote: >> MAX_ORDER which invariably depends on FORCE_MAX_ZONEORDER can be a variable >> for a given page size, depending on whether TRANSPARENT_HUGEPAGE is enabled >> or not. In certain page size and THP

Re: [PATCH][next][V2] iommu/mediatek: Fix unsigned domid comparison with less than zero

2021-02-05 Thread Joerg Roedel
On Thu, Feb 04, 2021 at 03:00:01PM +, Colin King wrote: > drivers/iommu/mtk_iommu.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) Applied, thanks. ___ iommu mailing list iommu@lists.linux-foundation.org

Re: [RFC PATCH 01/11] iommu/arm-smmu-v3: Add feature detection for HTTU

2021-02-05 Thread Jean-Philippe Brucker
Hi Keqian, On Fri, Feb 05, 2021 at 05:13:50PM +0800, Keqian Zhu wrote: > > We need to accommodate the firmware override as well if we need this to be > > meaningful. Jean-Philippe is already carrying a suitable patch in the SVA > > stack[1]. > Robin, Thanks for pointing it out. > > Jean, I see

Re: [PATCH v2 0/2] VMD MSI Remapping Bypass

2021-02-05 Thread Joerg Roedel
On Thu, Feb 04, 2021 at 12:09:04PM -0700, Jon Derrick wrote: > Jon Derrick (2): > iommu/vt-d: Use Real PCI DMA device for IRTE > PCI: vmd: Disable MSI/X remapping when possible > > drivers/iommu/intel/irq_remapping.c | 3 +- > drivers/pci/controller/vmd.c| 60

Re: [PATCH 5/8] swiotlb: refactor swiotlb_tbl_map_single

2021-02-05 Thread Christoph Hellwig
On Thu, Feb 04, 2021 at 10:12:31PM +, Robin Murphy wrote: >> -mask = dma_get_seg_boundary(hwdev); >> +if (boundary_mask + 1 == ~0UL) > > Either "mask == ~0UL" or "mask + 1 == 0", surely? I switched forth and back a few times and ended up with the broken variant in the middle. Fixed.

Re: [PATCH RESEND v2 4/5] iommu/tegra-smmu: Rework tegra_smmu_probe_device()

2021-02-05 Thread Nicolin Chen
Hi Guillaume, On Thu, Feb 04, 2021 at 09:24:23PM -0800, Nicolin Chen wrote: > > Please let us know if you need any help debugging this issue or > > to try a fix on this platform. > > Yes, I don't have any Tegra124 platform to run. It'd be very nice > if you can run some debugging patch (I can

Re: [PATCH 3/8] swiotlb: factor out a nr_slots helper

2021-02-05 Thread Christoph Hellwig
On Thu, Feb 04, 2021 at 10:09:02PM +, Robin Murphy wrote: >> diff --git a/kernel/dma/swiotlb.c b/kernel/dma/swiotlb.c >> index 838dbad10ab916..0c0b81799edbdb 100644 >> --- a/kernel/dma/swiotlb.c >> +++ b/kernel/dma/swiotlb.c >> @@ -194,6 +194,11 @@ static inline unsigned long

Re: [RFC 2/3] arm64/hugetlb: Enable HUGETLB_PAGE_SIZE_VARIABLE

2021-02-05 Thread David Hildenbrand
On 04.02.21 08:01, Anshuman Khandual wrote: MAX_ORDER which invariably depends on FORCE_MAX_ZONEORDER can be a variable for a given page size, depending on whether TRANSPARENT_HUGEPAGE is enabled or not. In certain page size and THP combinations HUGETLB_PAGE_ORDER can be greater than MAX_ORDER,

Re: [PATCH v2] dma-mapping: benchmark: pretend DMA is transmitting

2021-02-05 Thread Christoph Hellwig
On Fri, Feb 05, 2021 at 03:00:35PM +1300, Barry Song wrote: > + __u32 dma_trans_ns; /* time for DMA transmission in ns */ > __u64 expansion[10];/* For future use */ We need to keep the struct size, so the expansion field needs to shrink by the equivalent amount of data that is added

Re: [RFC PATCH 01/11] iommu/arm-smmu-v3: Add feature detection for HTTU

2021-02-05 Thread Robin Murphy
On 2021-02-05 09:13, Keqian Zhu wrote: Hi Robin and Jean, On 2021/2/5 3:50, Robin Murphy wrote: On 2021-01-28 15:17, Keqian Zhu wrote: From: jiangkunkun The SMMU which supports HTTU (Hardware Translation Table Update) can update the access flag and the dirty state of TTD by hardware. It is

Re: [RFC PATCH 3/3] iommu/arm-smmu-v3: Add debug interfaces for SMMUv3

2021-02-05 Thread Zhou Wang
On 2021/2/4 23:58, Robin Murphy wrote: > On 2021-01-29 09:06, Zhou Wang wrote: >> This patch adds debug interfaces for SMMUv3 driver in sysfs. It adds debug >> related files under /sys/kernel/debug/iommu/smmuv3. >> >> User should firstly set device and pasid to pci_dev and pasid by: >> (currently

Re: [PATCH v2] dma-mapping: benchmark: pretend DMA is transmitting

2021-02-05 Thread Christoph Hellwig
On Fri, Feb 05, 2021 at 10:32:26AM +, Song Bao Hua (Barry Song) wrote: > I can keep the struct size unchanged by changing the struct to > > struct map_benchmark { > __u64 avg_map_100ns; /* average map latency in 100ns */ > __u64 map_stddev; /* standard deviation of map latency */

RE: [PATCH v2] dma-mapping: benchmark: pretend DMA is transmitting

2021-02-05 Thread Song Bao Hua (Barry Song)
> -Original Message- > From: Christoph Hellwig [mailto:h...@lst.de] > Sent: Friday, February 5, 2021 11:36 PM > To: Song Bao Hua (Barry Song) > Cc: Christoph Hellwig ; m.szyprow...@samsung.com; > robin.mur...@arm.com; iommu@lists.linux-foundation.org; > linux-ker...@vger.kernel.org;

Re: preserve DMA offsets when using swiotlb

2021-02-05 Thread Christoph Hellwig
I've pushed the updated series out to: http://git.infradead.org/users/hch/misc.git/shortlog/refs/heads/swiotlb-offset but I'm going to wait until next week before patch bombing everyone again. ___ iommu mailing list iommu@lists.linux-foundation.org

Re: [PATCH v3 1/2] dma-mapping: benchmark: use u8 for reserved field in uAPI structure

2021-02-05 Thread Christoph Hellwig
Thanks, applied. ___ iommu mailing list iommu@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/iommu

Re: [PATCH 2/3] iommu/io-pgtable-arm: Add IOMMU_LLC page protection flag

2021-02-05 Thread Sai Prakash Ranjan
On 2021-02-04 03:16, Will Deacon wrote: On Tue, Feb 02, 2021 at 11:56:27AM +0530, Sai Prakash Ranjan wrote: On 2021-02-01 23:50, Jordan Crouse wrote: > On Mon, Feb 01, 2021 at 08:20:44AM -0800, Rob Clark wrote: > > On Mon, Feb 1, 2021 at 3:16 AM Will Deacon wrote: > > > On Fri, Jan 29, 2021 at

Re: [PATCH 7/8] swiotlb: respect min_align_mask

2021-02-05 Thread Christoph Hellwig
On Thu, Feb 04, 2021 at 11:13:45PM +, Robin Murphy wrote: >> + */ >> +static unsigned int swiotlb_align_offset(struct device *dev, u64 addr) >> +{ >> +unsigned min_align_mask = dma_get_min_align_mask(dev); >> + >> +if (!min_align_mask) >> +return 0; > > I doubt that's

RE: [PATCH v2] dma-mapping: benchmark: pretend DMA is transmitting

2021-02-05 Thread Song Bao Hua (Barry Song)
> -Original Message- > From: Christoph Hellwig [mailto:h...@lst.de] > Sent: Friday, February 5, 2021 10:21 PM > To: Song Bao Hua (Barry Song) > Cc: m.szyprow...@samsung.com; h...@lst.de; robin.mur...@arm.com; > iommu@lists.linux-foundation.org; linux-ker...@vger.kernel.org; >

Re: [PATCH v2] dma-mapping: benchmark: pretend DMA is transmitting

2021-02-05 Thread Christoph Hellwig
On Fri, Feb 05, 2021 at 10:52:37AM +, Song Bao Hua (Barry Song) wrote: > I assume there is no need to keep the same size with 5.11-rc, so > could change the struct to: > > struct map_benchmark { > __u64 avg_map_100ns; /* average map latency in 100ns */ > __u64 map_stddev; /*

[PATCH v3 1/2] dma-mapping: benchmark: use u8 for reserved field in uAPI structure

2021-02-05 Thread Barry Song
The original code put five u32 before a u64 expansion[10] array. Five is odd, this will cause trouble in the extension of the structure by adding new features. This patch moves to use u8 for reserved field to avoid future alignment risk. Meanwhile, it also clears the memory of struct map_benchmark

[PATCH v3 2/2] dma-mapping: benchmark: pretend DMA is transmitting

2021-02-05 Thread Barry Song
In a real dma mapping user case, after dma_map is done, data will be transmit. Thus, in multi-threaded user scenario, IOMMU contention should not be that severe. For example, if users enable multiple threads to send network packets through 1G/10G/100Gbps NIC, usually the steps will be: map ->

[PATCH] iommu/mediatek: Fix error code in probe()

2021-02-05 Thread Dan Carpenter
This error path is supposed to return -EINVAL. It used to return directly but we added some clean up and accidentally removed the error code. Also I fixed a typo in the error message. Fixes: c0b57581b73b ("iommu/mediatek: Add power-domain operation") Signed-off-by: Dan Carpenter ---

[git pull] IOMMU Fix for Linux v5.11-rc6

2021-02-05 Thread Joerg Roedel
Hi Linus, The following changes since commit 1048ba83fb1c00cd24172e23e8263972f6b5d9ac: Linux 5.11-rc6 (2021-01-31 13:50:09 -0800) are available in the Git repository at: git://git.kernel.org/pub/scm/linux/kernel/git/joro/iommu.git tags/iommu-fixes-v5.11-rc6 for you to fetch changes up to

Re: [RFC PATCH 01/11] iommu/arm-smmu-v3: Add feature detection for HTTU

2021-02-05 Thread Robin Murphy
On 2021-02-05 11:48, Robin Murphy wrote: On 2021-02-05 09:13, Keqian Zhu wrote: Hi Robin and Jean, On 2021/2/5 3:50, Robin Murphy wrote: On 2021-01-28 15:17, Keqian Zhu wrote: From: jiangkunkun The SMMU which supports HTTU (Hardware Translation Table Update) can update the access flag and

Re: Consult on ARM SMMU debugfs

2021-02-05 Thread Sai Prakash Ranjan
On 2021-01-15 22:47, Robin Murphy wrote: On 2021-01-15 15:14, Russell King - ARM Linux admin wrote: On Mon, Jan 11, 2021 at 08:01:48PM +, Robin Murphy wrote: On 2021-01-07 02:45, chenxiang (M) wrote: Hi Will,� Robin or other guys, When debugging SMMU/SVA issue on huawei ARM64 board, we

Re: [PATCH] swiotlb: Validate bounce size in the sync/unmap path

2021-02-05 Thread Christoph Hellwig
On Wed, Feb 03, 2021 at 02:36:38PM -0500, Konrad Rzeszutek Wilk wrote: > > So what? If you guys want to provide a new capability you'll have to do > > work. And designing a new protocol based around the fact that the > > hardware/hypervisor is not trusted and a copy is always required makes > >

Re: [git pull] IOMMU Fix for Linux v5.11-rc6

2021-02-05 Thread pr-tracker-bot
The pull request you sent on Fri, 5 Feb 2021 17:01:57 +0100: > git://git.kernel.org/pub/scm/linux/kernel/git/joro/iommu.git > tags/iommu-fixes-v5.11-rc6 has been merged into torvalds/linux.git: https://git.kernel.org/torvalds/c/97ba0c7413f83ab3b43a5ba05362ecc837fce518 Thank you! --

Re: [PATCH v2 2/2] PCI: vmd: Disable MSI/X remapping when possible

2021-02-05 Thread Bjorn Helgaas
On Thu, Feb 04, 2021 at 12:09:06PM -0700, Jon Derrick wrote: > VMD will retransmit child device MSI/X using its own MSI/X table and > requester-id. This limits the number of MSI/X available to the whole > child device domain to the number of VMD MSI/X interrupts. > > Some VMD devices have a mode

Re: [PATCH 1/3] dt-bindings: Fix undocumented compatible strings in examples

2021-02-05 Thread Wolfram Sang
On Tue, Feb 02, 2021 at 02:55:42PM -0600, Rob Herring wrote: > Running 'dt-validate -m' will flag any compatible strings missing a schema. > Fix all the errors found in DT binding examples. Most of these are just > typos. > > Cc: Stephen Boyd > Cc: Maxime Ripard > Cc: Chen-Yu Tsai > Cc: Linus

Re: [PATCH v2 2/2] PCI: vmd: Disable MSI/X remapping when possible

2021-02-05 Thread Derrick, Jonathan
On Fri, 2021-02-05 at 15:57 -0600, Bjorn Helgaas wrote: > On Thu, Feb 04, 2021 at 12:09:06PM -0700, Jon Derrick wrote: > > VMD will retransmit child device MSI/X using its own MSI/X table and > > requester-id. This limits the number of MSI/X available to the whole > > child device domain to the

[PATCH v3 0/2] VMD MSI Remapping Bypass

2021-02-05 Thread Jon Derrick
The Intel Volume Management Device acts similar to a PCI-to-PCI bridge in that it changes downstream devices' requester-ids to its own. As VMD supports PCIe devices, it has its own MSI-X table and transmits child device MSI-X by remapping child device MSI-X and handling like a demultiplexer. Some

[PATCH v3 1/2] iommu/vt-d: Use Real PCI DMA device for IRTE

2021-02-05 Thread Jon Derrick
VMD retransmits child device MSI-X with the VMD endpoint's requester-id. In order to support direct interrupt remapping of VMD child devices, ensure that the IRTE is programmed with the VMD endpoint's requester-id using pci_real_dma_dev(). Acked-by: Lu Baolu Acked-by: Joerg Roedel

[PATCH v3 2/2] PCI: vmd: Disable MSI-X remapping when possible

2021-02-05 Thread Jon Derrick
VMD will retransmit child device MSI-X using its own MSI-X table and requester-id. This limits the number of MSI-X available to the whole child device domain to the number of VMD MSI-X interrupts. Some VMD devices have a mode where this remapping can be disabled, allowing child device interrupts

Re: [PATCH 1/3] dt-bindings: Fix undocumented compatible strings in examples

2021-02-05 Thread Stephen Boyd
Quoting Rob Herring (2021-02-02 12:55:42) > Running 'dt-validate -m' will flag any compatible strings missing a schema. > Fix all the errors found in DT binding examples. Most of these are just > typos. > > Cc: Stephen Boyd > Cc: Maxime Ripard > Cc: Chen-Yu Tsai > Cc: Linus Walleij > Cc:

Re: AMD-Vi: Unable to read/write to IOMMU perf counter

2021-02-05 Thread Suravee Suthikulpanit
Tj, I have posted RFCv3 in the BZ https://bugzilla.kernel.org/show_bug.cgi?id=201753. RFCv3 patch adds the logic to retry checking after 20msec wait for each retry loop since I have founded that certain platform takes about 10msec for the power gating to disable. Please give this a try to