android_kernel_xiaomi_sm8450/drivers
Jacob Pan 7e00b52c8c iommu/vt-d: Fix PASID directory pointer coherency
[ Upstream commit 194b3348bdbb7db65375c72f3f774aee4cc6614e ]

On platforms that do not support IOMMU Extended capability bit 0
Page-walk Coherency, CPU caches are not snooped when IOMMU is accessing
any translation structures. IOMMU access goes only directly to
memory. Intel IOMMU code was missing a flush for the PASID table
directory that resulted in the unrecoverable fault as shown below.

This patch adds clflush calls whenever allocating and updating
a PASID table directory to ensure cache coherency.

On the reverse direction, there's no need to clflush the PASID directory
pointer when we deactivate a context entry in that IOMMU hardware will
not see the old PASID directory pointer after we clear the context entry.
PASID directory entries are also never freed once allocated.

 DMAR: DRHD: handling fault status reg 3
 DMAR: [DMA Read NO_PASID] Request device [00:0d.2] fault addr 0x1026a4000
       [fault reason 0x51] SM: Present bit in Directory Entry is clear
 DMAR: Dump dmar1 table entries for IOVA 0x1026a4000
 DMAR: scalable mode root entry: hi 0x0000000102448001, low 0x0000000101b3e001
 DMAR: context entry: hi 0x0000000000000000, low 0x0000000101b4d401
 DMAR: pasid dir entry: 0x0000000101b4e001
 DMAR: pasid table entry[0]: 0x0000000000000109
 DMAR: pasid table entry[1]: 0x0000000000000001
 DMAR: pasid table entry[2]: 0x0000000000000000
 DMAR: pasid table entry[3]: 0x0000000000000000
 DMAR: pasid table entry[4]: 0x0000000000000000
 DMAR: pasid table entry[5]: 0x0000000000000000
 DMAR: pasid table entry[6]: 0x0000000000000000
 DMAR: pasid table entry[7]: 0x0000000000000000
 DMAR: PTE not present at level 4

