[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v6 3/5] riscv: Allow user to set the satp mode
From: |
Andrew Jones |
Subject: |
Re: [PATCH v6 3/5] riscv: Allow user to set the satp mode |
Date: |
Mon, 23 Jan 2023 11:14:29 +0100 |
On Mon, Jan 23, 2023 at 10:03:22AM +0100, Alexandre Ghiti 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,sv32=on # Can't enable 32-bit satp mode in 64-bit
> -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
>
> In addition, we now correctly set the device-tree entry 'mmu-type' using
> those new properties.
This sentence no longer applies to this patch.
Thanks,
drew
- [PATCH v6 0/5] riscv: Allow user to set the satp mode, Alexandre Ghiti, 2023/01/23
- [PATCH v6 1/5] riscv: Pass Object to register_cpu_props instead of DeviceState, Alexandre Ghiti, 2023/01/23
- [PATCH v6 2/5] riscv: Change type of valid_vm_1_10_[32|64] to bool, Alexandre Ghiti, 2023/01/23
- [PATCH v6 3/5] riscv: Allow user to set the satp mode, Alexandre Ghiti, 2023/01/23
- [PATCH v6 4/5] riscv: Correctly set the device-tree entry 'mmu-type', Alexandre Ghiti, 2023/01/23
- [PATCH v6 5/5] riscv: Introduce satp mode hw capabilities, Alexandre Ghiti, 2023/01/23