RE: [PATCH v13 00/15] SMMUv3 Nested Stage Setup (IOMMU part)

2021-02-22 Thread Shameerali Kolothum Thodi
> -Original Message- > From: Auger Eric [mailto:eric.au...@redhat.com] > Sent: 21 February 2021 18:21 > To: Shameerali Kolothum Thodi ; > eric.auger@gmail.com; iommu@lists.linux-foundation.org; > linux-ker...@vger.kernel.org; k...@vger.kernel.org; > kvm...@lists.cs.columbia.edu; w...@

Re: [PATCH 5/6] driver core: lift dma_default_coherent into common code

2021-02-22 Thread Maciej W. Rozycki
On Mon, 22 Feb 2021, Christoph Hellwig wrote: > > I haven't booted Linux on my Malta for a while now, but it turns out to > > work just fine, and your patch set does not regress it booting multi-user > > NFS-rooted over FDDI. > > > > I note however that the system does not reboot properly: > >

Re: [PATCH v11 01/13] vfio: VFIO_IOMMU_SET_PASID_TABLE

2021-02-22 Thread Auger Eric
Hi Keqian, On 2/2/21 1:34 PM, Keqian Zhu wrote: > Hi Eric, > > On 2020/11/16 19:00, Eric Auger wrote: >> From: "Liu, Yi L" >> >> This patch adds an VFIO_IOMMU_SET_PASID_TABLE ioctl >> which aims to pass the virtual iommu guest configuration >> to the host. This latter takes the form of the so-ca

Re: [PATCH v11 01/13] vfio: VFIO_IOMMU_SET_PASID_TABLE

2021-02-22 Thread Keqian Zhu
Hi Eric, On 2021/2/22 18:53, Auger Eric wrote: > Hi Keqian, > > On 2/2/21 1:34 PM, Keqian Zhu wrote: >> Hi Eric, >> >> On 2020/11/16 19:00, Eric Auger wrote: >>> From: "Liu, Yi L" >>> >>> This patch adds an VFIO_IOMMU_SET_PASID_TABLE ioctl >>> which aims to pass the virtual iommu guest configura

Re: [PATCH] iommu/tegra-smmu: Fix mc errors on tegra124-nyan

2021-02-22 Thread Guillaume Tucker
On 18/02/2021 22:07, Nicolin Chen wrote: > Commit 25938c73cd79 ("iommu/tegra-smmu: Rework tegra_smmu_probe_device()") > removed certain hack in the tegra_smmu_probe() by relying on IOMMU core to > of_xlate SMMU's SID per device, so as to get rid of tegra_smmu_find() and > tegra_smmu_configure() tha

[RFC PATCH 0/5] KVM/ARM64 Add support for pinned VMIDs

