spapr_numa.c: split FORM1 code into helpers
The upcoming FORM2 NUMA affinity will support asymmetric NUMA topologies and doesn't need be concerned with all the legacy support for older pseries FORM1 guests. We're also not going to calculate associativity domains based on numa distance (via spapr_numa_define_associativity_domains) since the distances will be written directly into new DT properties. Let's split FORM1 code into its own functions to allow for easier insertion of FORM2 logic later on. Reviewed-by: Greg Kurz <groug@kaod.org> Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com> Message-Id: <20210920174947.556324-2-danielhb413@gmail.com> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
This commit is contained in:
parent
92fb92d3e9
commit
d98dbe2a2b
|
@ -92,7 +92,7 @@ static uint8_t spapr_numa_get_numa_level(uint8_t distance)
|
|||
return 0;
|
||||
}
|
||||
|
||||
static void spapr_numa_define_associativity_domains(SpaprMachineState *spapr)
|
||||
static void spapr_numa_define_FORM1_domains(SpaprMachineState *spapr)
|
||||
{
|
||||
MachineState *ms = MACHINE(spapr);
|
||||
NodeInfo *numa_info = ms->numa_state->nodes;
|
||||
|
@ -155,7 +155,10 @@ static void spapr_numa_define_associativity_domains(SpaprMachineState *spapr)
|
|||
|
||||
}
|
||||
|
||||
void spapr_numa_associativity_init(SpaprMachineState *spapr,
|
||||
/*
|
||||
* Set NUMA machine state data based on FORM1 affinity semantics.
|
||||
*/
|
||||
static void spapr_numa_FORM1_affinity_init(SpaprMachineState *spapr,
|
||||
MachineState *machine)
|
||||
{
|
||||
SpaprMachineClass *smc = SPAPR_MACHINE_GET_CLASS(spapr);
|
||||
|
@ -225,7 +228,13 @@ void spapr_numa_associativity_init(SpaprMachineState *spapr,
|
|||
exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
spapr_numa_define_associativity_domains(spapr);
|
||||
spapr_numa_define_FORM1_domains(spapr);
|
||||
}
|
||||
|
||||
void spapr_numa_associativity_init(SpaprMachineState *spapr,
|
||||
MachineState *machine)
|
||||
{
|
||||
spapr_numa_FORM1_affinity_init(spapr, machine);
|
||||
}
|
||||
|
||||
void spapr_numa_write_associativity_dt(SpaprMachineState *spapr, void *fdt,
|
||||
|
@ -302,12 +311,8 @@ int spapr_numa_write_assoc_lookup_arrays(SpaprMachineState *spapr, void *fdt,
|
|||
return ret;
|
||||
}
|
||||
|
||||
/*
|
||||
* Helper that writes ibm,associativity-reference-points and
|
||||
* max-associativity-domains in the RTAS pointed by @rtas
|
||||
* in the DT @fdt.
|
||||
*/
|
||||
void spapr_numa_write_rtas_dt(SpaprMachineState *spapr, void *fdt, int rtas)
|
||||
static void spapr_numa_FORM1_write_rtas_dt(SpaprMachineState *spapr,
|
||||
void *fdt, int rtas)
|
||||
{
|
||||
MachineState *ms = MACHINE(spapr);
|
||||
SpaprMachineClass *smc = SPAPR_MACHINE_GET_CLASS(spapr);
|
||||
|
@ -365,6 +370,16 @@ void spapr_numa_write_rtas_dt(SpaprMachineState *spapr, void *fdt, int rtas)
|
|||
maxdomains, sizeof(maxdomains)));
|
||||
}
|
||||
|
||||
/*
|
||||
* Helper that writes ibm,associativity-reference-points and
|
||||
* max-associativity-domains in the RTAS pointed by @rtas
|
||||
* in the DT @fdt.
|
||||
*/
|
||||
void spapr_numa_write_rtas_dt(SpaprMachineState *spapr, void *fdt, int rtas)
|
||||
{
|
||||
spapr_numa_FORM1_write_rtas_dt(spapr, fdt, rtas);
|
||||
}
|
||||
|
||||
static target_ulong h_home_node_associativity(PowerPCCPU *cpu,
|
||||
SpaprMachineState *spapr,
|
||||
target_ulong opcode,
|
||||
|
|
Loading…
Reference in New Issue