linux-yocto/arch
Lu Baolu 9f0a7ab700 iommu/sva: invalidate stale IOTLB entries for kernel address space
commit e37d5a2d60a338c5917c45296bac65da1382eda5 upstream.

Introduce a new IOMMU interface to flush IOTLB paging cache entries for
the CPU kernel address space.  This interface is invoked from the x86
architecture code that manages combined user and kernel page tables,
specifically before any kernel page table page is freed and reused.

This addresses the main issue with vfree() which is a common occurrence
and can be triggered by unprivileged users.  While this resolves the
primary problem, it doesn't address some extremely rare case related to
memory unplug of memory that was present as reserved memory at boot, which
cannot be triggered by unprivileged users.  The discussion can be found at
the link below.

Enable SVA on x86 architecture since the IOMMU can now receive
notification to flush the paging cache before freeing the CPU kernel page
table pages.

Link: https://lkml.kernel.org/r/20251022082635.2462433-9-baolu.lu@linux.intel.com
Link: https://lore.kernel.org/linux-iommu/04983c62-3b1d-40d4-93ae-34ca04b827e5@intel.com/
Co-developed-by: Jason Gunthorpe <jgg@nvidia.com>
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
Signed-off-by: Lu Baolu <baolu.lu@linux.intel.com>
Suggested-by: Jann Horn <jannh@google.com>
Reviewed-by: Jason Gunthorpe <jgg@nvidia.com>
Reviewed-by: Vasant Hegde <vasant.hegde@amd.com>
Reviewed-by: Kevin Tian <kevin.tian@intel.com>
Cc: Alistair Popple <apopple@nvidia.com>
Cc: Andy Lutomirski <luto@kernel.org>
Cc: Borislav Betkov <bp@alien8.de>
Cc: Dave Hansen <dave.hansen@linux.intel.com>
Cc: David Hildenbrand <david@redhat.com>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Jean-Philippe Brucker <jean-philippe@linaro.org>
Cc: Joerg Roedel <joro@8bytes.org>
Cc: Liam Howlett <liam.howlett@oracle.com>
Cc: Lorenzo Stoakes <lorenzo.stoakes@oracle.com>
Cc: Matthew Wilcox (Oracle) <willy@infradead.org>
Cc: Michal Hocko <mhocko@kernel.org>
Cc: Mike Rapoport (Microsoft) <rppt@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Robin Murohy <robin.murphy@arm.com>
Cc: Thomas Gleinxer <tglx@linutronix.de>
Cc: "Uladzislau Rezki (Sony)" <urezki@gmail.com>
Cc: Vinicius Costa Gomes <vinicius.gomes@intel.com>
Cc: Vlastimil Babka <vbabka@suse.cz>
Cc: Will Deacon <will@kernel.org>
Cc: Yi Lai <yi1.lai@intel.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2026-01-23 11:21:35 +01:00
..
alpha alpha: don't reference obsolete termio struct for TC* constants 2026-01-17 16:35:16 +01:00
arc Ext4 bug fixes for 6.18-rc2, including 2025-10-15 07:51:57 -07:00
arm ARM: dts: imx6q-ba16: fix RTC interrupt level 2026-01-17 16:35:20 +01:00
arm64 arm64: dts: mba8mx: Fix Ethernet PHY IRQ support 2026-01-17 16:35:21 +01:00
csky csky: fix csky_cmpxchg_fixup not working 2026-01-17 16:35:16 +01:00
hexagon Remove long-stale ext3 defconfig option 2025-10-15 07:57:28 -07:00
loongarch LoongArch: KVM: Fix kvm_device leak in kvm_pch_pic_destroy() 2026-01-23 11:21:32 +01:00
m68k Ext4 bug fixes for 6.18-rc2, including 2025-10-15 07:51:57 -07:00
microblaze Ext4 bug fixes for 6.18-rc2, including 2025-10-15 07:51:57 -07:00
mips mips: fix HIGHMEM initialization 2026-01-23 11:21:20 +01:00
nios2 Summary of significant series in this pull request: 2025-10-02 18:18:33 -07:00
openrisc Ext4 bug fixes for 6.18-rc2, including 2025-10-15 07:51:57 -07:00
parisc parisc: entry: set W bit for !compat tasks in syscall_restore_rfi() 2026-01-08 10:17:01 +01:00
powerpc powerpc/pseries/cmm: call balloon_devinfo_init() also without CONFIG_BALLOON_COMPACTION 2026-01-08 10:17:02 +01:00
riscv riscv: pgtable: Cleanup useless VA_USER_XXX definitions 2026-01-17 16:35:25 +01:00
s390 KVM: s390: Fix gmap_helper_zap_one_page() again 2026-01-08 10:16:41 +01:00
sh Remove long-stale ext3 defconfig option 2025-10-15 07:57:28 -07:00
sparc sparc/PCI: Correct 64-bit non-pref -> pref BAR resources 2026-01-17 16:35:29 +01:00
um um: init cpu_tasks[] earlier 2026-01-02 12:56:59 +01:00
x86 iommu/sva: invalidate stale IOTLB entries for kernel address space 2026-01-23 11:21:35 +01:00
xtensa Ext4 bug fixes for 6.18-rc2, including 2025-10-15 07:51:57 -07:00
.gitignore
Kconfig compiler_types: Introduce __nocfi_generic 2025-10-29 20:04:55 -07:00