Re: [PATCH v6 07/18] iommu: Implement reserved_regions iommu-group sysfs file

2017-01-06 Thread Auger Eric
Hi Joerg, Robin, On 06/01/2017 13:48, Joerg Roedel wrote: > On Fri, Jan 06, 2017 at 12:46:05PM +0100, Auger Eric wrote: >> On 06/01/2017 12:00, Joerg Roedel wrote: > >>> I think it also makes sense to report the type of the reserved region. >> >> What is the best practice in that case? Shall we

Re: [RFC 1/3] iommu/arm-smmu: Add support to opt-in to stalling

2017-01-06 Thread Rob Clark
On Thu, Jan 5, 2017 at 12:25 PM, Will Deacon wrote: >> That's still got to be a per-master property, not a SMMU property, I >> think. To illustrate: >> >> [A] [B] [C] >>| |_| >> __|__|___ >> | TBU || TBU | >> |_| SMMU

Re: [RFC 1/3] iommu/arm-smmu: Add support to opt-in to stalling

2017-01-06 Thread Rob Clark
On Thu, Jan 5, 2017 at 10:49 AM, Will Deacon wrote: > On Thu, Jan 05, 2017 at 10:27:27AM -0500, Rob Clark wrote: >> On Thu, Jan 5, 2017 at 6:55 AM, Will Deacon wrote: >> > On Tue, Jan 03, 2017 at 04:30:54PM -0500, Rob Clark wrote: >> >> TODO maybe we

Re: [PATCH 02/10] iommu/of: Prepare for deferred IOMMU configuration

2017-01-06 Thread Lorenzo Pieralisi
On Thu, Jan 05, 2017 at 08:21:53PM +0530, Sricharan wrote: > Hi, > > [...] > > >>> > >>> With the thinking of taking this series through, would it be fine if i > >>> cleanup the pci configure hanging outside and push it in to > >>> of/acpi_iommu configure respectively ? This time with all

[git pull] IOMMU Fixes for Linux v4.10-rc2

2017-01-06 Thread Joerg Roedel
Hi Linus, The following changes since commit 0c744ea4f77d72b3dcebb7a8f2684633ec79be88: Linux 4.10-rc2 (2017-01-01 14:31:53 -0800) are available in the git repository at: git://git.kernel.org/pub/scm/linux/kernel/git/joro/iommu.git tags/iommu-fixes-v4.10-rc2 for you to fetch changes up to

[PATCH V9 9/9] Revert "iommu/arm-smmu: Set PRIVCFG in stage 1 STEs"

2017-01-06 Thread Sricharan R
From: Robin Murphy This reverts commit df5e1a0f2a2d779ad467a691203bcbc74d75690e. Now that proper privileged mappings can be requested via IOMMU_PRIV, unconditionally overriding the incoming PRIVCFG becomes the wrong thing to do, so stop it. Signed-off-by: Robin Murphy

[PATCH V9 8/9] iommu/arm-smmu: Set privileged attribute to 'default' instead of 'unprivileged'

2017-01-06 Thread Sricharan R
Currently the driver sets all the device transactions privileges to UNPRIVILEGED, but there are cases where the iommu masters wants to isolate privileged supervisor and unprivileged user. So don't override the privileged setting to unprivileged, instead set it to default as incoming and let it be

[PATCH V9 6/9] arm/dma-mapping: Implement DMA_ATTR_PRIVILEGED

2017-01-06 Thread Sricharan R
The newly added DMA_ATTR_PRIVILEGED is useful for creating mappings that are only accessible to privileged DMA engines. Adding it to the arm dma-mapping.c so that the ARM32 DMA IOMMU mapper can make use of it. Signed-off-by: Sricharan R Reviewed-by: Will Deacon

[PATCH V9 7/9] dmaengine: pl330: Make sure microcode is privileged

2017-01-06 Thread Sricharan R
From: Mitchel Humpherys The PL330 is hard-wired such that instruction fetches on both the manager and channel threads go out onto the bus with the "privileged" bit set. This can become troublesome once there is an IOMMU or other form of memory protection downstream,

[PATCH V9 5/9] arm64/dma-mapping: Implement DMA_ATTR_PRIVILEGED

