6f23aaeb9b
RISC-V specifies multiple sizes for addressable memory and Linux probes for the machine's support at startup via the satp CSR register (done in csr.c:validate_vm). As per the specification, sv64 must support sv57, which in turn must support sv48...etc. So we can restrict machine support by simply setting the "highest" supported mode and the bare mode is always supported. You can set the satp mode using the new properties "sv32", "sv39", "sv48", "sv57" and "sv64" as follows: -cpu rv64,sv57=on # Linux will boot using sv57 scheme -cpu rv64,sv39=on # Linux will boot using sv39 scheme -cpu rv64,sv57=off # Linux will boot using sv48 scheme -cpu rv64 # Linux will boot using sv57 scheme by default We take the highest level set by the user: -cpu rv64,sv48=on,sv57=on # Linux will boot using sv57 scheme We make sure that invalid configurations are rejected: -cpu rv64,sv39=off,sv48=on # sv39 must be supported if higher modes are # enabled We accept "redundant" configurations: -cpu rv64,sv48=on,sv57=off # Linux will boot using sv48 scheme And contradictory configurations: -cpu rv64,sv48=on,sv48=off # Linux will boot using sv39 scheme Co-Developed-by: Ludovic Henry <ludovic@rivosinc.com> Signed-off-by: Ludovic Henry <ludovic@rivosinc.com> Signed-off-by: Alexandre Ghiti <alexghiti@rivosinc.com> Reviewed-by: Andrew Jones <ajones@ventanamicro.com> Reviewed-by: Bin Meng <bmeng@tinylab.org> Acked-by: Alistair Francis <alistair.francis@wdc.com> Reviewed-by: Frank Chang <frank.chang@sifive.com> Message-ID: <20230303131252.892893-4-alexghiti@rivosinc.com> Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com> |
||
---|---|---|
.. | ||
insn_trans | ||
arch_dump.c | ||
bitmanip_helper.c | ||
common-semi-target.h | ||
cpu_bits.h | ||
cpu_helper.c | ||
cpu_user.h | ||
cpu_vendorid.h | ||
cpu-param.h | ||
cpu.c | ||
cpu.h | ||
crypto_helper.c | ||
csr.c | ||
debug.c | ||
debug.h | ||
fpu_helper.c | ||
gdbstub.c | ||
helper.h | ||
insn16.decode | ||
insn32.decode | ||
instmap.h | ||
internals.h | ||
Kconfig | ||
kvm_riscv.h | ||
kvm-stub.c | ||
kvm.c | ||
m128_helper.c | ||
machine.c | ||
meson.build | ||
monitor.c | ||
op_helper.c | ||
pmp.c | ||
pmp.h | ||
pmu.c | ||
pmu.h | ||
sbi_ecall_interface.h | ||
time_helper.c | ||
time_helper.h | ||
trace-events | ||
trace.h | ||
translate.c | ||
vector_helper.c | ||
xthead.decode | ||
XVentanaCondOps.decode |