diff options
| author | Xie Bo <xb@ultrarisc.com> | 2026-08-10 09:21:15 +0800 |
|---|---|---|
| committer | Anup Patel <anup@brainfault.org> | 2026-09-15 18:55:51 +0530 |
| commit | 8ae12ccaec6ec74945d8c1ef39f2c1b8df779abc (patch) | |
| tree | e933e4eef9cdc1f87cae74eeb570f4a14ffad890 /tools/perf/scripts/python/stackcollapse.py | |
| parent | 52c6b7d20d3e791a9e75aa2be2a467990154c7cd (diff) | |
| download | linux-next-8ae12ccaec6ec74945d8c1ef39f2c1b8df779abc.tar.gz linux-next-8ae12ccaec6ec74945d8c1ef39f2c1b8df779abc.zip | |
RISC-V: KVM: Serialize IMSIC attributes with vCPU migration
KVM device ioctls are not serialized against KVM_RUN. As a result,
kvm_riscv_aia_imsic_rw_attr() can snapshot the physical CPU and HGEI of
an IMSIC VS-file before a concurrent vCPU migration releases it.
The HGEI can then be allocated to another vCPU before imsic_vsfile_rw()
uses the stale tuple. A GET or SET attribute may consequently access the
new owner's interrupt file.
Serialize the entire IMSIC attribute operation with the target vCPU
mutex. This prevents the VS-file from being migrated and recycled until
the attribute access completes. Acquire the mutex killably so that the
device ioctl remains interruptible while waiting for KVM_RUN to finish.
Fixes: db8b7e97d613 ("RISC-V: KVM: Add in-kernel virtualization of AIA IMSIC")
Cc: stable@vger.kernel.org
Signed-off-by: Xie Bo <xb@ultrarisc.com>
Reviewed-by: Anup Patel <anup@brainfault.org>
Link: https://lore.kernel.org/r/20260810-imsic-attr-race-v2-1-00ed95ad321e@ultrarisc.com
Signed-off-by: Anup Patel <anup@brainfault.org>
Diffstat (limited to 'tools/perf/scripts/python/stackcollapse.py')
0 files changed, 0 insertions, 0 deletions
