On Tue, Feb 26, 2019 at 02:05:31PM +1100, Suraj Jitindar Singh wrote: > Enable the large decrementer by default on POWER9 cpu models. The > default value applied is that provided in the cpu class. > > Signed-off-by: Suraj Jitindar Singh <[email protected]> > --- > hw/ppc/spapr_caps.c | 7 +++++++ > 1 file changed, 7 insertions(+) > > diff --git a/hw/ppc/spapr_caps.c b/hw/ppc/spapr_caps.c > index e07568fb94..f48aa367e3 100644 > --- a/hw/ppc/spapr_caps.c > +++ b/hw/ppc/spapr_caps.c > @@ -566,11 +566,18 @@ sPAPRCapabilityInfo capability_table[SPAPR_CAP_NUM] = { > static sPAPRCapabilities default_caps_with_cpu(sPAPRMachineState *spapr, > const char *cputype) > { > + PowerPCCPUClass *pcc = POWERPC_CPU_CLASS(object_class_by_name(cputype)); > sPAPRMachineClass *smc = SPAPR_MACHINE_GET_CLASS(spapr); > sPAPRCapabilities caps; > > caps = smc->default_caps; > > + caps.caps[SPAPR_CAP_LARGE_DECREMENTER] = pcc->hdecr_bits;
So, the rule with default_caps_with_cpu() is that it can reduce the
value from the machine-global default, but never increase it (because
that could change guest visible behaviour for existing machine
versions).
I think the line above will do that.
> + if (!ppc_type_check_compat(cputype, CPU_POWERPC_LOGICAL_3_00,
> + 0, spapr->max_compat_pvr)) {
> + caps.caps[SPAPR_CAP_LARGE_DECREMENTER] = 0;
And this part I think is redundant, because hdecr_bits won't be large
for anything pre-POWER9.
> + }
> +
> if (!ppc_type_check_compat(cputype, CPU_POWERPC_LOGICAL_2_07,
> 0, spapr->max_compat_pvr)) {
> caps.caps[SPAPR_CAP_HTM] = SPAPR_CAP_OFF;
--
David Gibson | I'll have my music baroque, and my code
david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_
| _way_ _around_!
http://www.ozlabs.org/~dgibson
signature.asc
Description: PGP signature
