Skip to content

Commit f50803b

Browse files
npiggingregkh
authored andcommitted
powerpc/pseries: Get entry and uaccess flush required bits from H_GET_CPU_CHARACTERISTICS
commit 65c7d07 upstream. This allows the hypervisor / firmware to describe these workarounds to the guest. Signed-off-by: Nicholas Piggin <npiggin@gmail.com> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au> Link: https://lore.kernel.org/r/20210503130243.891868-2-npiggin@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 68c1aa8 commit f50803b

2 files changed

Lines changed: 8 additions & 0 deletions

File tree

arch/powerpc/include/asm/hvcall.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -382,6 +382,8 @@
382382
#define H_CPU_BEHAV_BNDS_CHK_SPEC_BAR (1ull << 61) // IBM bit 2
383383
#define H_CPU_BEHAV_FLUSH_COUNT_CACHE (1ull << 58) // IBM bit 5
384384
#define H_CPU_BEHAV_FLUSH_LINK_STACK (1ull << 57) // IBM bit 6
385+
#define H_CPU_BEHAV_NO_L1D_FLUSH_ENTRY (1ull << 56) // IBM bit 7
386+
#define H_CPU_BEHAV_NO_L1D_FLUSH_UACCESS (1ull << 55) // IBM bit 8
385387

386388
/* Flag values used in H_REGISTER_PROC_TBL hcall */
387389
#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
@@ -538,6 +538,12 @@ static void init_cpu_char_feature_flags(struct h_cpu_char_result *result)
538538
if (!(result->behaviour & H_CPU_BEHAV_L1D_FLUSH_PR))
539539
security_ftr_clear(SEC_FTR_L1D_FLUSH_PR);
540540

541+
if (result->behaviour & H_CPU_BEHAV_NO_L1D_FLUSH_ENTRY)
542+
security_ftr_clear(SEC_FTR_L1D_FLUSH_ENTRY);
543+
544+
if (result->behaviour & H_CPU_BEHAV_NO_L1D_FLUSH_UACCESS)
545+
security_ftr_clear(SEC_FTR_L1D_FLUSH_UACCESS);
546+
541547
if (!(result->behaviour & H_CPU_BEHAV_BNDS_CHK_SPEC_BAR))
542548
security_ftr_clear(SEC_FTR_BNDS_CHK_SPEC_BAR);
543549
}

0 commit comments

Comments
 (0)