Skip to content

Commit 393eff5

Browse files
npigginmpe
authored andcommitted
powerpc/pesries: Get STF barrier requirement from H_GET_CPU_CHARACTERISTICS
This allows the hypervisor / firmware to describe this workarounds to the guest. Signed-off-by: Nicholas Piggin <[email protected]> Signed-off-by: Michael Ellerman <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent 84ed26f commit 393eff5

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

arch/powerpc/include/asm/hvcall.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -402,6 +402,7 @@
402402
#define H_CPU_BEHAV_FLUSH_LINK_STACK (1ull << 57) // IBM bit 6
403403
#define H_CPU_BEHAV_NO_L1D_FLUSH_ENTRY (1ull << 56) // IBM bit 7
404404
#define H_CPU_BEHAV_NO_L1D_FLUSH_UACCESS (1ull << 55) // IBM bit 8
405+
#define H_CPU_BEHAV_NO_STF_BARRIER (1ull << 54) // IBM bit 9
405406

406407
/* Flag values used in H_REGISTER_PROC_TBL hcall */
407408
#define PROC_TABLE_OP_MASK 0x18

arch/powerpc/platforms/pseries/setup.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -555,6 +555,9 @@ static void init_cpu_char_feature_flags(struct h_cpu_char_result *result)
555555
if (result->behaviour & H_CPU_BEHAV_NO_L1D_FLUSH_UACCESS)
556556
security_ftr_clear(SEC_FTR_L1D_FLUSH_UACCESS);
557557

558+
if (result->behaviour & H_CPU_BEHAV_NO_STF_BARRIER)
559+
security_ftr_clear(SEC_FTR_STF_BARRIER);
560+
558561
if (!(result->behaviour & H_CPU_BEHAV_BNDS_CHK_SPEC_BAR))
559562
security_ftr_clear(SEC_FTR_BNDS_CHK_SPEC_BAR);
560563
}

0 commit comments

Comments
 (0)