Skip to content

Commit

Permalink
powerpc/powernv: Remove POWER9 PVR version check for entry and uacces…
Browse files Browse the repository at this point in the history
…s flushes

These aren't necessarily POWER9 only, and it's not to say some new
vulnerability may not get discovered on other processors for which
we would like the flexibility of having the workaround enabled by
firmware.

Remove the restriction that the workarounds only apply to POWER9.

However POWER7 and POWER8 are not affected, and they may not have
older firmware that does not advertise this, so clear these workarounds
manually.

Signed-off-by: Nicholas Piggin <[email protected]>
Reviewed-by: Joel Stanley <[email protected]>
[mpe: Incorporate changes from Nick, reword comment slightly.]
Signed-off-by: Michael Ellerman <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
  • Loading branch information
npiggin authored and mpe committed Nov 25, 2021
1 parent a1d2b21 commit d02fa40
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions arch/powerpc/platforms/powernv/setup.c
Original file line number Diff line number Diff line change
Expand Up @@ -123,10 +123,14 @@ static void pnv_setup_security_mitigations(void)
}

/*
* If we are non-Power9 bare metal, we don't need to flush on kernel
* entry or after user access: they fix a P9 specific vulnerability.
* The issues addressed by the entry and uaccess flush don't affect P7
* or P8, so on bare metal disable them explicitly in case firmware does
* not include the features to disable them. POWER9 and newer processors
* should have the appropriate firmware flags.
*/
if (!pvr_version_is(PVR_POWER9)) {
if (pvr_version_is(PVR_POWER7) || pvr_version_is(PVR_POWER7p) ||
pvr_version_is(PVR_POWER8E) || pvr_version_is(PVR_POWER8NVL) ||
pvr_version_is(PVR_POWER8)) {
security_ftr_clear(SEC_FTR_L1D_FLUSH_ENTRY);
security_ftr_clear(SEC_FTR_L1D_FLUSH_UACCESS);
}
Expand Down

0 comments on commit d02fa40

Please sign in to comment.