On Tue May 28, 2024 at 5:45 PM AEST, Cédric Le Goater wrote: > On 5/28/24 09:10, Harsh Prateek Bora wrote: > > Hi Nick, > > > > On 5/26/24 17:56, Nicholas Piggin wrote: > >> This will allow different settings and checks for different > >> machine types with later changes. > >> > >> Signed-off-by: Nicholas Piggin <npig...@gmail.com> > >> --- > >> hw/ppc/pnv.c | 35 ++++++++++++++++++++++++++++++----- > >> 1 file changed, 30 insertions(+), 5 deletions(-) > >> > >> diff --git a/hw/ppc/pnv.c b/hw/ppc/pnv.c > >> index 6e3a5ccdec..a706de2e36 100644 > >> --- a/hw/ppc/pnv.c > >> +++ b/hw/ppc/pnv.c > >> @@ -976,11 +976,6 @@ static void pnv_init(MachineState *machine) > >> pnv->num_chips = > >> machine->smp.max_cpus / (machine->smp.cores * > >> machine->smp.threads); > >> - if (machine->smp.threads > 8) { > >> - error_report("Cannot support more than 8 threads/core " > >> - "on a powernv machine"); > >> - exit(1); > >> - } > >> if (!is_power_of_2(machine->smp.threads)) { > >> error_report("Cannot support %d threads/core on a powernv" > >> "machine because it must be a power of 2", > >> @@ -1076,6 +1071,33 @@ static void pnv_init(MachineState *machine) > >> } > >> } > >> +static void pnv_power8_init(MachineState *machine) > >> +{ > >> + if (machine->smp.threads > 8) { > >> + error_report("Cannot support more than 8 threads/core " > >> + "on a powernv POWER8 machine"); > > > > We could use mc->desc for machine name above, so that .. > > > >> + exit(1); > >> + } > > > > with this patch, we can reuse p8 init for both p9 and p10 (and not just > > reuse p9 for p10 with hard coded string?). > > Good idea. You could add a 'max_smt' attribute to PnvMachineClass to limit > POWER8 to one.
Okay I'll see how that goes. Good suggestions. Thanks, Nick