On Mon, Apr 28, 2025 at 11:30:36AM +0200, Radim Krčmář wrote: > 2025-04-28T09:00:55+02:00, Andrew Jones <ajo...@ventanamicro.com>: > > On Sun, Apr 27, 2025 at 09:25:57PM +0800, Meng Zhuo wrote: > >> This patch adds host satp mode while kvm/host cpu satp mode is not > >> set. > > > > Huh, the KVM side[1] was written for this purpose, but it appears we never > > got a QEMU side merged. > > > > [1] commit 2776421e6839 ("RISC-V: KVM: provide UAPI for host SATP mode") > > KVM satp_mode is the current SATP.mode and I don't think the other > SATP.modes can generally be guessed from the host SATP mode. > > Can't QEMU use the host capabilities from cpuinfo or something? > > Do we need to return a bitmask from KVM? > (e.g. WARL all modes in vsatp and return what sticks.) >
The widest supported is sufficient because all narrower must also be supported. Linux should be figuring out the widest and capturing that at boot time and we should be returing that info for the KVM satp_mode get-one-reg call. If the satp_mode we're currently returning isn't the widest possible, then we should fix that in KVM. Thanks, drew