[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <DG21QMIKJS7W.1OUK0OFL8S3A8@oss.qualcomm.com>
Date: Fri, 30 Jan 2026 15:58:32 +0000
From: Radim Krčmář
<radim.krcmar@....qualcomm.com>
To: <fangyu.yu@...ux.alibaba.com>
Cc: <ajones@...tanamicro.com>, <alex@...ti.fr>,
<andrew.jones@....qualcomm.com>, <anup@...infault.org>,
<aou@...s.berkeley.edu>, <atish.patra@...ux.dev>, <corbet@....net>,
<guoren@...nel.org>, <kvm-riscv@...ts.infradead.org>,
<kvm@...r.kernel.org>, <linux-doc@...r.kernel.org>,
<linux-kernel@...r.kernel.org>, <linux-riscv@...ts.infradead.org>,
<palmer@...belt.com>, <pbonzini@...hat.com>, <pjw@...nel.org>
Subject: Re: [PATCH v3 1/2] RISC-V: KVM: Support runtime configuration for
per-VM's HGATP mode
2026-01-30T21:24:58+08:00, <fangyu.yu@...ux.alibaba.com>:
>>> From: Fangyu Yu <fangyu.yu@...ux.alibaba.com>
>>> - kvm_info("using %s G-stage page table format\n", str);
>>> + kvm_info("Max G-stage page table format %s\n", str);
>>
>>Fun fact: the ISA doesn't define the same hierarchy for hgatp modes as
>>it does for satp modes, so we could have just Sv57x4 and nothing below.
>>
>>We could do just with a code comment that we're assuming vendors will do
>>better, but I'd rather not introduce more assumptions...
>>I think the easiest would be to kvm_riscv_gstage_mode_detect() levels in
>>reverse and stop on the first one that is not supported.
>>(I'll reply with a patch later.)
>
> Please refer to the discussion here:
> https://github.com/riscv/riscv-isa-manual/issues/2208
> If Sv57x4 is implemented, then Sv48x4 and Sv39x4 must also be implemented.
I don't think so, sadly, but we're mostly dealing with technicalities
here. As Andrew pointed out:
"The H extension itself does not impose this requirement, so
technically Sv57x4 without Sv48x4 conforms to the H extension spec."
This means it's completely valid to support {Bare, Sv39x4, Sv57x4}.
The RVA23 profile imposes additional constraints via Shgatpa:
"For each supported virtual memory scheme SvNN supported in satp, the
corresponding hgatp SvNNx4 mode must be supported.
The hgatp mode Bare must also be supported."
The requirement only goes one way, so an RVA23 implementation with just
{Bare, Sv39} in satp could support {Bare, Sv39x4, Sv57x4} in hgatp,
because RVA23 nor ISA prevent Sv57x4 to be there.
Not that I expect any sensible implementation to do this...
Btw. do we target only RVA23 with KVM?
Thanks.
Powered by blists - more mailing lists