]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/blobdiff - arch/powerpc/platforms/pseries/setup.c
[POWERPC] Implement SLB shadow buffer
[mirror_ubuntu-artful-kernel.git] / arch / powerpc / platforms / pseries / setup.c
index 927e0a423b87ae3f86c313430f73ef98ed468b7a..6ebeecfd6bcb9288ba7971e2e001a41bf2779e52 100644 (file)
@@ -234,9 +234,17 @@ static void pseries_kexec_cpu_down_xics(int crash_shutdown, int secondary)
 {
        /* Don't risk a hypervisor call if we're crashing */
        if (firmware_has_feature(FW_FEATURE_SPLPAR) && !crash_shutdown) {
-               unsigned long vpa = __pa(get_lppaca());
+               unsigned long addr;
 
-               if (unregister_vpa(hard_smp_processor_id(), vpa)) {
+               addr = __pa(get_slb_shadow());
+               if (unregister_slb_shadow(hard_smp_processor_id(), addr))
+                       printk("SLB shadow buffer deregistration of "
+                              "cpu %u (hw_cpu_id %d) failed\n",
+                              smp_processor_id(),
+                              hard_smp_processor_id());
+
+               addr = __pa(get_lppaca());
+               if (unregister_vpa(hard_smp_processor_id(), addr)) {
                        printk("VPA deregistration of cpu %u (hw_cpu_id %d) "
                                        "failed\n", smp_processor_id(),
                                        hard_smp_processor_id());
@@ -501,7 +509,8 @@ static void pseries_dedicated_idle_sleep(void)
        }
 
        /*
-        * Cede if the other thread is not idle, so that it can
+        * If not SMT, cede processor.  If CPU is running SMT
+        * cede if the other thread is not idle, so that it can
         * go single-threaded.  If the other thread is idle,
         * we ask the hypervisor if it has pending work it
         * wants to do and cede if it does.  Otherwise we keep
@@ -514,7 +523,8 @@ static void pseries_dedicated_idle_sleep(void)
         * very low priority.  The cede enables interrupts, which
         * doesn't matter here.
         */
-       if (!lppaca[cpu ^ 1].idle || poll_pending() == H_PENDING)
+       if (!cpu_has_feature(CPU_FTR_SMT) || !lppaca[cpu ^ 1].idle
+           || poll_pending() == H_PENDING)
                cede_processor();
 
 out: