cpu: Unconditionally cleanup TLBs on P9 in opal_reinit_cpus()
This can work around problems where Linux fails to properly
cleanup part or all of the TLB on kexec.
@@ -1191,11 +1191,20 @@ static int64_t opal_reinit_cpus(uint64_t flags)
else
req.clr_bits |= SPR_HID0_POWER9_RADIX;
- cleanup_global_tlb();
current_radix_mode = radix;
}
}
+ /* Cleanup the TLB. We do that unconditionally, this works
+ * around issues where OSes fail to invalidate the PWC in Radix
+ * mode for example. This only works on P9 and later, but we
+ * also know we don't have a problem with Linux cleanups on
+ * P8 so this isn't a problem. If we wanted to cleanup the
+ * TLB on P8 as well, we'd have to use jobs to do it locally
+ * on each CPU.
+ */
+ cleanup_global_tlb();
+
/* Apply HID bits changes if any */
if (req.set_bits || req.clr_bits)
cpu_change_all_hid0(&req);
