|
| From: | Pierre Morel |
| Subject: | Re: [PATCH v17 06/12] s390x/cpu topology: interception of PTF instruction |
| Date: | Tue, 14 Mar 2023 17:09:03 +0100 |
| User-agent: | Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.8.0 |
I am currently developing tests under avocado to help debugging. And... it helps.There is a bug here in s390_topology_set_cpus_entitlement for dedicated CPUs.
On 3/9/23 13:15, Pierre Morel wrote: [...]
--- a/hw/s390x/cpu-topology.c +++ b/hw/s390x/cpu-topology.c @@ -87,6 +87,84 @@ static void s390_topology_init(MachineState *ms) QTAILQ_INSERT_HEAD(&s390_topology.list, entry, next); }+/**+ * s390_topology_set_cpus_entitlement: + * @polarization: polarization requested by the caller + * + * On hotplug or when changing CPU attributes the shadow_entitlement + * is set to hold the entitlement used on a vertical polarization. + * When polarization is horizontal, the entitlement is horizontal too. + */ +static void s390_topology_set_cpus_entitlement(int polarization) +{ + CPUState *cs; + + CPU_FOREACH(cs) { + CPUS390XState *env = &S390_CPU(cs)->env; + + if (polarization == S390_CPU_POLARIZATION_HORIZONTAL) { + env->entitlement = S390_CPU_ENTITLEMENT_HORIZONTAL; + } else { + env->entitlement = env->shadow_entitlement; + } + } +}
This should be something like:
static void s390_topology_set_cpus_entitlement(void)
{
CPUState *cs;
CPU_FOREACH(cs) {
CPUS390XState *env = &S390_CPU(cs)->env;
if (s390_topology.polarization ==
S390_CPU_POLARIZATION_HORIZONTAL) {
env->entitlement = S390_CPU_ENTITLEMENT_HORIZONTAL;
} else if (env->entitlement == S390_CPU_ENTITLEMENT_HORIZONTAL) {
if (env->dedicated) {
env->entitlement = S390_CPU_ENTITLEMENT_HIGH;
} else {
env->entitlement = env->shadow_entitlement;
}
}
}
}
Sorry.
I provide a new series including the avocado tests.
regards,
Pierre
| [Prev in Thread] | Current Thread | [Next in Thread] |