All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/2] RISC-V: KVM: Validate AIA MMIO ranges against GPA width
@ 2026-08-12  5:39 ` Pengpeng Hou
  0 siblings, 0 replies; 9+ messages in thread
From: Pengpeng Hou @ 2026-08-12  5:39 UTC (permalink / raw)
  To: Anup Patel, Atish Patra
  Cc: Pengpeng Hou, Paul Walmsley, Palmer Dabbelt, Albert Ou,
	Alexandre Ghiti, Fangyu Yu, Andrew Jones, Nutty Liu, Guo Ren, kvm,
	kvm-riscv, linux-riscv, linux-kernel

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(-)

-- 
2.50.1 (Apple Git-155)


^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2026-08-12  5:40 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-08-12  5:39 [PATCH 0/2] RISC-V: KVM: Validate AIA MMIO ranges against GPA width Pengpeng Hou
2026-08-12  5:39 ` Pengpeng Hou
2026-08-12  5:39 ` Pengpeng Hou
2026-08-12  5:39 ` [PATCH 1/2] RISC-V: KVM: Validate AIA MMIO address ranges Pengpeng Hou
2026-08-12  5:39   ` Pengpeng Hou
2026-08-12  5:39   ` Pengpeng Hou
2026-08-12  5:39 ` [PATCH 2/2] RISC-V: KVM: Disallow GPA-width changes after AIA init Pengpeng Hou
2026-08-12  5:39   ` Pengpeng Hou
2026-08-12  5:39   ` Pengpeng Hou

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.