linux/drivers
Marc Zyngier 34055de440 UPSTREAM: irqchip/gic-v4: Wait for GICR_VPENDBASER.Dirty to clear before descheduling
The way KVM drives GICv4.{0,1} is as follows:
- vcpu_load() makes the VPE resident, instructing the RD to start
  scanning for interrupts
- just before entering the guest, we check that the RD has finished
  scanning and that we can start running the vcpu
- on preemption, we deschedule the VPE by making it invalid on
  the RD

However, we are preemptible between the first two steps. If it so
happens *and* that the RD was still scanning, we nonetheless write
to the GICR_VPENDBASER register while Dirty is set, and bad things
happen (we're in UNPRED land).

This affects both the 4.0 and 4.1 implementations.

Make sure Dirty is cleared before performing the deschedule,
meaning that its_clear_vpend_valid() becomes a sort of full VPE
residency barrier.

Bug: 254441685
Reported-by: Jingyi Wang <wangjingyi11@huawei.com>
Tested-by: Nianyao Tang <tangnianyao@huawei.com>
Signed-off-by: Marc Zyngier <maz@kernel.org>
Fixes: 57e3cebd02 ("KVM: arm64: Delay the polling of the GICR_VPENDBASER.Dirty bit")
Link: https://lore.kernel.org/r/4aae10ba-b39a-5f84-754b-69c2eb0a2c03@huawei.com
(cherry picked from commit af27e41612)
Signed-off-by: Lee Jones <joneslee@google.com>
Change-Id: I5762305aa5fcc3bfc6fb2b77a459d6e122ad368f
2022-11-09 15:15:38 +00:00
..
accessibility tty: the rest, stop using tty_schedule_flip() 2022-07-29 17:19:28 +02:00
acpi This is the 5.10.136 stable release 2022-08-11 15:56:44 +02:00
amba amba: Make the remove callback return void 2022-04-08 14:40:02 +02:00
android FROMLIST: binder: fix UAF of alloc->vma in race with munmap() 2022-11-05 00:18:41 +00:00
ata ata: libata-core: fix NULL pointer deref in ata_host_alloc_pinfo() 2022-06-22 14:13:14 +02:00
atm atm: eni: Add check for dma_map_single 2022-03-23 09:13:27 +01:00
auxdisplay
base UPSTREAM: PM: domains: Fix sleep-in-atomic bug caused by genpd_debug_remove() 2022-11-09 13:57:12 +00:00
bcma
block This is the 5.10.129 stable release 2022-07-28 16:55:29 +02:00
bluetooth This is the 5.10.136 stable release 2022-08-11 15:56:44 +02:00
bus bus: ti-sysc: Fix warnings for unbind for serial 2022-06-14 18:32:34 +02:00
cdrom
char This is the 5.10.127 stable release 2022-07-28 16:08:09 +02:00
clk UPSTREAM: clk: Fix clk_hw_get_clk() when dev is NULL 2022-11-09 13:57:12 +00:00
clocksource This is the 5.10.129 stable release 2022-07-28 16:55:29 +02:00
connector
counter
cpufreq This is the 5.10.132 stable release 2022-07-28 17:17:55 +02:00
cpuidle
crypto This is the 5.10.121 stable release 2022-07-23 16:10:22 +02:00
dax dax: make sure inodes are flushed before destroy cache 2022-04-08 14:40:16 +02:00
dca
devfreq PM / devfreq: exynos-ppmu: Fix refcount leak in of_get_devfreq_events 2022-07-07 17:52:18 +02:00
dio
dma dmaengine: ti: Add missing put_device in ti_dra7_xbar_route_allocate 2022-07-12 16:32:23 +02:00
dma-buf UPSTREAM: dma-buf: cma_heap: Fix mutex locking section 2022-11-09 13:57:12 +00:00
edac EDAC/ghes: Set the DIMM label unconditionally 2022-08-03 12:00:50 +02: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: core: extend card->lock in fw_core_handle_bus_reset 2022-05-12 12:25:32 +02:00
firmware This is the 5.10.122 stable release 2022-07-28 15:05:26 +02:00
fpga
fsi fsi: Aspeed: Fix a potential double free 2022-04-08 14:40:23 +02:00
gnss
gpio This is the 5.10.134 stable release 2022-08-03 12:42:13 +02:00
gpu This is the 5.10.135 stable release 2022-08-04 10:59:03 +02:00
greybus greybus: svc: fix an error handling bug in gb_svc_hello() 2022-04-08 14:39:50 +02:00
hid BACKPORT: HID: steam: Prevent NULL pointer dereference in steam_{recv,send}_report 2022-10-11 22:09:21 +00:00
hsi
hv Drivers: hv: vmbus: Release cpu lock in error case 2022-06-22 14:13:16 +02:00
hwmon This is the 5.10.129 stable release 2022-07-28 16:55:29 +02:00
hwspinlock
hwtracing This is the 5.10.122 stable release 2022-07-28 15:05:26 +02:00
i2c This is the 5.10.134 stable release 2022-08-03 12:42:13 +02:00
i3c
ide
idle intel_idle: Disable IBRS during long idle 2022-07-25 11:26:43 +02:00
iio iio: adc: adi-axi-adc: Fix refcount leak in adi_axi_adc_attach_client 2022-06-29 08:59:52 +02:00
infiniband This is the 5.10.129 stable release 2022-07-28 16:55:29 +02:00
input Input: soc_button_array - also add Lenovo Yoga Tablet2 1051F to dmi_use_low_level_irq 2022-06-22 14:13:14 +02:00
interconnect This is the 5.10.122 stable release 2022-07-28 15:05:26 +02:00
iommu Merge branch 'android12-5.10' into branch 'android12-5.10-lts' 2022-08-16 14:34:54 +02:00
ipack
irqchip UPSTREAM: irqchip/gic-v4: Wait for GICR_VPENDBASER.Dirty to clear before descheduling 2022-11-09 15:15:38 +00:00
isdn isdn: hfcpci: check the return value of dma_set_mask() in setup_hw() 2022-03-16 14:15:57 +01:00
leds
lightnvm lightnvm: disable the subsystem 2022-05-09 09:04:56 +02:00
macintosh macintosh/adb: fix oob read in do_adb_query() function 2022-08-11 13:06:47 +02:00
mailbox Revert "mailbox: forward the hrtimer if not queued and under a lock" 2022-07-28 14:52:52 +02:00
mcb
md Merge tag 'android12-5.10.136_r00' into android12-5.10 2022-09-28 09:54:28 +02:00
media This is the 5.10.121 stable release 2022-07-23 16:10:22 +02:00
memory This is the 5.10.127 stable release 2022-07-28 16:08:09 +02:00
memstick
message
mfd mfd: davinci_voicecodec: Fix possible null-ptr-deref davinci_vc_probe() 2022-06-09 10:21:18 +02:00
misc This is the 5.10.130 stable release 2022-07-28 17:04:30 +02:00
mmc This is the 5.10.127 stable release 2022-07-28 16:08:09 +02:00
most
mtd This is the 5.10.131 stable release 2022-07-28 17:15:00 +02:00
mux
net UPSTREAM: wifi: mac80211_hwsim: avoid mac80211 warning on bad rate 2022-10-25 18:14:48 +00:00
nfc NFC: nxp-nci: don't print header length mismatch on i2c error 2022-07-21 21:20:14 +02:00
ntb ntb: intel: fix port config status offset for SPR 2022-03-08 19:09:32 +01:00
nubus
nvdimm nvdimm: Fix badblocks clear off-by-one error 2022-07-07 17:52:15 +02:00
nvme This is the 5.10.132 stable release 2022-07-28 17:17:55 +02:00
nvmem
of Merge tag 'android12-5.10.136_r00' into android12-5.10 2022-09-28 09:54:28 +02:00
opp This is the 5.10.121 stable release 2022-07-23 16:10:22 +02:00
oprofile
parisc parisc: Fix CPU affinity for Lasi, WAX and Dino chips 2022-04-13 21:01:03 +02:00
parport
pci Merge branch 'android12-5.10' into branch 'android12-5.10-lts' 2022-08-16 14:34:54 +02:00
pcmcia pcmcia: db1xxx_ss: restrict to MIPS_DB1XXX boards 2022-06-14 18:32:30 +02:00
perf arm_pmu: Validate single/group leader events 2022-04-27 13:53:55 +02:00
phy phy: qcom-qmp: fix pipe-clock imbalance on power-on failure 2022-06-14 18:32:32 +02:00
pinctrl This is the 5.10.134 stable release 2022-08-03 12:42:13 +02:00
platform This is the 5.10.132 stable release 2022-07-28 17:17:55 +02:00
pnp
power This is the 5.10.134 stable release 2022-08-03 12:42:13 +02:00
powercap
pps
ps3
ptp ptp: replace snprintf with sysfs_emit 2022-04-13 21:00:55 +02:00
pwm This is the 5.10.122 stable release 2022-07-28 15:05:26 +02:00
rapidio
ras
regulator This is the 5.10.121 stable release 2022-07-23 16:10:22 +02:00
remoteproc FROMLIST: remoteproc: Fix dma_mem leak after rproc_shutdown 2022-05-31 17:47:14 +00:00
reset This is the 5.10.113 stable release 2022-05-12 11:23:35 +02:00
rpmsg This is the 5.10.122 stable release 2022-07-28 15:05:26 +02:00
rtc rtc: mt6397: check return value after calling platform_get_resource() 2022-06-14 18:32:33 +02:00
s390 This is the 5.10.134 stable release 2022-08-03 12:42:13 +02:00
sbus
scsi UPSTREAM: scsi: ufs: ufs-mediatek: Fix error checking in ufs_mtk_init_va09_pwr_ctrl() 2022-11-09 13:57:12 +00:00
sfi
sh
siox
slimbus slimbus: qcom: Fix IRQ check in qcom_slim_probe 2022-05-18 10:23:47 +02:00
soc This is the 5.10.132 stable release 2022-07-28 17:17:55 +02:00
soundwire soundwire: intel: fix wrong register name in intel_shim_wake 2022-04-08 14:40:24 +02:00
spi This is the 5.10.134 stable release 2022-08-03 12:42:13 +02:00
spmi
ssb
staging This is the 5.10.134 stable release 2022-08-03 12:42:13 +02:00
target This is the 5.10.121 stable release 2022-07-23 16:10:22 +02:00
tc
tee optee: use driver internal tee_context for some rpc 2022-03-02 11:42:47 +01:00
thermal Merge tag 'android12-5.10.136_r00' into android12-5.10 2022-09-28 09:54:28 +02:00
thunderbolt
tty This is the 5.10.134 stable release 2022-08-03 12:42:13 +02:00
uio
usb UPSTREAM: usb: typec: tcpm: Do not disconnect when receiving VSAFE0V 2022-11-09 13:57:12 +00:00
vdpa vdpasim: allow to enable a vq repeatedly 2022-06-09 10:21:29 +02:00
vfio amba: Make the remove callback return void 2022-04-08 14:40:02 +02:00
vhost This is the 5.10.122 stable release 2022-07-28 15:05:26 +02:00
video This is the 5.10.130 stable release 2022-07-28 17:04:30 +02:00
virt
virtio ANDROID: fix up 5.10.132 merge with the virtio_mmio.c driver 2022-07-30 17:39:01 +02:00
visorbus
vlynq
vme
w1 w1: w1_therm: fixes w1_seq for ds28ea00 sensors 2022-04-13 21:01:01 +02:00
watchdog watchdog: wdat_wdt: Stop watchdog when rebooting the system 2022-06-14 18:32:43 +02:00
xen xen/gntdev: Ignore failure to unmap INVALID_GRANT_HANDLE 2022-07-29 17:19:07 +02:00
zorro
Kconfig
Makefile