linux/drivers
Lu Baolu e37d5a2d60 iommu/sva: invalidate stale IOTLB entries for kernel address space
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>
History 2025-11-16 17:28:18 -08:00
..
accel accel/qaic: Synchronize access to DBC request queue head & tail pointer 2025-10-14 08:56:31 -06:00
accessibility treewide: Switch/rename to timer_delete[_sync]() 2025-04-05 10:30:12 +02:00
acpi Merge branches 'acpi-cppc' and 'acpi-docs' 2025-11-06 22:10:27 +01:00
amba PM: domains: Add flags to specify power on attach/detach 2025-07-07 20:41:20 +02:00
android binder: remove "invalid inc weak" check 2025-10-22 08:04:15 +02:00
ata ata: libata-core: relax checks in ata_read_log_directory() 2025-10-13 09:12:36 +02:00
atm atm: atmtcp: Prevent arbitrary write in atmtcp_recv_control(). 2025-08-22 17:23:15 -07:00
auxdisplay treewide, timers: Rename from_timer() to timer_container_of() 2025-06-08 09:07:37 +02:00
base drivers/base/node: fold unregister_node() into unregister_one_node() 2025-11-16 17:28:03 -08:00
bcma bcma: don't register devices disabled in OF 2025-10-20 13:54:15 +02:00
block block-6.18-20251031 2025-10-31 12:57:19 -07:00
bluetooth Bluetooth: btrtl: Fix memory leak in rtlbt_parse_firmware_v2() 2025-10-31 12:42:47 -04:00
bus Char/Misc/IIO/Binder changes for 6.18-rc1 2025-10-04 16:26:32 -07:00
cache cache: sifive_ccache: Optimize cache flushes 2025-09-11 19:13:21 +01:00
cdrom cdrom: Call cdrom_mrw_exit from cdrom_release function 2025-07-22 19:10:17 -06:00
cdx Char/Misc/IIO/Binder changes for 6.18-rc1 2025-10-04 16:26:32 -07:00
char mm: update mem char driver to use mmap_prepare 2025-11-16 17:28:13 -08:00
clk There's a bunch of patches here across drivers/clk/ to migrate drivers to use 2025-10-07 09:28:37 -07:00
clocksource hyperv-next for v6.18 2025-10-07 08:40:15 -07:00
comedi comedi: fix divide-by-zero in comedi_buf_munge() 2025-10-22 08:03:52 +02:00
connector connector/cn_proc: revert "connector: Fix proc_event_num_listeners count not cleared" 2024-02-13 11:15:44 +01:00
counter counter: ti-ecap-capture: Use devm_pm_runtime_enable() 2025-08-24 17:02:03 +09:00
cpufreq cpufreq/amd-pstate: Fix a regression leading to EPP 0 after hibernate 2025-10-15 08:21:16 -05:00
cpuidle RISC-V updates for v6.18-rc5 2025-11-06 15:44:18 -08:00
crypto crypto: aspeed - fix double free caused by devm 2025-10-23 12:53:23 +08:00
cxl cxl/trace: Subtract to find an hpa_alias0 in cxl_poison events 2025-10-14 14:48:14 -07:00
dax device/dax: update devdax to use mmap_prepare 2025-11-16 17:28:10 -08:00
dca Driver core changes for 6.11-rc1 2024-07-25 10:42:22 -07:00
devfreq PM / devfreq: rockchip-dfi: switch to FIELD_PREP_WM16 macro 2025-10-15 10:39:54 -04:00
dibs dibs: Check correct variable in dibs_init() 2025-09-26 15:10:59 -07:00
dio dio: Have dio_bus_match() callback take a const * 2024-07-10 15:38:14 +02:00
dma dmaengine updates for v6.18 2025-10-06 10:37:06 -07:00
dma-buf dma-fence: Fix safe access wrapper to call timeline name method 2025-10-24 16:56:37 +01:00
dpll dpll: zl3073x: Fix output pin registration 2025-10-28 18:54:48 -07:00
edac EDAC/versalnet: Fix off by one in handle_error() 2025-10-13 17:14:47 +02:00
eisa EISA: Move devlist.h out of obj to always 2025-05-07 07:01:01 +02:00
extcon extcon: max14526: depends on I2C to prevent build warning/errors 2025-09-08 15:13:06 +09:00
firewire firewire: init_ohci1394_dma: add missing function parameter documentation 2025-10-25 08:29:56 +09:00
firmware Arm SCMI fixes for v6.18 2025-10-23 22:30:01 +02:00
fpga fpga: zynq_fpga: Fix the wrong usage of dma_map_sgtable() 2025-08-19 12:54:45 +02:00
fsi Driver core changes for 6.17-rc1 2025-07-29 12:15:39 -07:00
fwctl pds_fwctl: Replace kzalloc + copy_from_user with memdup_user in pdsfc_fw_rpc 2025-09-22 10:33:10 -03:00
gnss [tree-wide] finally take no_llseek out 2024-09-27 08:18:43 -07:00
gpio gpio: tb10x: Drop unused tb10x_set_bits() function 2025-11-06 18:19:44 +01:00
gpu Third round of Kbuild fixes for 6.19 2025-11-09 09:22:08 -08:00
greybus greybus: svc: use string choice helpers instead of ternary operator 2025-08-19 12:50:31 +02:00
hid hid-for-linus-2025101701 2025-10-18 08:18:18 -10:00
hsi HSI: omap_ssi_port: Remove redundant pm_runtime_mark_last_busy() calls 2025-09-05 22:56:59 +02:00
hte treewide: Switch/rename to timer_delete[_sync]() 2025-04-05 10:30:12 +02:00
hv Drivers: hv: Make CONFIG_HYPERV bool 2025-10-01 00:00:45 +00:00
hwmon hwmon: (sht3x) Fix error handling 2025-10-19 18:56:14 -07:00
hwspinlock hwspinlock: Remove unused hwspin_lock_get_id() 2025-03-21 17:12:04 -05:00
hwtracing Char/Misc/IIO/Binder changes for 6.18-rc1 2025-10-04 16:26:32 -07:00
i2c i2c: muxes: pca954x: Fix broken reset-gpio usage 2025-11-03 18:04:15 +01:00
i3c i3c: fix big-endian FIFO transfers 2025-09-29 00:17:22 +02:00
idle intel_idle: Remove unnecessary address-of operators 2025-09-01 17:32:25 +02:00
iio IIO: New device support, features and cleanup for 6.18 2025-09-23 14:15:25 +02:00
infiniband RDMA/irdma: Fix vf_id size to u16 to avoid overflow 2025-11-02 06:46:01 -05:00
input Input updates for v6.18-rc0 2025-10-08 09:44:38 -07:00
interconnect Merge branch 'icc-glymur' into icc-next 2025-09-12 13:54:17 +03:00
iommu iommu/sva: invalidate stale IOTLB entries for kernel address space 2025-11-16 17:28:18 -08:00
ipack driver core: have match() callback in struct bus_type take a const * 2024-07-03 15:16:54 +02:00
irqchip irqchip/sifive-plic: Avoid interrupt ID 0 handling during suspend/resume 2025-10-07 10:23:22 +02:00
isdn isdn: mISDN: hfcsusb: fix memory leak in hfcsusb_probe() 2025-10-31 17:39:14 -07:00
leds leds: led-class: Add Device Tree support to led_get() 2025-09-16 16:49:28 +01:00
macintosh treewide: Switch/rename to timer_delete[_sync]() 2025-04-05 10:30:12 +02:00
mailbox qcom: add Glymur CPUCP mailbox binding 2025-10-08 11:44:21 -07:00
mcb mcb: use sysfs_emit_at() instead of scnprintf() in show functions 2025-07-16 14:17:07 +02:00
md dm docs: fix typos 2025-10-03 18:48:02 -07:00
media media: videobuf2: forbid remove_bufs when legacy fileio is active 2025-10-24 11:16:26 +02:00
memory memory: tegra210: Use bindings for client ids 2025-09-10 11:40:44 +02:00
memstick Summary of significant series in this pull request: 2025-10-02 18:18:33 -07:00
message scsi: switch ->bios_param() to passing gendisk 2025-08-13 02:59:28 -04:00
mfd mfd: ls2kbmc: check for devm_mfd_add_devices() failure 2025-10-03 10:38:23 -05:00
misc Char/Misc driver fixes for 6.18-rc3 2025-10-26 10:33:46 -07:00
mmc rpmb: move rpmb_frame struct and constants to common header 2025-10-13 13:18:03 +02:00
most most: usb: hdm_probe: Fix calling put_device() before device initialization 2025-10-22 08:04:43 +02:00
mtd MTD core: 2025-10-04 15:50:37 -07:00
mux hardening updates for v6.17-rc1 2025-07-28 17:16:12 -07:00
net lan966x: Fix sleeping in atomic context 2025-11-06 07:31:34 -08:00
nfc nfc: s3fwrn5: Use SHA-1 library instead of crypto_shash 2025-08-18 17:29:08 -07:00
ntb NTB: epf: Add Renesas rcar support 2025-09-22 09:35:21 -04:00
nubus nubus: Make nubus_bus_type static and constant 2024-01-03 13:33:59 +01:00
nvdimm libnvdimm for 6.18 2025-10-06 11:17:18 -07:00
nvme nvme-pci: use blk_map_iter for p2p metadata 2025-10-22 19:46:25 -07:00
nvmem nvmem: rcar-efuse: add missing MODULE_DEVICE_TABLE 2025-10-22 08:02:38 +02:00
of of/irq: Export of_msi_xlate() for module usage 2025-10-24 07:44:09 -05:00
opp OPP: Add support to find OPP for a set of keys 2025-08-26 10:40:58 +05:30
parisc char: misc: Register fixed minor EISA_EEPROM_MINOR in linux/miscdevice.h 2025-08-19 12:41:18 +02:00
parport treewide, timers: Rename from_timer() to timer_container_of() 2025-06-08 09:07:37 +02:00
pci pci-v6.18-fixes-4 2025-10-31 14:24:32 -07:00
pcmcia pcmcia: Add error handling for add_interval() in do_validate_mem() 2025-08-16 15:49:58 +02:00
peci peci: remove unneeded 'fast_io' parameter in regmap_config 2025-08-28 22:43:23 +02:00
perf arm64 fixes for -rc1 2025-10-07 08:59:25 -07:00
phy phy-for-6.18 2025-10-06 10:34:22 -07:00
pinctrl pci-v6.18-changes 2025-10-06 10:41:03 -07:00
platform platform-drivers-x86 for v6.18-3 2025-11-05 11:08:10 -08:00
pmdomain soc: driver updates for 6.18 2025-10-01 17:32:51 -07:00
pnp PNP: isapnp: use str_plural() to simplify the code 2025-08-25 17:30:16 +02:00
power power supply and reset changes for the 6.18 series 2025-10-01 13:02:59 -07:00
powercap powercap: idle_inject: use us_to_ktime() where appropriate 2025-08-21 21:57:54 +02:00
pps pps: fix warning in pps_register_cdev when register device fail 2025-09-06 16:00:40 +02:00
ps3 powerpc/ps3: Use str_write_read() in ps3stor_read_write_sectors() 2025-09-06 17:01:26 +05:30
ptp ptp: Allow exposing cycles only for clocks with free-running counter 2025-10-31 16:27:40 -07:00
pwm gpio updates for v6.18-rc1 2025-10-01 11:34:12 -07:00
rapidio Merge 6.16-rc3 into driver-core-next 2025-06-23 07:53:36 +02:00
ras RAS: Export log_non_standard_event() to drivers 2025-09-15 16:20:29 +02:00
regulator regulator: bd718x7: Fix voltages scaled by resistor divider 2025-10-30 11:30:23 +00:00
remoteproc remoteproc updates for v6.18 2025-10-04 15:45:17 -07:00
reset soc: driver updates for 6.18 2025-10-01 17:32:51 -07:00
rpmsg rpmsg: qcom_smd: Fix fallback to qcom,ipc parse 2025-09-20 21:29:48 -05:00
rtc rtc: rx8025: fix incorrect register reference 2025-11-08 20:56:12 +01:00
s390 more s390 updates for 6.18 merge window 2025-10-09 10:51:43 -07:00
sbus Get rid of 'remove_new' relic from platform driver struct 2024-12-01 15:12:43 -08:00
scsi scsi: core: Fix the unit attention counter implementation 2025-10-21 21:09:36 -04:00
sh sh: Switch to irq_domain_create_*() 2025-05-16 21:06:11 +02:00
siox siox: bus-gpio: Remove the use of dev_err_probe() 2025-09-06 15:59:59 +02:00
slimbus slimbus: messaging: fix "transfered"->"transferred" 2025-09-12 15:47:38 +02:00
soc net: ethernet: ti: netcp: Standardize knav_dma_open_channel to return NULL on error 2025-11-04 19:15:36 -08:00
soundwire soundwire updates for 6.18 2025-10-06 10:32:22 -07:00
spi spi: intel: Add support for Oak Stream SPI serial flash 2025-10-29 12:53:45 +00:00
spmi irqdomain: spmi: Switch to irq_domain_create_tree() 2025-05-21 14:53:17 +02:00
ssb treewide: rename GPIO set callbacks back to their original names 2025-08-07 10:07:06 +02:00
staging staging: gpib: Fix device reference leak in fmh_gpib driver 2025-10-13 10:55:03 +02:00
target SCSI misc on 20251011 2025-10-11 11:49:00 -07:00
tc TC: Fix the wrong format specifier 2024-11-12 15:48:08 +01:00
tee TEE QTEE fixes for v6.18 2025-10-17 15:26:52 +02:00
thermal thermal: renesas: Fix RZ/G3E fall-out 2025-10-02 10:41:58 +02:00
thunderbolt thunderbolt: Fix use-after-free in tb_dp_dprx_work 2025-09-23 17:16:38 +02:00
tty serial: 8250_mtk: Enable baud clock and manage in runtime PM 2025-10-22 12:13:54 +02:00
ufs scsi: ufs: core: Fix invalid probe error return value 2025-10-29 23:20:19 -04:00
uio hyperv-next for v6.18 2025-10-07 08:40:15 -07:00
usb USB serial device ids for 6.18-rc3 2025-10-24 13:52:58 +02:00
vdpa vduse: Use fixed 4KB bounce pages for non-4KB page size 2025-10-01 07:24:55 -04:00
vfio vfio/type1: handle DMA map/unmap up to the addressable limit 2025-10-28 15:54:41 -06:00
vhost vdpa: support virtio_map 2025-10-01 07:24:43 -04:00
video fbdev: atyfb: Check if pll_ops->init_pll failed 2025-10-28 22:59:19 +01:00
virt arm64 updates for 6.18 2025-09-29 18:48:39 -07:00
virtio virtio,vhost: fixes, cleanups 2025-10-04 08:48:16 -07:00
w1 w1: matrox: Remove some deadcode in matrox_w1_remove() 2025-08-31 14:14:07 +02:00
watchdog linux-watchdog 6.18-rc1 tag 2025-10-06 11:00:30 -07:00
xen dma-mapping updates for Linux 6.18: 2025-10-03 17:41:12 -07:00
zorro zorro: Remove extra whitespace in macro definitions 2025-09-15 14:30:17 +02:00
Kconfig drm for 6.17-rc1 2025-07-30 19:26:49 -07:00
Makefile hyperv-next for v6.18 2025-10-07 08:40:15 -07:00