Preserve the LPCR on new-ish (POWER7 and POWER8) CPUs, preventing exceptions

and such from ending on the wrong CPU on SMP systems. It would be good to
have this be more generic somehow as POWER9s appear, but PPC does not
have features bits, unfortunately.

MFC after:	3 weeks
This commit is contained in:
Nathan Whitehorn 2017-11-25 22:03:25 +00:00
parent f04a8fd6a9
commit cb74659e0c
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=326207

View file

@ -374,6 +374,13 @@ cpudep_ap_setup()
reg = mpc74xx_l1i_enable();
break;
case IBMPOWER7:
case IBMPOWER7PLUS:
case IBMPOWER8:
case IBMPOWER8E:
if (mfmsr() & PSL_HV)
mtspr(SPR_LPCR, mfspr(SPR_LPCR) | LPCR_LPES);
break;
default:
#ifdef __powerpc64__
if (!(mfmsr() & PSL_HV)) /* Rely on HV to have set things up */