Home
last modified time | relevance | path

Searched hist:"77 f3445866c39d8866b31d8d9fa47c7c20938e05" (Results 1 – 2 of 2) sorted by relevance

/openbmc/linux/drivers/iommu/
H A Dio-pgtable-arm-v7s.cdiff 77f3445866c39d8866b31d8d9fa47c7c20938e05 Fri Jun 23 06:02:38 CDT 2017 Will Deacon <will.deacon@arm.com> iommu/io-pgtable-arm: Use dma_wmb() instead of wmb() when publishing table

When writing a new table entry, we must ensure that the contents of the
table is made visible to the SMMU page table walker before the updated
table entry itself.

This is currently achieved using wmb(), which expands to an expensive and
unnecessary DSB instruction. Ideally, we'd just use cmpxchg64_release when
writing the table entry, but this doesn't have memory ordering semantics
on !SMP systems.

Instead, use dma_wmb(), which emits DMB OSHST. Strictly speaking, this
does more than we require (since it targets the outer-shareable domain),
but it's likely to be significantly faster than the DSB approach.

Reported-by: Linu Cherian <linu.cherian@cavium.com>
Suggested-by: Robin Murphy <robin.murphy@arm.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
H A Dio-pgtable-arm.cdiff 77f3445866c39d8866b31d8d9fa47c7c20938e05 Fri Jun 23 06:02:38 CDT 2017 Will Deacon <will.deacon@arm.com> iommu/io-pgtable-arm: Use dma_wmb() instead of wmb() when publishing table

When writing a new table entry, we must ensure that the contents of the
table is made visible to the SMMU page table walker before the updated
table entry itself.

This is currently achieved using wmb(), which expands to an expensive and
unnecessary DSB instruction. Ideally, we'd just use cmpxchg64_release when
writing the table entry, but this doesn't have memory ordering semantics
on !SMP systems.

Instead, use dma_wmb(), which emits DMB OSHST. Strictly speaking, this
does more than we require (since it targets the outer-shareable domain),
but it's likely to be significantly faster than the DSB approach.

Reported-by: Linu Cherian <linu.cherian@cavium.com>
Suggested-by: Robin Murphy <robin.murphy@arm.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>