If CONFIG_PHYS_ADDR_T_64BIT=n:
drivers/iommu/ipmmu-vmsa.c: In function 'ipmmu_domain_init_context':
drivers/iommu/ipmmu-vmsa.c:434:2: warning: right shift count >= width of
type
ipmmu_ctx_write(domain, IMTTUBR0, ttbr >> 32);
^
As io_pgtable_cfg.arm_lpae_s1_cfg.ttbr[] is an
This patch series modifies the existing perf_event_amd_iommu driver
to support systems with multiple IOMMUs. It introduces new AMD IOMMU APIs,
which will are used by the AMD IOMMU Perf driver to access performance
counters in multiple IOMMUs.
In addition, this series should also fix current AMD
From: Joerg Roedel
This lock only protects the address allocation bitmap in one
aperture.
Signed-off-by: Joerg Roedel
---
drivers/iommu/amd_iommu.c | 10 ++
1 file changed, 10 insertions(+)
diff --git a/drivers/iommu/amd_iommu.c
From: Joerg Roedel
There have been present PTEs which in theory could have made
it to the IOMMU TLB. Flush the addresses out on the error
path to make sure no stale entries remain.
Signed-off-by: Joerg Roedel
---
drivers/iommu/amd_iommu.c | 2 ++
1 file
From: Joerg Roedel
Moving it before the pte_pages array puts in into the same
cache-line as the spin-lock and the bitmap array pointer.
This should safe a cache-miss.
Signed-off-by: Joerg Roedel
---
drivers/iommu/amd_iommu.c | 3 +--
1 file changed, 1
From: Joerg Roedel
This prevents possible flooding of the kernel log.
Signed-off-by: Joerg Roedel
---
drivers/iommu/amd_iommu.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/iommu/amd_iommu.c b/drivers/iommu/amd_iommu.c
index
From: Joerg Roedel
It is only used in this file anyway, so keep it there. Same
with 'struct aperture_range'.
Signed-off-by: Joerg Roedel
---
drivers/iommu/amd_iommu.c | 40
drivers/iommu/amd_iommu_types.h | 40
From: Joerg Roedel
Make this pointer percpu so that we start searching for new
addresses in the range we last stopped and which is has a
higher probability of being still in the cache.
Signed-off-by: Joerg Roedel
---
drivers/iommu/amd_iommu.c | 39
The current amd_iommu_pc_get_set_reg_val() does not support muli-IOMMU
system. This patch replace amd_iommu_pc_get_set_reg_val() with
amd_iommu_pc_set_reg_val() and amd_iommu_pc_[set|get]_cnt_vals().
This implementation makes an assumption that the counters on all IOMMUs
will be programmed the
Currently, amd_iommu_pc_get_max_[banks|counters]() require devid,
which should not be the case. Also, these don't properly support
multi-IOMMU system.
Current and future AMD systems with IOMMU that support perf counter
would likely contain homogeneous IOMMUs where multiple IOMMUs are
availalbe.
Introduce a helper function to calculate bit-index for assigning
performance counter assignment.
Signed-off-by: Suravee Suthikulpanit
---
arch/x86/kernel/cpu/perf_event_amd_iommu.c | 20 +++-
1 file changed, 15 insertions(+), 5 deletions(-)
diff
To enable AMD IOMMU PMU to support multiple IOMMUs, this patch introduces
a new data structure, perf_amd_iommu.prev_cnts, to track previous counts
of IOMMU performance counters in multi-IOMMU environment.
Also, this patch allocates perf_iommu_cnts for internal use
when manages counters.
This patch introduces amd_iommu_get_num_iommus(). Initially, this is
intended to be used by Perf AMD IOMMU driver.
Signed-off-by: Suravee Suthikulpanit
---
drivers/iommu/amd_iommu_init.c| 16
include/linux/perf/perf_event_amd_iommu.h |
This patch consolidates "arch/x86/kernel/cpu/perf_event_amd_iommu.h" and
"drivers/iommu/amd_iommu_proto.h", which contain duplicate function
declarations, into "include/linux/perf/perf_event_amd_iommu.h"
Signed-off-by: Suravee Suthikulpanit
---
From: Joerg Roedel
The page-offset of the aperture must be passed instead of 0.
Signed-off-by: Joerg Roedel
---
drivers/iommu/amd_iommu.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/iommu/amd_iommu.c b/drivers/iommu/amd_iommu.c
From: Joerg Roedel
Since the allocator wraparound happens in this function now,
flush the iommu tlb there too.
Signed-off-by: Joerg Roedel
---
drivers/iommu/amd_iommu.c | 21 -
1 file changed, 16 insertions(+), 5 deletions(-)
diff --git
From: Joerg Roedel
First search for a non-contended aperture with trylock
before spinning.
Signed-off-by: Joerg Roedel
---
drivers/iommu/amd_iommu.c | 20 +---
1 file changed, 17 insertions(+), 3 deletions(-)
diff --git
From: Joerg Roedel
Parameter is not needed because the value is part of the
already passed in struct dma_ops_domain.
Signed-off-by: Joerg Roedel
---
drivers/iommu/amd_iommu.c | 10 --
1 file changed, 4 insertions(+), 6 deletions(-)
diff --git
From: Joerg Roedel
Instead of skipping to the next aperture, first try again in
the current one.
Signed-off-by: Joerg Roedel
---
drivers/iommu/amd_iommu.c | 29 +++--
1 file changed, 19 insertions(+), 10 deletions(-)
diff --git
From: Joerg Roedel
The flushing of iommu tlbs is now done on a per-range basis.
So there is no need anymore for domain-wide flush tracking.
Signed-off-by: Joerg Roedel
---
drivers/iommu/amd_iommu.c | 30 ++
1 file changed, 6
From: Joerg Roedel
Make this a wrapper around iommu_ops_area_alloc() for now
and add more logic to this function later on.
Signed-off-by: Joerg Roedel
---
drivers/iommu/amd_iommu.c | 37 +
1 file changed, 25 insertions(+),
From: Joerg Roedel
This allows to build up the page-tables without holding any
locks. As a consequence it removes the need to pre-populate
dma_ops page-tables.
Signed-off-by: Joerg Roedel
---
drivers/iommu/amd_iommu.c | 16 +---
1 file changed, 13
From: Joerg Roedel
Make sure the aperture range is fully initialized before it
is visible to the address allocator.
Signed-off-by: Joerg Roedel
---
drivers/iommu/amd_iommu.c | 33 -
1 file changed, 20 insertions(+), 13
From: Joerg Roedel
Don't flush the iommu tlb when we free something behind the
current next_bit pointer. Update the next_bit pointer
instead and let the flush happen on the next wraparound in
the allocation path.
Signed-off-by: Joerg Roedel
---
From: Joerg Roedel
Remove the long holding times of the domain->lock and rely
on the bitmap_lock instead.
Signed-off-by: Joerg Roedel
---
drivers/iommu/amd_iommu.c | 70 ---
1 file changed, 11 insertions(+), 59
From: Joerg Roedel
It points to the next aperture index to allocate from. We
don't need the full address anymore because this is now
tracked in struct aperture_range.
Signed-off-by: Joerg Roedel
---
drivers/iommu/amd_iommu.c | 26 +-
1
From: Joerg Roedel
This allows to keep the bitmap_lock only for a very short
period of time.
Signed-off-by: Joerg Roedel
---
drivers/iommu/amd_iommu.c | 8
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/iommu/amd_iommu.c
From: Joerg Roedel
Instead of setting need_flush, do the flush directly in
dma_ops_free_addresses.
Signed-off-by: Joerg Roedel
---
drivers/iommu/amd_iommu.c | 6 --
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/drivers/iommu/amd_iommu.c
From: Joerg Roedel
It really belongs there and not in __map_single.
Signed-off-by: Joerg Roedel
---
drivers/iommu/amd_iommu.c | 29 ++---
1 file changed, 10 insertions(+), 19 deletions(-)
diff --git a/drivers/iommu/amd_iommu.c
From: Joerg Roedel
Preallocate between 4 and 8 apertures when a device gets it
dma_mask. With more apertures we reduce the lock contention
of the domain lock significantly.
Signed-off-by: Joerg Roedel
---
drivers/iommu/amd_iommu.c | 60
On Mon, Dec 21, 2015 at 06:23:50PM +, Will Deacon wrote:
> git://git.kernel.org/pub/scm/linux/kernel/git/will/linux.git
> for-joerg/arm-smmu/updates
Pulled, thanks Will.
___
iommu mailing list
iommu@lists.linux-foundation.org
31 matches
Mail list logo