[PATCH 1/2] KVM: riscv: selftests: Add riscv vm satp modes

Andrew Jones ajones at ventanamicro.com
Tue Oct 21 16:35:21 PDT 2025


On Mon, Oct 20, 2025 at 09:09:52PM +0800, Wu Fei wrote:
> On 10/17/25 23:38, Andrew Jones wrote:
> > On Fri, Oct 17, 2025 at 11:13:33AM +0800, wu.fei9 at sanechips.com.cn wrote:
> > > Current vm modes cannot represent riscv guest modes precisely, here add
> > > P41V39, P50V48 and P56V57.
> > > 
> > > Signed-off-by: Wu Fei <wu.fei9 at sanechips.com.cn>
> > > ---
> > >   .../testing/selftests/kvm/include/kvm_util.h  |  7 ++++++-
> > >   tools/testing/selftests/kvm/lib/guest_modes.c |  7 +++----
> > >   tools/testing/selftests/kvm/lib/kvm_util.c    | 15 +++++++++++++
> > >   .../selftests/kvm/lib/riscv/processor.c       | 21 +++++++++++++++----
> > >   4 files changed, 41 insertions(+), 9 deletions(-)
> > > 
> > > diff --git a/tools/testing/selftests/kvm/include/kvm_util.h b/tools/testing/selftests/kvm/include/kvm_util.h
> > > index bee65ca08721..02224bc514d4 100644
> > > --- a/tools/testing/selftests/kvm/include/kvm_util.h
> > > +++ b/tools/testing/selftests/kvm/include/kvm_util.h
> > > @@ -179,6 +179,11 @@ enum vm_guest_mode {
> > >          VM_MODE_P36V48_64K,
> > >          VM_MODE_P47V47_16K,
> > >          VM_MODE_P36V47_16K,
> > > +
> > > +       VM_MODE_P56V57_4K,      /* For riscv64 */
> > 
> > This should be P59
> 
> Although sv57x4 in hgatp does support P59, sv57 itself doesn't, so guest can
> only address 56bits gpa.

Oh, right.

Thanks,
drew



More information about the kvm-riscv mailing list