Skip to content

Commit c18956e

Browse files
ldu4mpe
authored andcommitted
powerpc/pseries: Fix update of LPAR security flavor after LPM
After LPM, when migrating from a system with security mitigation enabled to a system with mitigation disabled, the security flavor exposed in /proc is not correctly set back to 0. Do not assume the value of the security flavor is set to 0 when entering init_cpu_char_feature_flags(), so when called after a LPM, the value is set correctly even if the mitigation are not turned off. Fixes: 6ce56e1 ("powerpc/pseries: export LPAR security flavor in lparcfg") Cc: [email protected] # v5.13+ Signed-off-by: Laurent Dufour <[email protected]> Signed-off-by: Michael Ellerman <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent 8241461 commit c18956e

File tree

1 file changed

+3
-2
lines changed
  • arch/powerpc/platforms/pseries

1 file changed

+3
-2
lines changed

arch/powerpc/platforms/pseries/setup.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -539,9 +539,10 @@ static void init_cpu_char_feature_flags(struct h_cpu_char_result *result)
539539
* H_CPU_BEHAV_FAVOUR_SECURITY_H could be set only if
540540
* H_CPU_BEHAV_FAVOUR_SECURITY is.
541541
*/
542-
if (!(result->behaviour & H_CPU_BEHAV_FAVOUR_SECURITY))
542+
if (!(result->behaviour & H_CPU_BEHAV_FAVOUR_SECURITY)) {
543543
security_ftr_clear(SEC_FTR_FAVOUR_SECURITY);
544-
else if (result->behaviour & H_CPU_BEHAV_FAVOUR_SECURITY_H)
544+
pseries_security_flavor = 0;
545+
} else if (result->behaviour & H_CPU_BEHAV_FAVOUR_SECURITY_H)
545546
pseries_security_flavor = 1;
546547
else
547548
pseries_security_flavor = 2;

0 commit comments

Comments
 (0)