Re: [PATCH v17 06/12] s390x/cpu topology: interception of PTF instruction

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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




[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux