[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v9 3/5] riscv: Allow user to set the satp mode
From: |
Bin Meng |
Subject: |
Re: [PATCH v9 3/5] riscv: Allow user to set the satp mode |
Date: |
Wed, 1 Feb 2023 12:17:09 +0800 |
On Tue, Jan 31, 2023 at 11:13 PM Alexandre Ghiti <alexghiti@rivosinc.com> wrote:
>
> 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>
> ---
> target/riscv/cpu.c | 207 +++++++++++++++++++++++++++++++++++++++++++++
> target/riscv/cpu.h | 19 +++++
> target/riscv/csr.c | 12 ++-
> 3 files changed, 231 insertions(+), 7 deletions(-)
>
Reviewed-by: Bin Meng <bmeng@tinylab.org>
- [PATCH v9 0/5] riscv: Allow user to set the satp mode, Alexandre Ghiti, 2023/01/31
- [PATCH v9 1/5] riscv: Pass Object to register_cpu_props instead of DeviceState, Alexandre Ghiti, 2023/01/31
- [PATCH v9 2/5] riscv: Change type of valid_vm_1_10_[32|64] to bool, Alexandre Ghiti, 2023/01/31
- [PATCH v9 3/5] riscv: Allow user to set the satp mode, Alexandre Ghiti, 2023/01/31
- Re: [PATCH v9 3/5] riscv: Allow user to set the satp mode,
Bin Meng <=
- [PATCH v9 4/5] riscv: Introduce satp mode hw capabilities, Alexandre Ghiti, 2023/01/31
- [PATCH v9 5/5] riscv: Correctly set the device-tree entry 'mmu-type', Alexandre Ghiti, 2023/01/31