Skip to content

Commit 1a31244

Browse files
committed
powerpc/powernv: Remove POWER9 PVR version check for entry and uaccess flushes
jira LE-1907 Rebuild_History Non-Buildable kernel-rt-5.14.0-284.30.1.rt14.315.el9_2 commit-author Nicholas Piggin <npiggin@gmail.com> commit d02fa40 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 <npiggin@gmail.com> Reviewed-by: Joel Stanley <joel@jms.id.au> [mpe: Incorporate changes from Nick, reword comment slightly.] Signed-off-by: Michael Ellerman <mpe@ellerman.id.au> Link: https://lore.kernel.org/r/20210503130243.891868-5-npiggin@gmail.com (cherry picked from commit d02fa40) Signed-off-by: Jonathan Maple <jmaple@ciq.com>
1 parent b67253b commit 1a31244

File tree

1 file changed

+7
-3
lines changed
  • arch/powerpc/platforms/powernv

1 file changed

+7
-3
lines changed

arch/powerpc/platforms/powernv/setup.c

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -123,10 +123,14 @@ static void pnv_setup_security_mitigations(void)
123123
}
124124

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

0 commit comments

Comments
 (0)