mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-03 15:53:54 -06:00
target/riscv: update max_satp_mode based on QOM properties
Almost all users of cpu->cfg.satp_mode care about the "max" value satp_mode_max_from_map(cpu->cfg.satp_mode.map). Convert the QOM properties back into it. For TCG, deduce the bitmap of supported modes from valid_vm[]. Reviewed-by: Alistair Francis <alistair.francis@wdc.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
This commit is contained in:
parent
357ce8171a
commit
211c7f9bb8
5 changed files with 24 additions and 32 deletions
|
@ -237,10 +237,10 @@ static void create_fdt_socket_cpus(RISCVVirtState *s, int socket,
|
|||
uint32_t cpu_phandle;
|
||||
MachineState *ms = MACHINE(s);
|
||||
bool is_32_bit = riscv_is_32bit(&s->soc[0]);
|
||||
uint8_t satp_mode_max;
|
||||
|
||||
for (cpu = s->soc[socket].num_harts - 1; cpu >= 0; cpu--) {
|
||||
RISCVCPU *cpu_ptr = &s->soc[socket].harts[cpu];
|
||||
int8_t satp_mode_max = cpu_ptr->cfg.max_satp_mode;
|
||||
g_autofree char *cpu_name = NULL;
|
||||
g_autofree char *core_name = NULL;
|
||||
g_autofree char *intc_name = NULL;
|
||||
|
@ -252,8 +252,7 @@ static void create_fdt_socket_cpus(RISCVVirtState *s, int socket,
|
|||
s->soc[socket].hartid_base + cpu);
|
||||
qemu_fdt_add_subnode(ms->fdt, cpu_name);
|
||||
|
||||
if (cpu_ptr->cfg.satp_mode.supported != 0) {
|
||||
satp_mode_max = satp_mode_max_from_map(cpu_ptr->cfg.satp_mode.map);
|
||||
if (satp_mode_max != -1) {
|
||||
sv_name = g_strdup_printf("riscv,%s",
|
||||
satp_mode_str(satp_mode_max, is_32_bit));
|
||||
qemu_fdt_setprop_string(ms->fdt, cpu_name, "mmu-type", sv_name);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue