diff options
| author | Pengpeng Hou <hppiscas@163.com> | 2026-09-20 21:09:55 +0800 |
|---|---|---|
| committer | Anup Patel <anup@brainfault.org> | 2026-11-16 18:06:13 +0530 |
| commit | ea4302d313014da5ea988f03ee7b88e29e161dcf (patch) | |
| tree | 662237a0e6465b24b87e7d7fe3015ea656d0243f /tools/perf/scripts | |
| parent | d33cad95d2e4996105e68f6ccb65bdce7ad1d636 (diff) | |
RISC-V: KVM: Disallow GPA-width changes after AIA init
KVM_ENABLE_CAP(KVM_CAP_VM_GPA_BITS) allows userspace to reduce the
stage-2 GPA width while a VM has no vCPUs or memory slots.
AIA initialization can complete with an APLIC and no vCPUs or memory
slots. The APLIC MMIO device has then been registered, but the existing
checks still allow userspace to shrink the GPA width below its address.
Reject GPA-width changes after AIA initialization. Both paths hold
kvm->lock, serializing the width change with AIA initialization.
The issue was found by our static-analysis tool.
Fixes: 7263b4fdb0b2 ("RISC-V: KVM: Reuse KVM_CAP_VM_GPA_BITS to select HGATP.MODE")
Reviewed-by: Anup Patel <anup@brainfault.org>
Assisted-by: gpt 5
Signed-off-by: Pengpeng Hou <hppiscas@163.com>
Reviewed-by: Nutty Liu <nutty.liu@hotmail.com>
Link: https://lore.kernel.org/r/fbe7337f6989994ad4dbc4dc03a67e8ebfa61f8d.1789872556.git.hppiscas@163.com
Signed-off-by: Anup Patel <anup@brainfault.org>
Diffstat (limited to 'tools/perf/scripts')
0 files changed, 0 insertions, 0 deletions