Cc: <stable@vger.kernel.org>
Fixes: 0bbeb01a4f ("iommu/vt-d: Manage scalalble mode PASID tables")
Reviewed-by: Kevin Tian <kevin.tian@intel.com>
Reported-by: Sukumar Ghorai <sukumar.ghorai@intel.com>
Signed-off-by: Ashok Raj <ashok.raj@intel.com>
Signed-off-by: Jacob Pan <jacob.jun.pan@linux.intel.com>
Link: https://lore.kernel.org/r/20230209212843.1788125-1-jacob.jun.pan@linux.intel.com
Signed-off-by: Lu Baolu <baolu.lu@linux.intel.com>
Signed-off-by: Joerg Roedel <jroedel@suse.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2023-03-17 08:45:08 +01:00
..
accessibility speakup: fix a segfault caused by switching consoles 2022-11-25 17:45:50 +01:00
acpi ACPI: video: Fix Lenovo Ideapad Z570 DMI match 2023-03-11 16:39:51 +01:00
amba
android file: Rename __close_fd_get_file close_fd_get_file 2023-01-04 11:39:18 +01:00
ata ata: libata: Fix sata_down_spd_limit() when no link speed is reported 2023-02-15 17:22:13 +01:00
atm atm: idt77252: fix use-after-free bugs caused by tst_timer 2022-08-25 11:38:02 +02:00
auxdisplay
base driver core: Fix test_async_probe_init saves device in wrong array 2023-02-01 08:23:15 +01:00
bcma
block loop: loop_set_status_from_info() check before assignment 2023-03-11 16:40:14 +01:00
bluetooth Bluetooth: btusb: Add VID:PID 13d3:3529 for Realtek RTL8821CE 2023-03-11 16:39:51 +01:00
bus bus: sunxi-rsb: Fix error handling in sunxi_rsb_init() 2023-02-15 17:22:10 +01:00
cdrom
char ipmi_ssif: Rename idle state and check 2023-03-11 16:39:54 +01:00
clk clk: Honor CLK_OPS_PARENT_ENABLE in clk_core_is_enabled() 2023-03-11 16:39:44 +01:00
clocksource clocksource/drivers/timer-ti-dm: Fix missing clk_disable_unprepare in dmtimer_systimer_init_clock() 2023-01-14 10:15:20 +01:00
connector
counter counter: stm32-lptimer-cnt: fix the check on arr and cmp registers update 2023-01-14 10:15:58 +01:00
cpufreq cpufreq: armada-37xx: stop using 0 as NULL pointer 2023-02-01 08:23:17 +01:00
cpuidle cpuidle: dt: Return the correct numbers of parsed idle states 2023-01-14 10:15:15 +01:00
crypto crypto: hisilicon: Wipe entire pool on error 2023-03-11 16:39:50 +01:00
dax dax/kmem: Fix leak of memory-hotplug resources 2023-03-11 16:40:04 +01:00
dca
devfreq PM/devfreq: governor: Add a private governor_data for governor 2023-01-14 10:16:31 +01:00
dio drivers: dio: fix possible memory leak in dio_init() 2023-01-14 10:15:54 +01:00
dma dmaengine: imx-sdma: Fix a possible memory leak in sdma_transfer_init 2023-02-06 07:56:15 +01:00
dma-buf dma-buf: fix racing conflict of dma_heap_add() 2022-12-02 17:40:01 +01:00
edac EDAC/qcom: Do not pass llcc_driv_data as edac_device_ctl_info's pvt_info 2023-02-01 08:23:23 +01:00
eisa
extcon extcon: Modify extcon device to be created after driver data is set 2022-06-14 18:32:43 +02:00
firewire firewire: fix memory leak for payload of request subaction to IEC 61883-1 FCP region 2023-02-15 17:22:09 +01:00
firmware firmware: coreboot: framebuffer: Ignore reserved pixel color bits 2023-03-11 16:39:54 +01:00
fpga fpga: stratix10-soc: Fix return value check in s10_ops_write_init() 2023-02-15 17:22:19 +01:00
fsi WRITE is "data source", not destination... 2023-02-15 17:22:11 +01:00
gnss
gpio gpio: vf610: connect GPIO label to dev name 2023-03-11 16:39:35 +01:00
gpu drm/connector: print max_requested_bpc in state debugfs 2023-03-17 08:45:06 +01:00
greybus
hid HID: logitech-hidpp: Don't restart communication if not necessary 2023-03-11 16:39:53 +01:00
hsi HSI: omap_ssi_core: Fix error handling in ssi_init() 2023-01-14 10:16:03 +01:00
hv video: hyperv_fb: Avoid taking busy spinlock on panic path 2023-01-14 10:16:13 +01:00
hwmon hwmon: (coretemp) Simplify platform device handling 2023-03-11 16:39:53 +01:00
hwspinlock hwspinlock: qcom: correct MMIO max register for newer SoCs 2022-11-16 09:57:07 +01:00
hwtracing coresight: cti: Fix hang in cti_disable_hw() 2022-11-10 18:14:25 +01:00
i2c i2c: rk3x: fix a bunch of kernel-doc warnings 2023-02-15 17:22:15 +01:00
i3c
ide
idle intel_idle: Disable IBRS during long idle 2022-07-25 11:26:43 +02:00
iio iio: accel: mma9551_core: Prevent uninitialized variable in mma9551_read_config_word() 2023-03-11 16:40:17 +01:00
infiniband IB/hfi1: Update RMT size calculation 2023-03-11 16:40:15 +01:00
input Input: iqs269a - do not poll during ATI 2023-03-11 16:39:45 +01:00
interconnect interconnect: qcom: icc-rpmh: Add BCMs to commit list in pre_aggregate 2022-09-28 11:10:28 +02:00
iommu iommu/vt-d: Fix PASID directory pointer coherency 2023-03-17 08:45:08 +01:00
ipack
irqchip irq: Fix typos in comments 2023-03-17 08:45:07 +01:00
isdn mISDN: hfcmulti: don't call dev_kfree_skb/kfree_skb() under spin_lock_irqsave() 2023-01-14 10:16:10 +01:00
leds leds: led-core: Fix refcount leak in of_led_get() 2023-03-11 16:39:40 +01:00
lightnvm
macintosh macintosh/macio-adb: check the return value of ioremap() 2023-01-14 10:16:06 +01:00
mailbox mailbox: zynq-ipi: fix error handling while device_register() fails 2023-01-14 10:16:12 +01:00
mcb mcb: mcb-parse: fix error handing in chameleon_parse_gdd() 2023-01-14 10:15:59 +01:00
md dm flakey: don't corrupt the zero page 2023-03-11 16:40:02 +01:00
media media: uvcvideo: Fix race condition with usb_kill_urb 2023-03-11 16:40:20 +01:00
memory memory: mvebu-devbus: Fix missing clk_disable_unprepare in mvebu_devbus_probe() 2023-02-01 08:23:08 +01:00
memstick memstick/ms_block: Fix a memory leak 2022-08-21 15:15:58 +02:00
message
mfd mfd: arizona: Use pm_runtime_resume_and_get() to prevent refcnt leak 2023-03-11 16:40:15 +01:00
misc mei: bus-fixup:upon error print return values of send and receive 2023-03-11 16:40:16 +01:00
mmc mmc: mmc_spi: fix error handling in mmc_spi_probe() 2023-02-22 12:55:55 +01:00
most
mtd ubi: ubi_wl_put_peb: Fix infinite loop when wear-leveling work failed 2023-03-11 16:40:11 +01:00
mux
net net/mlx5: Geneve, Fix handling of Geneve object id as error code 2023-03-11 16:40:13 +01:00
nfc nfc: fix memory leak of se_io context in nfc_genl_se_io 2023-03-11 16:40:13 +01:00
ntb NTB: ntb_tool: uninitialized heap data in tool_fn_write() 2022-08-25 11:38:01 +02:00
nubus
nvdimm nvdimm: Fix badblocks clear off-by-one error 2022-07-07 17:52:15 +02:00
nvme nvme-fc: fix a missing queue put in nvmet_fc_ls_create_association 2023-02-22 12:55:53 +01:00
nvmem nvmem: core: fix return value 2023-02-22 12:56:00 +01:00
of of/address: Return an error when no valid dma-ranges are found 2023-02-15 17:22:22 +01:00
opp OPP: fix error checking in opp_migrate_dentry() 2023-03-11 16:39:26 +01:00
oprofile
parisc parisc: led: Fix potential null-ptr-deref in start_task() 2023-01-14 10:16:36 +01:00
parport parport_pc: Avoid FIFO port location truncation 2022-11-25 17:45:44 +01:00
pci PCI: Add ACS quirk for Wangxun NICs 2023-03-11 16:40:18 +01:00
pcmcia
perf perf/smmuv3: Fix hotplug callback leak in arm_smmu_pmu_init() 2023-01-14 10:15:12 +01:00
phy phy: rockchip-typec: Fix unsigned comparison with less than zero 2023-03-11 16:40:18 +01:00
pinctrl pinctrl: rockchip: fix reading pull type on rk3568 2023-03-11 16:40:08 +01:00
platform platform/x86: touchscreen_dmi: Add Chuwi Vi8 (CWI501) DMI match 2023-02-22 12:55:54 +01:00
pnp PNP: fix name memory leak in pnp_alloc_dev() 2023-01-14 10:15:17 +01:00
power power: supply: fix null pointer dereferencing in power_supply_get_battery_info 2023-01-14 10:16:03 +01:00
powercap powercap: fix possible name leak in powercap_register_zone() 2023-03-11 16:39:23 +01:00
pps
ps3
ptp
pwm pwm: stm32-lp: fix the check on arr and cmp registers update 2023-03-11 16:40:08 +01:00
rapidio rapidio: devices: fix missing put_device in mport_cdev_open 2023-01-14 10:15:23 +01:00
ras
regulator regulator: s5m8767: Bounds check id indexing into arrays 2023-03-11 16:39:53 +01:00
remoteproc remoteproc/mtk_scp: Move clk ops outside send_lock 2023-03-11 16:40:04 +01:00
reset reset: imx7: Fix the iMX8MP PCIe PHY PERST support 2022-10-05 10:38:40 +02:00
rpmsg rpmsg: glink: Avoid infinite loop on intent for missing channel 2023-03-11 16:39:47 +01:00
rtc rtc: sun6i: Always export the internal oscillator 2023-03-11 16:40:14 +01:00
s390 s390/dasd: Fix potential memleak in dasd_eckd_init() 2023-03-11 16:39:15 +01:00
sbus
scsi scsi: mpt3sas: Remove usage of dma_get_required_mask() API 2023-03-11 16:40:20 +01:00
sfi
sh
siox siox: fix possible memory leak in siox_device_add() 2022-11-25 17:45:44 +01:00
slimbus slimbus: stream: correct presence rate frequencies 2022-11-25 17:45:50 +01:00
soc PM: AVS: qcom-cpr: Fix an error handling path in cpr_probe() 2023-02-01 08:23:11 +01:00
soundwire soundwire: cadence: Drain the RX FIFO after an IO timeout 2023-03-11 16:40:18 +01:00
spi spi: synquacer: Fix timeout handling in synquacer_spi_transfer_one() 2023-03-11 16:39:38 +01:00
spmi spmi: pmic-arb: correct duplicate APID to PPID mapping logic 2022-10-26 13:25:39 +02:00
ssb
staging staging: rtl8192e: Remove call_usermodehelper starting RadioPower.sh 2023-03-13 10:19:36 +01:00
target scsi: target: core: Fix warning on RT kernels 2023-02-15 17:22:14 +01:00
tc
tee tee: optee: fix possible memory leak in optee_register_device() 2022-12-02 17:39:59 +01:00
thermal thermal: intel: BXT_PMIC: select REGMAP instead of depending on it 2023-03-11 16:40:15 +01:00
thunderbolt thunderbolt: Use correct function to calculate maximum USB3 link rate 2023-01-24 07:19:59 +01:00
tty serial: sc16is7xx: setup GPIO controller later in probe 2023-03-11 16:40:16 +01:00
uio uio: uio_dmem_genirq: Fix deadlock between irq config and handling 2023-01-14 10:15:55 +01:00
usb usb: gadget: uvc: fix missing mutex_unlock() if kstrtou8() fails 2023-03-11 16:40:21 +01:00
vdpa vdpa/mlx5: Don't clear mr struct on destroy MR 2023-03-11 16:39:45 +01:00
vfio vfio/type1: prevent underflow of locked_vm via exec() 2023-03-11 16:40:07 +01:00
vhost vhost/net: Clear the pending messages when the backend is removed 2023-02-15 17:22:11 +01:00
video fbdev: smscufx: fix error handling code in ufx_usb_probe 2023-02-15 17:22:20 +01:00
virt vboxguest: Do not use devm for irq 2022-08-25 11:38:14 +02:00
virtio virtio_mmio: Restore guest page size on resume 2022-07-21 21:20:13 +02:00
visorbus
vlynq
vme vme: Fix error not catched in fake_init() 2023-01-14 10:16:00 +01:00
w1 w1: fix WARNING after calling w1_process() 2023-02-01 08:23:15 +01:00
watchdog watchdog: pcwd_usb: Fix attempting to access uninitialized memory 2023-03-11 16:40:12 +01:00
xen fix "direction" argument of iov_iter_kvec() 2023-02-15 17:22:12 +01:00
zorro
Kconfig
Makefile