WSL2-Linux-Kernel/drivers
Zhang Rui 59df44bfb0 iommu/vt-d: Avoid memory allocation in iommu_suspend()
The iommu_suspend() syscore suspend callback is invoked with IRQ disabled.
Allocating memory with the GFP_KERNEL flag may re-enable IRQs during
the suspend callback, which can cause intermittent suspend/hibernation
problems with the following kernel traces:

Calling iommu_suspend+0x0/0x1d0
------------[ cut here ]------------
WARNING: CPU: 0 PID: 15 at kernel/time/timekeeping.c:868 ktime_get+0x9b/0xb0
...
CPU: 0 PID: 15 Comm: rcu_preempt Tainted: G     U      E      6.3-intel #r1
RIP: 0010:ktime_get+0x9b/0xb0
...
Call Trace:
 <IRQ>
 tick_sched_timer+0x22/0x90
 ? __pfx_tick_sched_timer+0x10/0x10
 __hrtimer_run_queues+0x111/0x2b0
 hrtimer_interrupt+0xfa/0x230
 __sysvec_apic_timer_interrupt+0x63/0x140
 sysvec_apic_timer_interrupt+0x7b/0xa0
 </IRQ>
 <TASK>
 asm_sysvec_apic_timer_interrupt+0x1f/0x30
...
------------[ cut here ]------------
Interrupts enabled after iommu_suspend+0x0/0x1d0
WARNING: CPU: 0 PID: 27420 at drivers/base/syscore.c:68 syscore_suspend+0x147/0x270
CPU: 0 PID: 27420 Comm: rtcwake Tainted: G     U  W   E      6.3-intel #r1
RIP: 0010:syscore_suspend+0x147/0x270
...
Call Trace:
 <TASK>
 hibernation_snapshot+0x25b/0x670
 hibernate+0xcd/0x390
 state_store+0xcf/0xe0
 kobj_attr_store+0x13/0x30
 sysfs_kf_write+0x3f/0x50
 kernfs_fop_write_iter+0x128/0x200
 vfs_write+0x1fd/0x3c0
 ksys_write+0x6f/0xf0
 __x64_sys_write+0x1d/0x30
 do_syscall_64+0x3b/0x90
 entry_SYSCALL_64_after_hwframe+0x72/0xdc

Given that only 4 words memory is needed, avoid the memory allocation in
iommu_suspend().

