This is a note to let you know that I've just added the patch titled powerpc/security: Add a helper to query stf_barrier type to the 5.10-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is: powerpc-security-add-a-helper-to-query-stf_barrier-type.patch and it can be found in the queue-5.10 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let <stable@xxxxxxxxxxxxxxx> know about it. >From foo@baz Mon Nov 15 03:32:23 PM CET 2021 From: "Naveen N. Rao" <naveen.n.rao@xxxxxxxxxxxxxxxxxx> Date: Mon, 15 Nov 2021 16:36:29 +0530 Subject: powerpc/security: Add a helper to query stf_barrier type To: <stable@xxxxxxxxxxxxxxx> Cc: Michael Ellerman <mpe@xxxxxxxxxxxxxx>, Daniel Borkmann <daniel@xxxxxxxxxxxxx> Message-ID: <924e967ed8ed2dfcc748eab13cb86e22f3a72afe.1636963563.git.naveen.n.rao@xxxxxxxxxxxxxxxxxx> From: "Naveen N. Rao" <naveen.n.rao@xxxxxxxxxxxxxxxxxx> upstream commit 030905920f32e91a52794937f67434ac0b3ea41a Add a helper to return the stf_barrier type for the current processor. Signed-off-by: Naveen N. Rao <naveen.n.rao@xxxxxxxxxxxxxxxxxx> Signed-off-by: Michael Ellerman <mpe@xxxxxxxxxxxxxx> Link: https://lore.kernel.org/r/3bd5d7f96ea1547991ac2ce3137dc2b220bae285.1633464148.git.naveen.n.rao@xxxxxxxxxxxxxxxxxx Signed-off-by: Naveen N. Rao <naveen.n.rao@xxxxxxxxxxxxxxxxxx> Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx> --- arch/powerpc/include/asm/security_features.h | 5 +++++ arch/powerpc/kernel/security.c | 5 +++++ 2 files changed, 10 insertions(+) --- a/arch/powerpc/include/asm/security_features.h +++ b/arch/powerpc/include/asm/security_features.h @@ -39,6 +39,11 @@ static inline bool security_ftr_enabled( return !!(powerpc_security_features & feature); } +#ifdef CONFIG_PPC_BOOK3S_64 +enum stf_barrier_type stf_barrier_type_get(void); +#else +static inline enum stf_barrier_type stf_barrier_type_get(void) { return STF_BARRIER_NONE; } +#endif // Features indicating support for Spectre/Meltdown mitigations --- a/arch/powerpc/kernel/security.c +++ b/arch/powerpc/kernel/security.c @@ -261,6 +261,11 @@ static int __init handle_no_stf_barrier( early_param("no_stf_barrier", handle_no_stf_barrier); +enum stf_barrier_type stf_barrier_type_get(void) +{ + return stf_enabled_flush_types; +} + /* This is the generic flag used by other architectures */ static int __init handle_ssbd(char *p) { Patches currently in stable-queue which might be from naveen.n.rao@xxxxxxxxxxxxxxxxxx are queue-5.10/powerpc-bpf-emit-stf-barrier-instruction-sequences-for-bpf_nospec.patch queue-5.10/powerpc-bpf-validate-branch-ranges.patch queue-5.10/powerpc-lib-add-helper-to-check-if-offset-is-within-conditional-branch-range.patch queue-5.10/powerpc-security-add-a-helper-to-query-stf_barrier-type.patch