mm-always-have-io_remap_pfn_range-set-pgprot_decrypted.patch removed from -mm tree
The patch titled
Subject: mm: always have io_remap_pfn_range() set pgprot_decrypted()
has been removed from the -mm tree. Its filename was
mm-always-have-io_remap_pfn_range-set-pgprot_decrypted.patch
This patch was dropped because it was merged into mainline or a subsystem tree
------------------------------------------------------
From: Jason Gunthorpe <[email protected]>
Subject: mm: always have io_remap_pfn_range() set pgprot_decrypted()
The purpose of io_remap_pfn_range() is to map IO memory, such as a memory mapped IO exposed through a PCI BAR. IO devices do not understand encryption, so this memory must always be decrypted. Automatically call pgprot_decrypted() as part of the generic implementation.
This fixes a bug where enabling AMD SME causes subsystems, such as RDMA, using io_remap_pfn_range() to expose BAR pages to user space to fail. The CPU will encrypt access to those BAR pages instead of passing unencrypted IO directly to the device.
Places not mapping IO should use remap_pfn_range().
CcK Arnd Bergmann <[email protected]>
---
include/linux/mm.h | 9 +++++++++ include/linux/pgtable.h | 4 ---- 2 files changed, 9 insertions(+), 4 deletions(-)
include/linux/mm.h renamed from include/linux/mm.h~mm-always-have-io_remap_pfn_range-set-pgprot_decrypted +9 -0
@@ -2759,6 +2759,15 @@ static inline vm_fault_t vmf_insert_pagereturn VM_FAULT_NOPAGE ; } +#ifndef io_remap_pfn_range +static inline int io_remap_pfn_range (struct vm_area_struct *vma, +unsigned long addr,unsigned long pfn, +unsigned long size,pgprot_t prot) +{ +return remap_pfn_range (vma, addr, pfn, size,pgprot_decrypted (prot)); +} +#endif +static inline vm_fault_t vmf_error (int err) {if (err == -ENOMEM )
include/linux/pgtable.h renamed from include/linux/pgtable.h~mm-always-have-io_remap_pfn_range-set-pgprot_decrypted +0 -4
@@ -1427,10 +1427,6 @@ typedef unsigned int pgtbl_mod_mask;#endif /* !__ASSEMBLY__ */ -#ifndef io_remap_pfn_range -#define io_remap_pfn_range remap_pfn_range -#endif -#ifndef has_transparent_hugepage#ifdef CONFIG_TRANSPARENT_HUGEPAGE #define has_transparent_hugepage () 1
_
Patches currently in -mm which might be from [email protected] are
mm-gup-use-unpin_user_pages-in-check_and_migrate_cma_pages.patch