[PATCH 1/2] dt-bindings: arm-smmu: Add compatible for SM6350 SoC

2021-08-20 Thread Konrad Dybcio
Add the SoC specific compatible for SM6350 implementing arm,mmu-500. Signed-off-by: Konrad Dybcio --- Documentation/devicetree/bindings/iommu/arm,smmu.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/Documentation/devicetree/bindings/iommu/arm,smmu.yaml b/Documentation/devicetree/bindin

[PATCH 2/2] iommu/arm-smmu-qcom: Add SM6350 SMMU compatible

2021-08-20 Thread Konrad Dybcio
Add compatible for SM6350 SMMU to use the Qualcomm Technologies, Inc. specific implementation. Signed-off-by: Konrad Dybcio --- drivers/iommu/arm/arm-smmu/arm-smmu-qcom.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/iommu/arm/arm-smmu/arm-smmu-qcom.c b/drivers/iommu/arm/arm-smmu/

Re: [git pull] IOMMU Fixes for Linux v5.14-rc6

2021-08-20 Thread pr-tracker-bot
The pull request you sent on Fri, 20 Aug 2021 09:54:10 +0200: > git://git.kernel.org/pub/scm/linux/kernel/git/joro/iommu.git > tags/iommu-fixes-v5.14-rc6 has been merged into torvalds/linux.git: https://git.kernel.org/torvalds/c/b7d184d37ecc99f87fc8e531c788f69084f8a95f Thank you! -- Deet-doot

[PATCH 3/3] iommu/amd: Remove iommu_init_ga()

2021-08-20 Thread Suravee Suthikulpanit via iommu
Since the function has been simplified and only call iommu_init_ga_log(), remove the function and replace with iommu_init_ga_log() instead. Signed-off-by: Suravee Suthikulpanit --- drivers/iommu/amd/init.c | 17 - 1 file changed, 4 insertions(+), 13 deletions(-) diff --git a/dri

[PATCH 1/3] iommu/amd: Introduce helper function to check feature bit on all IOMMUs

2021-08-20 Thread Suravee Suthikulpanit via iommu
IOMMU advertises feature via Extended Features Register (EFR). The helper function checks if the specified feature bit is set across all IOMMUs. Signed-off-by: Suravee Suthikulpanit --- drivers/iommu/amd/init.c | 13 + 1 file changed, 13 insertions(+) diff --git a/drivers/iommu/amd/

[PATCH 2/3] iommu/amd: Relocate GAMSup check to early_enable_iommus

2021-08-20 Thread Suravee Suthikulpanit via iommu
From: Wei Huang Currently, iommu_init_ga() checks and disables IOMMU VAPIC support (i.e. AMD AVIC support in IOMMU) when GAMSup feature bit is not set. However it forgets to clear IRQ_POSTING_CAP from the previously set amd_iommu_irq_ops.capability. This triggers an invalid page fault bug during

[PATCH 0/3] iommu/amd: Fix unable to handle page fault due to AVIC

2021-08-20 Thread Suravee Suthikulpanit via iommu
This bug is triggered when rebooting VM on a system which SVM AVIC is enabled but IOMMU AVIC is disabled in the BIOS. The series reworks interrupt remapping intialiation to check for IOMMU AVIC support (GAMSup) at earlier stage using EFR provided by IVRS table instead of the PCI MMIO register, whi

Re: [PATCH v4] iommu/of: Fix pci_request_acs() before enumerating PCI devices

2021-08-20 Thread Bjorn Helgaas
On Fri, May 21, 2021 at 03:03:24AM +, Wang Xingang wrote: > From: Xingang Wang > > When booting with devicetree, the pci_request_acs() is called after the > enumeration and initialization of PCI devices, thus the ACS is not > enabled. And ACS should be enabled when IOMMU is detected for the >

RE: [PATCH V3 13/13] HV/Storvsc: Add Isolation VM support for storvsc driver

2021-08-20 Thread Michael Kelley via iommu
From: Tianyu Lan Sent: Friday, August 20, 2021 11:04 AM > > On 8/21/2021 12:08 AM, Michael Kelley wrote: > } > >>> The whole approach here is to do dma remapping on each individual page > >>> of the I/O buffer. But wouldn't it be possible to use dma_map_sg() to map > >>> each scatt

Re: [PATCH V3 12/13] HV/Netvsc: Add Isolation VM support for netvsc driver