CC: stable@kernel.org
Fixes: 33e0715710 ("iommu/vt-d: Avoid GFP_ATOMIC where it is not needed")
Signed-off-by: Zhang Rui <rui.zhang@intel.com>
Tested-by: Ooi, Chin Hao <chin.hao.ooi@intel.com>
Link: https://lore.kernel.org/r/20230921093956.234692-1-rui.zhang@intel.com
Signed-off-by: Lu Baolu <baolu.lu@linux.intel.com>
Link: https://lore.kernel.org/r/20230925120417.55977-2-baolu.lu@linux.intel.com
Signed-off-by: Joerg Roedel <jroedel@suse.de>
2023-09-25 16:10:36 +02:00
..
accel accel/ivpu/40xx: Fix buttress interrupt handling 2023-09-20 13:00:40 +02:00
accessibility
acpi ACPI: processor: Fix uninitialized access of buf in acpi_set_pdc_bits() 2023-09-18 12:16:16 +02:00
amba
android
ata ata: libata-core: fetch sense data for successful commands iff CDL enabled 2023-09-16 21:12:19 +09:00
atm
auxdisplay
base driver core: return an error when dev_set_name() hasn't happened 2023-09-12 15:54:44 +02:00
bcma
block
bluetooth
bus
cache
cdrom
cdx
char Hi, 2023-09-13 11:44:20 -07:00
clk
clocksource
comedi Revert "comedi: add HAS_IOPORT dependencies" 2023-09-12 15:49:20 +02:00
connector
counter
cpufreq
cpuidle
crypto
cxl cxl/acpi: Annotate struct cxl_cxims_data with __counted_by 2023-09-22 14:31:04 -07:00
dax
dca
devfreq
dio
dma
dma-buf
edac
eisa
extcon
firewire Revert "firewire: core: obsolete usage of GFP_ATOMIC at building node tree" 2023-09-15 18:37:52 +09:00
firmware EFI fixes for v6.6 take 2: 2023-09-22 09:25:26 -07:00
fpga
fsi
gnss
gpio gpio: sim: fix an invalid __free() usage 2023-09-22 10:51:56 +02:00
gpu amd-drm-fixes-6.6-2023-09-20: 2023-09-22 15:43:44 +10:00
greybus
hid
hsi
hte
hv
hwmon hwmon: (nct6775) Fix non-existent ALARM warning 2023-09-18 11:52:18 -07:00
hwspinlock
hwtracing
i2c i2c: xiic: Correct return value check for xiic_reinit() 2023-09-22 12:04:39 +02:00
i3c
idle
iio
infiniband
input
interconnect
iommu iommu/vt-d: Avoid memory allocation in iommu_suspend() 2023-09-25 16:10:36 +02:00
ipack
irqchip
isdn
leds
macintosh
mailbox
mcb
md - Fix DM core retrieve_deps() UAF race due to missing locking of a DM 2023-09-15 14:30:54 -07:00
media media: imx-mipi-csis: Remove an incorrect fwnode_handle_put() call 2023-09-19 09:03:21 +02:00
memory
memstick
message
mfd mfd: cs42l43: Use correct macro for new-style PM runtime ops 2023-09-23 11:10:23 -07:00
misc
mmc
most
mtd
mux
net sfc: handle error pointers returned by rhashtable_lookup_get_insert_fast() 2023-09-21 10:37:16 +02:00
nfc
ntb
nubus
nvdimm
nvme nvme fixes for Linux 6.6 2023-09-14 16:20:31 -06:00
nvmem
of
opp
parisc
parport
pci PCI/AER: Export pcie_aer_is_native() 2023-09-11 15:24:16 -07:00
pcmcia
peci
perf
phy
pinctrl
platform platform/x86: thinkpad_acpi: Take mutex in hotkey_resume 2023-09-18 15:16:19 +02:00
pmdomain pmdomain: Rename the genpd subsystem to pmdomain 2023-09-13 11:09:21 +02:00
pnp
power
powercap
pps
ps3
ptp
pwm
rapidio
ras
regulator regulator: Fix voltage range selection 2023-09-11 13:51:36 +01:00
remoteproc
reset
rpmsg
rtc
s390
sbus
scsi Networking fixes for 6.6-rc2, including fixes from netfilter and bpf 2023-09-21 11:28:16 -07:00
sh
siox
slimbus
soc
soundwire
spi spi: Merge up old fix 2023-09-19 13:17:52 +01:00
spmi
ssb
staging
target scsi: target: core: Fix target_cmd_counter leak 2023-09-13 20:09:56 -04:00
tc
tee
thermal thermal: sysfs: Fix trip_point_hyst_store() 2023-09-18 13:13:05 +02:00
thunderbolt
tty
ufs
uio
usb usb: typec: ucsi: Fix NULL pointer dereference 2023-09-11 13:52:16 +02:00
vdpa
vfio
vhost
video fbdev/sh7760fb: Depend on FB=y 2023-09-21 10:33:49 +02:00
virt
virtio
vlynq
w1 w1: ds2482: Switch back to use struct i2c_driver's .probe() 2023-09-13 10:48:42 +02:00
watchdog
xen xen: simplify evtchn_do_upcall() call maze 2023-09-19 07:04:49 +02:00
zorro
Kconfig
Makefile pmdomain: Rename the genpd subsystem to pmdomain 2023-09-13 11:09:21 +02:00