2017-01-06 Thread Sricharan R
From: Mitchel Humpherys The newly added DMA_ATTR_PRIVILEGED is useful for creating mappings that are only accessible to privileged DMA engines. Implement it in dma-iommu.c so that the ARM64 DMA IOMMU mapper can make use of it. Reviewed-by: Robin Murphy

[PATCH V9 4/9] common: DMA-mapping: add DMA_ATTR_PRIVILEGED attribute

2017-01-06 Thread Sricharan R
From: Mitchel Humpherys This patch adds the DMA_ATTR_PRIVILEGED attribute to the DMA-mapping subsystem. Some advanced peripherals such as remote processors and GPUs perform accesses to DMA buffers in both privileged "supervisor" and unprivileged "user" modes. This

[PATCH V9 3/9] iommu/io-pgtable-arm-v7s: Add support for the IOMMU_PRIV flag

2017-01-06 Thread Sricharan R
From: Robin Murphy The short-descriptor format also allows privileged-only mappings, so let's wire it up. Signed-off-by: Robin Murphy Tested-by: Sricharan R --- drivers/iommu/io-pgtable-arm-v7s.c | 6 +- 1 file

[PATCH V9 0/9] Add support for privileged mappings

2017-01-06 Thread Sricharan R
This series is a resend of the V5 that Mitch sent sometime back [2] All the patches are the same and i have just rebased. Redid patch [3], as it does not apply in this code base. Added a couple of more patches [4], [5] from Robin for adding the privileged attributes to armv7s format and arm-smmuv3

[PATCH V9 1/9] iommu: add IOMMU_PRIV attribute

2017-01-06 Thread Sricharan R
From: Mitchel Humpherys Add the IOMMU_PRIV attribute, which is used to indicate privileged mappings. Reviewed-by: Robin Murphy Tested-by: Robin Murphy Signed-off-by: Mitchel Humpherys Acked-by: Will

[PATCH V9 2/9] iommu/io-pgtable-arm: add support for the IOMMU_PRIV flag

2017-01-06 Thread Sricharan R
From: Jeremy Gebben Allow the creation of privileged mode mappings, for stage 1 only. Reviewed-by: Robin Murphy Tested-by: Robin Murphy Acked-by: Will Deacon Signed-off-by: Jeremy Gebben

Re: [PATCH v6 01/18] iommu/dma: Allow MSI-only cookies

