diff options
| author | Kirill A. Shutemov <[email protected]> | 2023-03-12 14:26:06 +0300 |
|---|---|---|
| committer | Dave Hansen <[email protected]> | 2023-03-16 13:08:40 -0700 |
| commit | 23e5d9ec2bab53c4e5fbac675304e699726c1ac5 (patch) | |
| tree | 4a147d3d5733a4b57a1e4d4e99f99e62553fdc17 /include/linux | |
| parent | 400b9b93441cd4e2fe824a70140f3d5a2a9c802b (diff) | |
x86/mm/iommu/sva: Make LAM and SVA mutually exclusive
IOMMU and SVA-capable devices know nothing about LAM and only expect
canonical addresses. An attempt to pass down tagged pointer will lead
to address translation failure.
By default do not allow to enable both LAM and use SVA in the same
process.
The new ARCH_FORCE_TAGGED_SVA arch_prctl() overrides the limitation.
By using the arch_prctl() userspace takes responsibility to never pass
tagged address to the device.
Signed-off-by: Kirill A. Shutemov <[email protected]>
Signed-off-by: Dave Hansen <[email protected]>
Reviewed-by: Ashok Raj <[email protected]>
Reviewed-by: Jacob Pan <[email protected]>
Acked-by: Peter Zijlstra (Intel) <[email protected]>
Link: https://lore.kernel.org/all/20230312112612.31869-12-kirill.shutemov%40linux.intel.com
Diffstat (limited to 'include/linux')
| -rw-r--r-- | include/linux/mmu_context.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/include/linux/mmu_context.h b/include/linux/mmu_context.h index 14b9c1fa05c4..f2b7a3f04099 100644 --- a/include/linux/mmu_context.h +++ b/include/linux/mmu_context.h @@ -35,4 +35,11 @@ static inline unsigned long mm_untag_mask(struct mm_struct *mm) } #endif +#ifndef arch_pgtable_dma_compat +static inline bool arch_pgtable_dma_compat(struct mm_struct *mm) +{ + return true; +} +#endif + #endif |