linux/drivers
Vasant Hegde c362f32a59 iommu/amd: Invalidate cache before removing device from domain list
Commit 87a6f1f22c ("iommu/amd: Introduce per-device domain ID to fix
potential TLB aliasing issue") introduced per device domain ID when
domain is configured with v2 page table. And in invalidation path, it
uses per device structure (dev_data->gcr3_info.domid) to get the domain ID.

In detach_device() path, current code tries to invalidate IOMMU cache
after removing dev_data from domain device list. This means when domain
is configured with v2 page table, amd_iommu_domain_flush_all() will not be
able to invalidate cache as device is already removed from domain device
list.

This is causing change domain tests (changing domain type from identity to DMA)
to fail with IO_PAGE_FAULT issue.

Hence invalidate cache and update DTE before updating data structures.

Reported-by: FahHean Lee <fahhean.lee@amd.com>
Reported-by: Dheeraj Kumar Srivastava <dheerajkumar.srivastava@amd.com>
Fixes: 87a6f1f22c ("iommu/amd: Introduce per-device domain ID to fix potential TLB aliasing issue")
Tested-by: Dheeraj Kumar Srivastava <dheerajkumar.srivastava@amd.com>
Tested-by: Sairaj Arun Kodilkar <sairaj.arunkodilkar@amd.com>
Tested-by: FahHean Lee <fahhean.lee@amd.com>
Signed-off-by: Vasant Hegde <vasant.hegde@amd.com>
Reviewed-by: Jerry Snitselaar <jsnitsel@redhat.com>
Link: https://lore.kernel.org/r/20240620060552.13984-1-vasant.hegde@amd.com
Signed-off-by: Joerg Roedel <jroedel@suse.de>
2024-06-27 12:13:48 +02:00
..
accel
accessibility
acpi Merge branch 'acpi-scan' 2024-06-21 12:55:12 +02:00
amba
android
ata ata: ahci: Do not enable LPM if no LPM states are supported by the HBA 2024-06-19 13:19:38 +02:00
atm
auxdisplay
base drivers: core: synchronize really_probe() and dev_uevent() 2024-06-04 18:14:51 +02:00
bcma
block loop: Disable fallocate() zero and discard if not supported 2024-06-14 06:21:25 -06:00
bluetooth
bus
cache
cdrom
cdx
char tpm: Switch to new Intel CPU model defines 2024-06-05 04:55:04 +03:00
clk ARM/clkdev fixes for v6.10 2024-06-12 16:58:05 -07:00
clocksource
comedi
connector
counter
cpufreq cpufreq: intel_pstate: Check turbo_is_disabled() in store_no_turbo() 2024-06-12 14:11:50 +02:00
cpuidle
crypto
cxl
dax
dca
devfreq
dio
dma dmaengine: ioatdma: Fix missing kmem_cache_destroy() 2024-06-11 23:39:26 +05:30
dma-buf
dpll
edac EDAC/igen6: Convert PCIBIOS_* return codes to errnos 2024-06-04 11:29:52 +02:00
eisa
extcon
firewire firewire: core: record card index in bus_reset_handle tracepoints event 2024-06-15 14:59:26 +09:00
firmware SoC fixes for 6.10 2024-06-22 07:58:21 -07:00
fpga
fsi
gnss
gpio gpio: add missing MODULE_DESCRIPTION() macros 2024-06-07 10:05:21 +02:00
gpu - An ARM-relevant fix to not free default RMIDs of a resource control group 2024-06-23 07:16:13 -07:00
greybus
hid for-linus-2024060801 2024-06-08 10:48:11 -07:00
hsi
hte
hv Drivers: hv: Cosmetic changes for hv.c and balloon.c 2024-06-06 06:03:29 +00:00
hwmon hwmon: (shtc1) Fix property misspelling 2024-05-30 09:05:19 -07:00
hwspinlock
hwtracing
i2c i2c: ocores: set IACK bit after core is enabled 2024-06-21 01:17:43 +02:00
i3c
idle
iio iio: inkern: fix channel read regression 2024-06-03 20:29:31 +01:00
infiniband RDMA/mana_ib: Ignore optional access flags for MRs 2024-06-21 10:19:36 -03:00
input Input: silead - Always support 10 fingers 2024-06-03 11:10:08 +02:00
interconnect
iommu iommu/amd: Invalidate cache before removing device from domain list 2024-06-27 12:13:48 +02:00
ipack
irqchip irqchip/gic-v3-its: Fix potential race condition in its_vlpi_prop_update() 2024-06-03 18:20:00 +02:00
isdn
leds leds: class: Revert: "If no default trigger is given, make hw_control trigger the default trigger" 2024-06-16 09:33:28 -07:00
macintosh
mailbox mailbox: zynqmp-ipi: drop irq_to_desc() call 2024-05-31 12:39:15 -05:00
mcb
md
media mailmap: Add my outdated addresses to the map file 2024-06-12 09:28:04 -07:00
memory
memstick
message
mfd mfd: axp20x: AXP717: Fix missing IRQ status registers range 2024-06-14 08:43:39 +01:00
misc misc: microchip: pci1xxxx: Fix a memory leak in the error handling of gp_aux_bus_probe() 2024-06-04 18:08:39 +02:00
mmc
most
mtd
mux
net net: usb: rtl8150 fix unintiatilzed variables in rtl8150_get_link_ksettings 2024-06-20 07:15:17 -07:00
nfc
ntb
nubus
nvdimm
nvme nvme fixes for Linux 6.10 2024-06-13 14:19:57 -06:00
nvmem
of of: property: Fix fw_devlink handling of interrupt-map 2024-05-30 19:43:47 -05:00
opp
parisc
parport parport: amiga: Mark driver struct with __refdata to prevent section mismatch 2024-06-04 18:08:31 +02:00
pci PCI: Revert the cfg_access_lock lockdep mechanism 2024-06-04 12:10:05 -05:00
pcmcia
peci
perf
phy phy: qcom: qmp-combo: Switch from V6 to V6 N4 register offsets 2024-06-03 19:30:47 +05:30
pinctrl
platform platform/x86/amd/hsmp: Check HSMP support on AMD family of processors 2024-06-03 11:57:28 +02:00
pmdomain
pnp
power
powercap
pps
ps3
ptp ptp: fix integer overflow in max_vclocks_store 2024-06-18 13:26:44 -07:00
pwm pwm: stm32: Fix error message to not describe the previous error path 2024-06-22 16:13:19 +02:00
rapidio
ras RAS/AMD/ATL: Use system settings for MI300 DRAM to normalized address translation 2024-06-16 11:22:57 +02:00
regulator regulator: axp20x: AXP717: fix LDO supply rails and off-by-ones 2024-06-12 21:30:43 +01:00
remoteproc
reset
rpmsg
rtc
s390
sbus
scsi SCSI fixes on 20240621 2024-06-21 14:28:28 -07:00
sh
siox
slimbus
soc mm/util: Swap kmemdup_array() arguments 2024-06-06 08:55:20 -07:00
soundwire soundwire: fix usages of device_get_named_child_node() 2024-06-03 17:35:24 +05:30
spi spi: spi-imx: imx51: revert burst length calculation back to bits_per_word 2024-06-19 14:07:13 +01:00
spmi
ssb
staging staging: vchiq_debugfs: Fix NPD in vchiq_dump_state 2024-06-04 13:36:44 +02:00
target
tc
tee
thermal Thermal control fixes for 6.10-rc5 2024-06-21 11:16:56 -07:00
thunderbolt thunderbolt: debugfs: Fix margin debugfs node creation condition 2024-05-31 13:13:39 +03:00
tty serial: drop debugging WARN_ON_ONCE() from uart_write() 2024-06-04 14:10:43 +02:00
ufs scsi: ufs: core: Free memory allocated for model before reinit 2024-06-13 21:00:25 -04:00
uio
usb SCSI fixes on 20240621 2024-06-21 14:28:28 -07:00
vdpa
vfio vfio/pci: Insert full vma on mmap'd MMIO fault 2024-06-12 15:40:39 -06:00
vhost
video
virt
virtio
w1
watchdog
xen
zorro
Kconfig
Makefile