2021-08-20 Thread Tianyu Lan
On 8/20/2021 2:14 AM, Michael Kelley wrote: @@ -477,6 +521,15 @@ static int netvsc_init_buf(struct hv_device *device, goto cleanup; } + if (hv_isolation_type_snp()) { + vaddr = netvsc_remap_buf(net_device->send_buf, buf_size); + if (!vadd

Re: [PATCH V3 13/13] HV/Storvsc: Add Isolation VM support for storvsc driver

2021-08-20 Thread Tianyu Lan
On 8/21/2021 12:08 AM, Michael Kelley wrote: } The whole approach here is to do dma remapping on each individual page of the I/O buffer. But wouldn't it be possible to use dma_map_sg() to map each scatterlist entry as a unit? Each scatterlist entry describes a range of physically co

RE: [PATCH V3 13/13] HV/Storvsc: Add Isolation VM support for storvsc driver

2021-08-20 Thread Michael Kelley via iommu
From: Tianyu Lan Sent: Friday, August 20, 2021 8:20 AM > > On 8/20/2021 2:17 AM, Michael Kelley wrote: > > From: Tianyu Lan Sent: Monday, August 9, 2021 10:56 AM > > > > I'm not clear on why payload->range.offset needs to be set again. > > Even after the dma mapping is done, doesn't the offset i

Re: [PATCH V3 13/13] HV/Storvsc: Add Isolation VM support for storvsc driver

2021-08-20 Thread Tianyu Lan
On 8/20/2021 12:32 PM, h...@lst.de wrote: On Thu, Aug 19, 2021 at 06:17:40PM +, Michael Kelley wrote: +#define storvsc_dma_map(dev, page, offset, size, dir) \ + dma_map_page(dev, page, offset, size, dir) + +#define storvsc_dma_unmap(dev, dma_range, dir) \ + dma

RE: [PATCH V3 13/13] HV/Storvsc: Add Isolation VM support for storvsc driver

2021-08-20 Thread Michael Kelley via iommu
From: h...@lst.de Sent: Thursday, August 19, 2021 9:33 PM > > On Thu, Aug 19, 2021 at 06:17:40PM +, Michael Kelley wrote: > > > > > > @@ -1824,6 +1848,13 @@ static int storvsc_queuecommand(struct Scsi_Host > > > *host, struct scsi_cmnd *scmnd) > > > payload->range.len = length; > >

Re: [PATCH V3 13/13] HV/Storvsc: Add Isolation VM support for storvsc driver

2021-08-20 Thread Tianyu Lan
On 8/20/2021 11:20 PM, Tianyu Lan wrote: The whole approach here is to do dma remapping on each individual page of the I/O buffer.  But wouldn't it be possible to use dma_map_sg() to map each scatterlist entry as a unit?  Each scatterlist entry describes a range of physically contiguous memory

Re: [PATCH V3 13/13] HV/Storvsc: Add Isolation VM support for storvsc driver

2021-08-20 Thread Tianyu Lan
On 8/20/2021 2:17 AM, Michael Kelley wrote: From: Tianyu Lan Sent: Monday, August 9, 2021 10:56 AM Subject line tag should be "scsi: storvsc:" In Isolation VM, all shared memory with host needs to mark visible to host via hvcall. vmbus_establish_gpadl() has already done it for storvsc r

Re: [PATCH] iommu/io-pgtable: Abstract iommu_iotlb_gather access

2021-08-20 Thread Joerg Roedel
On Fri, Aug 20, 2021 at 02:14:42PM +0100, Robin Murphy wrote: > drivers/iommu/io-pgtable-arm-v7s.c | 2 +- > drivers/iommu/io-pgtable-arm.c | 2 +- > include/linux/iommu.h | 10 ++ > 3 files changed, 12 insertions(+), 2 deletions(-) Applied, thanks Robin. _

Re: [PATCH V3 12/13] HV/Netvsc: Add Isolation VM support for netvsc driver

2021-08-20 Thread Tom Lendacky via iommu
On 8/19/21 11:21 PM, h...@lst.de wrote: On Thu, Aug 19, 2021 at 06:14:51PM +, Michael Kelley wrote: + if (!pfns) + return NULL; + + for (i = 0; i < size / HV_HYP_PAGE_SIZE; i++) + pfns[i] = virt_to_hvpfn(buf + i * HV_HYP_PAGE_SIZE) +

[PATCH] iommu/io-pgtable: Abstract iommu_iotlb_gather access

2021-08-20 Thread Robin Murphy
Previously io-pgtable merely passed the iommu_iotlb_gather pointer through to helpers, but now it has grown its own direct dereference. This turns out to break the build for !IOMMU_API configs where the structure only has a dummy definition. It will probably also crash drivers who don't use the gat

Re: [PATCH V3 12/13] HV/Netvsc: Add Isolation VM support for netvsc driver

2021-08-20 Thread Tianyu Lan
On 8/20/2021 12:21 PM, h...@lst.de wrote: On Thu, Aug 19, 2021 at 06:14:51PM +, Michael Kelley wrote: + if (!pfns) + return NULL; + + for (i = 0; i < size / HV_HYP_PAGE_SIZE; i++) + pfns[i] = virt_to_hvpfn(buf + i * HV_HYP_PAGE_SIZE) +

Re: [PATCH -next] iommu/arm-smmu: Fix missing unlock on error in arm_smmu_device_group()

2021-08-20 Thread Joerg Roedel
On Fri, Aug 20, 2021 at 11:41:11AM +0100, Will Deacon wrote: > Joerg -- please can you throw this on top? Sure, now applied, thanks. ___ iommu mailing list iommu@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/iommu

Re: [PATCH -next] iommu/arm-smmu: Fix missing unlock on error in arm_smmu_device_group()

2021-08-20 Thread Will Deacon
On Fri, Aug 20, 2021 at 03:49:49PM +0800, Yang Yingliang wrote: > Add the missing unlock before return from function arm_smmu_device_group() > in the error handling case. > > Fixes: b1a1347912a7 ("iommu/arm-smmu: Fix race condition during iommu_group > creation") > Reported-by: Hulk Robot > Sign

Re: [PATCH v7 1/9] iommu: Introduce a union to struct iommu_resv_region

2021-08-20 Thread Steven Price
On 05/08/2021 09:07, Shameer Kolothum wrote: > A union is introduced to struct iommu_resv_region to hold > any firmware specific data. This is in preparation to add > support for IORT RMR reserve regions and the union now holds > the RMR specific information. > > Signed-off-by: Shameer Kolothum >

Re: [PATCH V3 11/13] HV/IOMMU: Enable swiotlb bounce buffer for Isolation VM

2021-08-20 Thread Tianyu Lan
On 8/20/2021 2:11 AM, Michael Kelley wrote: } + +/* + * hv_map_memory - map memory to extra space in the AMD SEV-SNP Isolation VM. + */ +void *hv_map_memory(void *addr, unsigned long size) +{ + unsigned long *pfns = kcalloc(size / HV_HYP_PAGE_SIZE, +

[iommu:x86/vt-d 41/59] drivers/iommu/io-pgtable-arm-v7s.c:703:43: error: 'struct iommu_iotlb_gather' has no member named 'queued'

2021-08-20 Thread kernel test robot
tree: https://git.kernel.org/pub/scm/linux/kernel/git/joro/iommu.git x86/vt-d head: 423d39d8518c1bba12e0889a92beeddbb1502392 commit: a8e5f04458c4e496eada2b029ce96713bb6c388d [41/59] iommu/io-pgtable: Remove non-strict quirk config: nds32-buildonly-randconfig-r001-20210820 (attached as .config

[git pull] IOMMU Fixes for Linux v5.14-rc6

2021-08-20 Thread Joerg Roedel
Hi Linus, The following changes since commit ff1176468d368232b684f75e82563369208bc371: Linux 5.14-rc3 (2021-07-25 15:35:14 -0700) are available in the Git repository at: git://git.kernel.org/pub/scm/linux/kernel/git/joro/iommu.git tags/iommu-fixes-v5.14-rc6 for you to fetch changes up to

[PATCH -next] iommu/arm-smmu: Fix missing unlock on error in arm_smmu_device_group()

2021-08-20 Thread Yang Yingliang
Add the missing unlock before return from function arm_smmu_device_group() in the error handling case. Fixes: b1a1347912a7 ("iommu/arm-smmu: Fix race condition during iommu_group creation") Reported-by: Hulk Robot Signed-off-by: Yang Yingliang --- drivers/iommu/arm/arm-smmu/arm-smmu.c | 4 +++-