OSDN Git Service

powerpc/pseries: Honour current SMT state when DLPAR onlining CPUs
authorMichael Ellerman <mpe@ellerman.id.au>
Wed, 5 Jul 2023 14:51:43 +0000 (16:51 +0200)
committerMichael Ellerman <mpe@ellerman.id.au>
Wed, 2 Aug 2023 12:49:46 +0000 (22:49 +1000)
Integrate with the generic SMT support, so that when a CPU is DLPAR
onlined it is brought up with the correct SMT mode.

Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://msgid.link/20230705145143.40545-11-ldufour@linux.ibm.com
arch/powerpc/platforms/pseries/hotplug-cpu.c

index 61fb7cb..e62835a 100644 (file)
@@ -398,6 +398,14 @@ static int dlpar_online_cpu(struct device_node *dn)
                for_each_present_cpu(cpu) {
                        if (get_hard_smp_processor_id(cpu) != thread)
                                continue;
+
+                       if (!topology_is_primary_thread(cpu)) {
+                               if (cpu_smt_control != CPU_SMT_ENABLED)
+                                       break;
+                               if (!topology_smt_thread_allowed(cpu))
+                                       break;
+                       }
+
                        cpu_maps_update_done();
                        find_and_update_cpu_nid(cpu);
                        rc = device_online(get_cpu_device(cpu));