2017-01-06 Thread Auger Eric
Hi Robin, On 06/01/2017 13:12, Robin Murphy wrote: > On 06/01/17 11:46, Auger Eric wrote: >> >> >> On 06/01/2017 11:59, Joerg Roedel wrote: >>> On Thu, Jan 05, 2017 at 07:04:29PM +, Eric Auger wrote: struct iommu_dma_cookie { - struct iova_domain iovad; - struct

Re: [PATCH v6 07/18] iommu: Implement reserved_regions iommu-group sysfs file

2017-01-06 Thread Auger Eric
Hi, On 06/01/2017 13:48, Joerg Roedel wrote: > On Fri, Jan 06, 2017 at 12:46:05PM +0100, Auger Eric wrote: >> On 06/01/2017 12:00, Joerg Roedel wrote: > >>> I think it also makes sense to report the type of the reserved region. >> >> What is the best practice in that case? Shall we put the type

Re: [PATCH v6 08/18] iommu/vt-d: Implement reserved region get/put callbacks

2017-01-06 Thread Auger Eric
Hi Joerg, On 06/01/2017 13:46, Joerg Roedel wrote: > On Fri, Jan 06, 2017 at 12:45:54PM +0100, Auger Eric wrote: >> On 06/01/2017 12:01, Joerg Roedel wrote: >>> On Thu, Jan 05, 2017 at 07:04:36PM +, Eric Auger wrote: > >>> That is different from what AMD does, can you also report the RMRR

Re: [PATCH v6 07/18] iommu: Implement reserved_regions iommu-group sysfs file

2017-01-06 Thread Joerg Roedel
On Fri, Jan 06, 2017 at 12:46:05PM +0100, Auger Eric wrote: > On 06/01/2017 12:00, Joerg Roedel wrote: > > I think it also makes sense to report the type of the reserved region. > > What is the best practice in that case? Shall we put the type enum > values as strings such as: > - direct > -

Re: [PATCH v6 08/18] iommu/vt-d: Implement reserved region get/put callbacks

2017-01-06 Thread Joerg Roedel
On Fri, Jan 06, 2017 at 12:45:54PM +0100, Auger Eric wrote: > On 06/01/2017 12:01, Joerg Roedel wrote: > > On Thu, Jan 05, 2017 at 07:04:36PM +, Eric Auger wrote: > > That is different from what AMD does, can you also report the RMRR > > regions for the device here (as direct-map regions)? >

Re: [PATCH v6 01/18] iommu/dma: Allow MSI-only cookies

2017-01-06 Thread Robin Murphy
On 06/01/17 11:46, Auger Eric wrote: > > > On 06/01/2017 11:59, Joerg Roedel wrote: >> On Thu, Jan 05, 2017 at 07:04:29PM +, Eric Auger wrote: >>> struct iommu_dma_cookie { >>> - struct iova_domain iovad; >>> - struct list_headmsi_page_list; >>> - spinlock_t

RE: [PATCH V8 1/9] iommu: add IOMMU_PRIV attribute

2017-01-06 Thread Sricharan
Hi Joerg, >-Original Message- >From: linux-arm-kernel [mailto:linux-arm-kernel-boun...@lists.infradead.org] >On Behalf Of Joerg Roedel >Sent: Friday, January 06, 2017 4:36 PM >To: Sricharan R >Cc: mitch...@codeaurora.org; pd...@codeaurora.org;

Re: [PATCH v6 01/18] iommu/dma: Allow MSI-only cookies

2017-01-06 Thread Auger Eric
On 06/01/2017 11:59, Joerg Roedel wrote: > On Thu, Jan 05, 2017 at 07:04:29PM +, Eric Auger wrote: >> struct iommu_dma_cookie { >> -struct iova_domain iovad; >> -struct list_headmsi_page_list; >> -spinlock_t msi_lock; >> +union { >> +

Re: [PATCH v6 07/18] iommu: Implement reserved_regions iommu-group sysfs file

2017-01-06 Thread Auger Eric
Hi Joerg, On 06/01/2017 12:00, Joerg Roedel wrote: > On Thu, Jan 05, 2017 at 07:04:35PM +, Eric Auger wrote: >> +list_for_each_entry_safe(region, next, _resv_regions, list) { >> +str += sprintf(str, "0x%016llx 0x%016llx\n", >> + (long long

Re: [PATCH v6 08/18] iommu/vt-d: Implement reserved region get/put callbacks

2017-01-06 Thread Auger Eric
Hi Joerg, On 06/01/2017 12:01, Joerg Roedel wrote: > On Thu, Jan 05, 2017 at 07:04:36PM +, Eric Auger wrote: >> +static void intel_iommu_get_resv_regions(struct device *device, >> + struct list_head *head) >> +{ >> +struct iommu_resv_region *reg; >> +

Re: [PATCH V8 1/9] iommu: add IOMMU_PRIV attribute

2017-01-06 Thread Joerg Roedel
On Mon, Jan 02, 2017 at 06:42:36PM +0530, Sricharan R wrote: > From: Mitchel Humpherys > > Add the IOMMU_PRIV attribute, which is used to indicate privileged > mappings. > > Reviewed-by: Robin Murphy > Tested-by: Robin Murphy

Re: [PATCH v6 00/18] KVM PCIe/MSI passthrough on ARM/ARM64 and IOVA reserved regions

2017-01-06 Thread Joerg Roedel
On Thu, Jan 05, 2017 at 07:04:28PM +, Eric Auger wrote: > iommu/dma: Allow MSI-only cookies > iommu: Rename iommu_dm_regions into iommu_resv_regions > iommu: Add a new type field in iommu_resv_region > iommu: iommu_alloc_resv_region > iommu: Only map direct mapped regions > iommu:

Re: [PATCH v6 08/18] iommu/vt-d: Implement reserved region get/put callbacks

2017-01-06 Thread Joerg Roedel
On Thu, Jan 05, 2017 at 07:04:36PM +, Eric Auger wrote: > +static void intel_iommu_get_resv_regions(struct device *device, > + struct list_head *head) > +{ > + struct iommu_resv_region *reg; > + > + reg = iommu_alloc_resv_region(IOAPIC_RANGE_START,

Re: [PATCH v6 07/18] iommu: Implement reserved_regions iommu-group sysfs file

2017-01-06 Thread Joerg Roedel
On Thu, Jan 05, 2017 at 07:04:35PM +, Eric Auger wrote: > + list_for_each_entry_safe(region, next, _resv_regions, list) { > + str += sprintf(str, "0x%016llx 0x%016llx\n", > +(long long int)region->start, > +(long long

Re: [PATCH v6 01/18] iommu/dma: Allow MSI-only cookies

2017-01-06 Thread Joerg Roedel
On Thu, Jan 05, 2017 at 07:04:29PM +, Eric Auger wrote: > struct iommu_dma_cookie { > - struct iova_domain iovad; > - struct list_headmsi_page_list; > - spinlock_t msi_lock; > + union { > + struct iova_domain iovad; > +

Re: [PATCH v5 13/17] irqdomain: irq_domain_check_msi_remap

2017-01-06 Thread Marc Zyngier
On 06/01/17 04:27, Bharat Bhushan wrote: > Hi Mark, > >> -Original Message- >> From: Auger Eric [mailto:eric.au...@redhat.com] >> Sent: Thursday, January 05, 2017 5:39 PM >> To: Marc Zyngier ; eric.auger@gmail.com; >> christoffer.d...@linaro.org;

RE: [PATCH v6 17/18] vfio/type1: Check MSI remapping at irq domain level

2017-01-06 Thread Bharat Bhushan
> -Original Message- > From: Marc Zyngier [mailto:marc.zyng...@arm.com] > Sent: Friday, January 06, 2017 2:50 PM > To: Auger Eric ; Bharat Bhushan > ; eric.auger@gmail.com; > christoffer.d...@linaro.org; robin.mur...@arm.com; >

Re: [PATCH v6 17/18] vfio/type1: Check MSI remapping at irq domain level

2017-01-06 Thread Marc Zyngier
On 06/01/17 09:08, Auger Eric wrote: > Hi Bharat > > On 06/01/2017 09:50, Bharat Bhushan wrote: >> Hi Eric, >> >>> -Original Message- >>> From: Eric Auger [mailto:eric.au...@redhat.com] >>> Sent: Friday, January 06, 2017 12:35 AM >>> To: eric.au...@redhat.com; eric.auger@gmail.com;

Re: [PATCH v6 17/18] vfio/type1: Check MSI remapping at irq domain level

2017-01-06 Thread Auger Eric
Hi Bharat On 06/01/2017 09:50, Bharat Bhushan wrote: > Hi Eric, > >> -Original Message- >> From: Eric Auger [mailto:eric.au...@redhat.com] >> Sent: Friday, January 06, 2017 12:35 AM >> To: eric.au...@redhat.com; eric.auger@gmail.com; >> christoffer.d...@linaro.org;

RE: [PATCH v6 17/18] vfio/type1: Check MSI remapping at irq domain level

2017-01-06 Thread Bharat Bhushan
Hi Eric, > -Original Message- > From: Eric Auger [mailto:eric.au...@redhat.com] > Sent: Friday, January 06, 2017 12:35 AM > To: eric.au...@redhat.com; eric.auger@gmail.com; > christoffer.d...@linaro.org; marc.zyng...@arm.com; > robin.mur...@arm.com; alex.william...@redhat.com; >

Re: [PATCH v5 13/17] irqdomain: irq_domain_check_msi_remap

2017-01-06 Thread Auger Eric
Hi Bharat, On 06/01/2017 05:27, Bharat Bhushan wrote: > Hi Mark, > >> -Original Message- >> From: Auger Eric [mailto:eric.au...@redhat.com] >> Sent: Thursday, January 05, 2017 5:39 PM >> To: Marc Zyngier ; eric.auger@gmail.com; >> christoffer.d...@linaro.org;