Skip to content

RISC-V: KVM: Validate AIA MMIO ranges against GPA width

Pengpeng Hou kvm kvm-riscv linux-riscv lkml 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest2 patches 2 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2RISC-V: KVM: Validate AIA MMIO address rangesarch/riscv/kvm/aia_device.c+66 -131 reply
2/2RISC-V: KVM: Disallow GPA-width changes after AIA initarch/riscv/kvm/vm.c+2 -11 reply

Reviews trailers per patch

1 of 2 patches has a Reviewed-by or Acked-by.

PatchAnup Patel
1/2
2/2R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [PATCH 0/2] RISC-V: KVM: Validate AIA MMIO ranges against GPA width

The AIA device API currently checks only the alignment of userspace- supplied APLIC and IMSIC base addresses. This can publish a wrapping fixed-size MMIO interval or one that lies beyond the selected stage-2 guest physical address (GPA) width.

There are two points to close because the GPA width is configurable:

1. Validate every complete range when it is stored and again immediately before AIA initialization publishes the first MMIO device.
2. Once AIA initialization has published those devices, prevent the GPA width from being reduced below their addresses.

Both initialization and GPA-width changes are serialized by kvm->lock. The series was reviewed against the RISC-V KVM queue at dfdf1374fdeccb5b7e3d35186228e01ec5ea5f01. No build or runtime testing was performed.

Pengpeng Hou (2):
RISC-V: KVM: Validate AIA MMIO address ranges
RISC-V: KVM: Disallow GPA-width changes after AIA init

 arch/riscv/kvm/aia_device.c | 79 +++++++++++++++++++++++++++++++------
 arch/riscv/kvm/vm.c         |  3 +-
 2 files changed, 68 insertions(+), 14 deletions(-)
Signature · 1 line
2.50.1 (Apple Git-155)