2021-02-22 Thread Shameer Kolothum
On an ARM64 system with a SMMUv3 implementation that fully supports Broadcast TLB Maintenance(BTM) feature as part of the Distributed Virtual Memory(DVM) protocol, the CPU TLB invalidate instructions are received by SMMUv3. This is very useful when the SMMUv3 shares the page tables with the CPU(eg:

[RFC PATCH 1/5] vfio: Add a helper to retrieve kvm instance from a dev

2021-02-22 Thread Shameer Kolothum
A device that belongs to vfio_group has the kvm instance associated with it. Retrieve it. Signed-off-by: Shameer Kolothum --- drivers/vfio/vfio.c | 12 include/linux/vfio.h | 1 + 2 files changed, 13 insertions(+) diff --git a/drivers/vfio/vfio.c b/drivers/vfio/vfio.c index 2151b

[RFC PATCH 2/5] KVM: Add generic infrastructure to support pinned VMIDs

2021-02-22 Thread Shameer Kolothum
Provide generic helper functions to get/put pinned VMIDs if the arch supports it. Signed-off-by: Shameer Kolothum --- include/linux/kvm_host.h | 17 + virt/kvm/Kconfig | 2 ++ virt/kvm/kvm_main.c | 25 + 3 files changed, 44 insertions(+) dif

[RFC PATCH 4/5] iommu/arm-smmu-v3: Use pinned VMID for NESTED stage with BTM

2021-02-22 Thread Shameer Kolothum
If the SMMU supports BTM and the device belongs to NESTED domain with shared pasid table, we need to use the VMID allocated by the KVM for the s2 configuration. Hence, request a pinned VMID from KVM. Signed-off-by: Shameer Kolothum --- drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c | 49 +++

[RFC PATCH 5/5] KVM: arm64: Make sure pinned vmid is released on VM exit

2021-02-22 Thread Shameer Kolothum
Since the pinned VMID space is not recycled, we need to make sure that we release the vmid back into the pool when we are done with it. Signed-off-by: Shameer Kolothum --- arch/arm64/kvm/arm.c | 12 ++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/arch/arm64/kvm/arm.c

[RFC PATCH 3/5] KVM: ARM64: Add support for pinned VMIDs

2021-02-22 Thread Shameer Kolothum
On an ARM64 system with a SMMUv3 implementation that fully supports Broadcast TLB Maintenance(BTM) feature, the CPU TLB invalidate instructions are received by SMMU. This is very useful when the SMMU shares the page tables with the CPU(eg: Guest SVA use case). For this to work, the SMMU must use th

Re: [PATCH v11 01/13] vfio: VFIO_IOMMU_SET_PASID_TABLE

2021-02-22 Thread Auger Eric
Hi Keqian, On 2/22/21 1:20 PM, Keqian Zhu wrote: > Hi Eric, > > On 2021/2/22 18:53, Auger Eric wrote: >> Hi Keqian, >> >> On 2/2/21 1:34 PM, Keqian Zhu wrote: >>> Hi Eric, >>> >>> On 2020/11/16 19:00, Eric Auger wrote: From: "Liu, Yi L" This patch adds an VFIO_IOMMU_SET_PASID_TABL

[git pull] IOMMU Updates for Linux v5.12

2021-02-22 Thread Joerg Roedel
Hi Linus, The following changes since commit 92bf22614b21a2706f4993b278017e437f7785b3: Linux 5.11-rc7 (2021-02-07 13:57:38 -0800) are available in the Git repository at: git://git.kernel.org/pub/scm/linux/kernel/git/joro/iommu.git tags/iommu-updates-v5.12 for you to fetch changes up to 45

Re: [PATCH 1/4] iommu/vt-d: Enable write protect for supervisor SVM

2021-02-22 Thread Jacob Pan
Hi Lu, On Sat, 20 Feb 2021 09:56:26 +0800, Lu Baolu wrote: > Hi Jacob and Sanjay, > > On 2/19/21 5:31 AM, Jacob Pan wrote: > > Write protect bit, when set, inhibits supervisor writes to the read-only > > pages. In supervisor shared virtual addressing (SVA), where page tables > > are shared betw

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

2021-02-22 Thread Jacob Pan
Hi Kevin, On Sat, 20 Feb 2021 02:38:02 +, "Tian, Kevin" wrote: > > 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

Re: [PATCH] iommu/amd: Fix event counter availability check

2021-02-22 Thread Suravee Suthikulpanit
This fix has been accepted in the upstream recently. https://git.kernel.org/pub/scm/linux/kernel/git/joro/iommu.git/commit/?h=x86/amd Could you please give this a try? Thanks, Suravee On 2/21/21 8:49 PM, Paul Menzel wrote: Dear Suravee, Am 17.09.20 um 19:55 schrieb Alexander Monakov: On Tu

Re: [git pull] IOMMU Updates for Linux v5.12

2021-02-22 Thread pr-tracker-bot
The pull request you sent on Mon, 22 Feb 2021 17:17:35 +0100: > git://git.kernel.org/pub/scm/linux/kernel/git/joro/iommu.git > tags/iommu-updates-v5.12 has been merged into torvalds/linux.git: https://git.kernel.org/torvalds/c/d652ea30ba32db12fe8365182fad5ba2e7c22822 Thank you! -- Deet-doot-d

Re: [PATCH 6/9] swiotlb: refactor swiotlb_tbl_map_single

2021-02-22 Thread Nicolas Saenz Julienne
Hi Christoph, On Sun, 2021-02-07 at 17:03 +0100, Christoph Hellwig wrote: > Split out a bunch of a self-contained helpers to make the function easier > to follow. > > Signed-off-by: Christoph Hellwig > --- >  kernel/dma/swiotlb.c | 179 +-- >  1 file change

Re: [PATCH 6/9] swiotlb: refactor swiotlb_tbl_map_single

2021-02-22 Thread Konrad Rzeszutek Wilk
> > +static int find_slots(struct device *dev, size_t alloc_size) > > +{ > > + unsigned long boundary_mask = dma_get_seg_boundary(dev); > > + dma_addr_t tbl_dma_addr = > > + phys_to_dma_unencrypted(dev, io_tlb_start) & boundary_mask; > > + unsigned int max_slots = get_max_slots(boun

Re: [PATCH RFC v1 5/6] xen-swiotlb: convert variables to arrays

2021-02-22 Thread Stefano Stabellini
On Fri, 19 Feb 2021, Konrad Rzeszutek Wilk wrote: > On Sun, Feb 07, 2021 at 04:56:01PM +0100, Christoph Hellwig wrote: > > On Thu, Feb 04, 2021 at 09:40:23AM +0100, Christoph Hellwig wrote: > > > So one thing that has been on my mind for a while: I'd really like > > > to kill the separate dma ops

Re: [PATCH] iommu/tegra-smmu: Fix mc errors on tegra124-nyan

2021-02-22 Thread Nicolin Chen
Hi Dmitry, On Sat, Feb 20, 2021 at 08:16:22AM +0300, Dmitry Osipenko wrote: > 19.02.2021 01:07, Nicolin Chen пишет: > > Commit 25938c73cd79 ("iommu/tegra-smmu: Rework tegra_smmu_probe_device()") > > removed certain hack in the tegra_smmu_probe() by relying on IOMMU core to > > of_xlate SMMU's SID

Re: [PATCH] iommu/tegra-smmu: Fix mc errors on tegra124-nyan

2021-02-22 Thread Dmitry Osipenko
23.02.2021 05:13, Nicolin Chen пишет: > Hi Dmitry, > > On Sat, Feb 20, 2021 at 08:16:22AM +0300, Dmitry Osipenko wrote: >> 19.02.2021 01:07, Nicolin Chen пишет: >>> Commit 25938c73cd79 ("iommu/tegra-smmu: Rework tegra_smmu_probe_device()") >>> removed certain hack in the tegra_smmu_probe() by rely

Re: [PATCH 6/9] swiotlb: refactor swiotlb_tbl_map_single

2021-02-22 Thread Christoph Hellwig
On Mon, Feb 22, 2021 at 02:29:37PM -0500, Konrad Rzeszutek Wilk wrote: > > 'max_slots' should be 'unsigned long' here. Breaks SWIOTLB on RPi4. Do you > > want > > me to send a fix or you prefer editing the patch? > > I can roll it in. Thx! Thanks to both of you! _