Skip to content
This repository was archived by the owner on Nov 8, 2023. It is now read-only.

Commit 65c7d07

Browse files
npigginmpe
authored andcommitted
powerpc/pseries: Get entry and uaccess flush required bits from H_GET_CPU_CHARACTERISTICS
This allows the hypervisor / firmware to describe these 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 710e682 commit 65c7d07

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

arch/powerpc/include/asm/hvcall.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -400,6 +400,8 @@
400400
#define H_CPU_BEHAV_FAVOUR_SECURITY_H (1ull << 60) // IBM bit 3
401401
#define H_CPU_BEHAV_FLUSH_COUNT_CACHE (1ull << 58) // IBM bit 5
402402
#define H_CPU_BEHAV_FLUSH_LINK_STACK (1ull << 57) // IBM bit 6
403+
#define H_CPU_BEHAV_NO_L1D_FLUSH_ENTRY (1ull << 56) // IBM bit 7
404+
#define H_CPU_BEHAV_NO_L1D_FLUSH_UACCESS (1ull << 55) // IBM bit 8
403405

404406
/* Flag values used in H_REGISTER_PROC_TBL hcall */
405407
#define PROC_TABLE_OP_MASK 0x18

arch/powerpc/platforms/pseries/setup.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -549,6 +549,12 @@ static void init_cpu_char_feature_flags(struct h_cpu_char_result *result)
549549
if (!(result->behaviour & H_CPU_BEHAV_L1D_FLUSH_PR))
550550
security_ftr_clear(SEC_FTR_L1D_FLUSH_PR);
551551

552+
if (result->behaviour & H_CPU_BEHAV_NO_L1D_FLUSH_ENTRY)
553+
security_ftr_clear(SEC_FTR_L1D_FLUSH_ENTRY);
554+
555+
if (result->behaviour & H_CPU_BEHAV_NO_L1D_FLUSH_UACCESS)
556+
security_ftr_clear(SEC_FTR_L1D_FLUSH_UACCESS);
557+
552558
if (!(result->behaviour & H_CPU_BEHAV_BNDS_CHK_SPEC_BAR))
553559
security_ftr_clear(SEC_FTR_BNDS_CHK_SPEC_BAR);
554560
}

0 commit comments

Comments
 (0)