summaryrefslogtreecommitdiff
path: root/tools/perf/scripts/python
diff options
context:
space:
mode:
authorPengpeng Hou <hppiscas@163.com>2026-09-20 21:09:18 +0800
committerAnup Patel <anup@brainfault.org>2026-11-16 18:06:07 +0530
commitd33cad95d2e4996105e68f6ccb65bdce7ad1d636 (patch)
tree2bf60eb8c2ea6523e42d46ef3aeb17f0bd089c00 /tools/perf/scripts/python
parentaebb7274476403040d582c61478df8f4a7bf9cd3 (diff)
RISC-V: KVM: Validate AIA MMIO address ranges
The AIA address setters check alignment but not the complete fixed-size APLIC and IMSIC MMIO regions. A range can therefore wrap when its end is formed or extend beyond the selected guest physical address space before it is registered on the KVM MMIO bus. Check the complete range in both setters. Return -EINVAL for alignment or arithmetic overflow and -E2BIG for a range beyond the selected GPA limit, following the arm64 VGIC address-validation convention. Recheck only the APLIC range during initialization: userspace can set its address and then change KVM_CAP_VM_GPA_BITS while the VM still has no vCPUs or memory slots. An IMSIC address, in contrast, can only be set for an existing vCPU, which already prevents subsequent GPA-width changes. No additional pass over the vCPUs is needed. Keep the existing required-address checks and IMSIC cleanup path. The issue was found by our static-analysis tool. Fixes: 89d01306e34d ("RISC-V: KVM: Implement device interface for AIA irqchip") Assisted-by: gpt 5 Signed-off-by: Pengpeng Hou <hppiscas@163.com> Reviewed-by: Anup Patel <anup@brainfault.org> Link: https://lore.kernel.org/r/3046cfd67c5f962014cd38e49a0e8bf28b6fb53f.1789872556.git.hppiscas@163.com Signed-off-by: Anup Patel <anup@brainfault.org>
Diffstat (limited to 'tools/perf/scripts/python')
0 files changed, 0 insertions, 0 deletions