]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
powerpc/pseries: Skip vpa_init() for boot cpu in smp_setup_cpu()
authorVaibhav Jain <vaibhav@linux.ibm.com>
Wed, 8 Jul 2026 01:58:40 +0000 (07:28 +0530)
committerMadhavan Srinivasan <maddy@linux.ibm.com>
Tue, 28 Jul 2026 04:38:32 +0000 (10:08 +0530)
During pSeries_setup_arch(), VPA for boot-cpu is first to be
initialized. However later in the boot, smp_setup_cpu() is called for
setting up VPA on boot and secondary cpus that were brought online. This
results in vpa_init() being called twice for boot-cpu and three redundant
H_REGISTER_VPA hcalls being made to the hypervisor.

Fix this by adding an extra condition in smp_set_cpu() to call vpa_init()
only on non boot-cpus.

Signed-off-by: Vaibhav Jain <vaibhav@linux.ibm.com>
Signed-off-by: Madhavan Srinivasan <maddy@linux.ibm.com>
Link: https://patch.msgid.link/20260708015842.274690-1-vaibhav@linux.ibm.com
arch/powerpc/platforms/pseries/smp.c

index db99725e752bd56a4c6ee0e80e3cfbecedf54ddf..bf3d7ed3be010fc69b376fb6e8ec4b3664150f4e 100644 (file)
@@ -128,7 +128,12 @@ static void smp_setup_cpu(int cpu)
        else if (cpu != boot_cpuid)
                xics_setup_cpu();
 
-       if (firmware_has_feature(FW_FEATURE_SPLPAR))
+       /*
+        * Initialize VPA on non-boot cpus since boot-cpu vpa was
+        * already initialized in pSeries_setup_arch()
+        */
+       if (firmware_has_feature(FW_FEATURE_SPLPAR) &&
+           cpu != boot_cpuid)
                vpa_init(cpu);
 
        cpumask_clear_cpu(cpu, of_spin_mask);