hw/riscv: use ms->fdt in riscv_socket_fdt_write_distance_matrix()

There's no need to use a MachineState pointer and a fdt pointer now that
all RISC-V machines are using the FDT from the MachineState.

Signed-off-by: Daniel Henrique Barboza <dbarboza@ventanamicro.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
Message-Id: <20230111170948.316276-7-dbarboza@ventanamicro.com>
Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
This commit is contained in:
Daniel Henrique Barboza 2023-01-11 14:09:44 -03:00 committed by Alistair Francis
parent fb60b488cf
commit 9c3ee7e847
4 changed files with 8 additions and 8 deletions

View File

@ -164,7 +164,7 @@ void riscv_socket_fdt_write_id(const MachineState *ms, const char *node_name,
}
}
void riscv_socket_fdt_write_distance_matrix(const MachineState *ms, void *fdt)
void riscv_socket_fdt_write_distance_matrix(const MachineState *ms)
{
int i, j, idx;
uint32_t *dist_matrix, dist_matrix_size;
@ -184,10 +184,10 @@ void riscv_socket_fdt_write_distance_matrix(const MachineState *ms, void *fdt)
}
}
qemu_fdt_add_subnode(fdt, "/distance-map");
qemu_fdt_setprop_string(fdt, "/distance-map", "compatible",
qemu_fdt_add_subnode(ms->fdt, "/distance-map");
qemu_fdt_setprop_string(ms->fdt, "/distance-map", "compatible",
"numa-distance-map-v1");
qemu_fdt_setprop(fdt, "/distance-map", "distance-matrix",
qemu_fdt_setprop(ms->fdt, "/distance-map", "distance-matrix",
dist_matrix, dist_matrix_size);
g_free(dist_matrix);
}

View File

@ -174,7 +174,7 @@ static void create_fdt(SpikeState *s, const MemMapEntry *memmap,
g_free(clust_name);
}
riscv_socket_fdt_write_distance_matrix(mc, fdt);
riscv_socket_fdt_write_distance_matrix(mc);
qemu_fdt_add_subnode(fdt, "/chosen");
qemu_fdt_setprop_string(fdt, "/chosen", "stdout-path", "/htif");

View File

@ -805,7 +805,7 @@ static void create_fdt_sockets(RISCVVirtState *s, const MemMapEntry *memmap,
}
}
riscv_socket_fdt_write_distance_matrix(mc, mc->fdt);
riscv_socket_fdt_write_distance_matrix(mc);
}
static void create_fdt_virtio(RISCVVirtState *s, const MemMapEntry *memmap,

View File

@ -100,9 +100,9 @@ void riscv_socket_fdt_write_id(const MachineState *ms, const char *node_name,
* @ms: pointer to machine state
* @socket_id: socket index
*
* Write NUMA distance matrix in FDT for given machine
* Write NUMA distance matrix in MachineState->fdt
*/
void riscv_socket_fdt_write_distance_matrix(const MachineState *ms, void *fdt);
void riscv_socket_fdt_write_distance_matrix(const MachineState *ms);
CpuInstanceProperties
riscv_numa_cpu_index_to_props(MachineState *ms, unsigned cpu_index);