]> git.proxmox.com Git - mirror_qemu.git/commit
riscv: Introduce satp mode hw capabilities
authorAlexandre Ghiti <alexghiti@rivosinc.com>
Fri, 3 Mar 2023 13:12:51 +0000 (14:12 +0100)
committerPalmer Dabbelt <palmer@rivosinc.com>
Mon, 6 Mar 2023 16:09:43 +0000 (08:09 -0800)
commit6df3747a2745534c86db8e8f2ffdb1b8a66e5e84
treea1d4a6adcc23acefa79c7ce92b8c54c051b2f175
parent6f23aaeb9be13d4a26b7f863533c316105481640
riscv: Introduce satp mode hw capabilities

Currently, the max satp mode is set with the only constraint that it must be
implemented in QEMU, i.e. set in valid_vm_1_10_[32|64].

But we actually need to add another level of constraint: what the hw is
actually capable of, because currently, a linux booting on a sifive-u54
boots in sv57 mode which is incompatible with the cpu's sv39 max
capability.

So add a new bitmap to RISCVSATPMap which contains this capability and
initialize it in every XXX_cpu_init.

Finally:
- valid_vm_1_10_[32|64] constrains which satp mode the CPU can use
- the CPU hw capabilities constrains what the user may select
- the user's selection then constrains what's available to the guest
  OS.

Signed-off-by: Alexandre Ghiti <alexghiti@rivosinc.com>
Reviewed-by: Andrew Jones <ajones@ventanamicro.com>
Reviewed-by: Bin Meng <bmeng@tinylab.org>
Reviewed-by: Frank Chang <frank.chang@sifive.com>
Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
Message-ID: <20230303131252.892893-5-alexghiti@rivosinc.com>
Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>
target/riscv/cpu.c
target/riscv/cpu.h