summaryrefslogtreecommitdiffstats
path: root/arch/x86/include/asm/mmu.h
diff options
context:
space:
mode:
authorKirill A. Shutemov <kirill.shutemov@linux.intel.com>2023-03-12 12:26:06 +0100
committerDave Hansen <dave.hansen@linux.intel.com>2023-03-16 21:08:40 +0100
commit23e5d9ec2bab53c4e5fbac675304e699726c1ac5 (patch)
tree4a147d3d5733a4b57a1e4d4e99f99e62553fdc17 /arch/x86/include/asm/mmu.h
parentiommu/sva: Replace pasid_valid() helper with mm_valid_pasid() (diff)
downloadlinux-23e5d9ec2bab53c4e5fbac675304e699726c1ac5.tar.xz
linux-23e5d9ec2bab53c4e5fbac675304e699726c1ac5.zip
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 <kirill.shutemov@linux.intel.com> Signed-off-by: Dave Hansen <dave.hansen@linux.intel.com> Reviewed-by: Ashok Raj <ashok.raj@intel.com> Reviewed-by: Jacob Pan <jacob.jun.pan@linux.intel.com> Acked-by: Peter Zijlstra (Intel) <peterz@infradead.org> Link: https://lore.kernel.org/all/20230312112612.31869-12-kirill.shutemov%40linux.intel.com
Diffstat (limited to 'arch/x86/include/asm/mmu.h')
-rw-r--r--arch/x86/include/asm/mmu.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/arch/x86/include/asm/mmu.h b/arch/x86/include/asm/mmu.h
index e80762e998ce..0da5c227f490 100644
--- a/arch/x86/include/asm/mmu.h
+++ b/arch/x86/include/asm/mmu.h
@@ -14,6 +14,8 @@
#define MM_CONTEXT_HAS_VSYSCALL 1
/* Do not allow changing LAM mode */
#define MM_CONTEXT_LOCK_LAM 2
+/* Allow LAM and SVA coexisting */
+#define MM_CONTEXT_FORCE_TAGGED_SVA 3
/*
* x86 has arch-specific MMU state beyond what lives in mm_struct.