From: "Naveen N. Rao" <naveen.n.rao@linux.vnet.ibm.com> To: Michael Ellerman <mpe@ellerman.id.au>, Nicholas Piggin <npiggin@gmail.com>, Jordan Niethe <jniethe5@gmail.com>, Daniel Borkmann <daniel@iogearbox.net>, Alexei Starovoitov <alexei.starovoitov@gmail.com>, Christophe Leroy <christophe.leroy@csgroup.eu>, Johan Almbladh <johan.almbladh@anyfinetworks.com>, Song Liu <songliubraving@fb.com> Cc: <bpf@vger.kernel.org>, <linuxppc-dev@lists.ozlabs.org> Subject: [PATCH v2 05/10] powerpc/security: Add a helper to query stf_barrier type Date: Wed, 6 Oct 2021 01:55:24 +0530 [thread overview] Message-ID: <3bd5d7f96ea1547991ac2ce3137dc2b220bae285.1633464148.git.naveen.n.rao@linux.vnet.ibm.com> (raw) In-Reply-To: <cover.1633464148.git.naveen.n.rao@linux.vnet.ibm.com> Add a helper to return the stf_barrier type for the current processor. Signed-off-by: Naveen N. Rao <naveen.n.rao@linux.vnet.ibm.com> --- arch/powerpc/include/asm/security_features.h | 5 +++++ arch/powerpc/kernel/security.c | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/arch/powerpc/include/asm/security_features.h b/arch/powerpc/include/asm/security_features.h index 792eefaf230b80..27574f218b371f 100644 --- 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(u64 feature) 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 diff --git a/arch/powerpc/kernel/security.c b/arch/powerpc/kernel/security.c index 1a998490fe60f0..15fb5ea1b9eafa 100644 --- a/arch/powerpc/kernel/security.c +++ b/arch/powerpc/kernel/security.c @@ -263,6 +263,11 @@ static int __init handle_no_stf_barrier(char *p) 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) { -- 2.33.0
WARNING: multiple messages have this Message-ID (diff)
From: "Naveen N. Rao" <naveen.n.rao@linux.vnet.ibm.com> To: Michael Ellerman <mpe@ellerman.id.au>, Nicholas Piggin <npiggin@gmail.com>, Jordan Niethe <jniethe5@gmail.com>, Daniel Borkmann <daniel@iogearbox.net>, Alexei Starovoitov <alexei.starovoitov@gmail.com>, Christophe Leroy <christophe.leroy@csgroup.eu>, Johan Almbladh <johan.almbladh@anyfinetworks.com>, Song Liu <songliubraving@fb.com> Cc: bpf@vger.kernel.org, linuxppc-dev@lists.ozlabs.org Subject: [PATCH v2 05/10] powerpc/security: Add a helper to query stf_barrier type Date: Wed, 6 Oct 2021 01:55:24 +0530 [thread overview] Message-ID: <3bd5d7f96ea1547991ac2ce3137dc2b220bae285.1633464148.git.naveen.n.rao@linux.vnet.ibm.com> (raw) In-Reply-To: <cover.1633464148.git.naveen.n.rao@linux.vnet.ibm.com> Add a helper to return the stf_barrier type for the current processor. Signed-off-by: Naveen N. Rao <naveen.n.rao@linux.vnet.ibm.com> --- arch/powerpc/include/asm/security_features.h | 5 +++++ arch/powerpc/kernel/security.c | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/arch/powerpc/include/asm/security_features.h b/arch/powerpc/include/asm/security_features.h index 792eefaf230b80..27574f218b371f 100644 --- 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(u64 feature) 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 diff --git a/arch/powerpc/kernel/security.c b/arch/powerpc/kernel/security.c index 1a998490fe60f0..15fb5ea1b9eafa 100644 --- a/arch/powerpc/kernel/security.c +++ b/arch/powerpc/kernel/security.c @@ -263,6 +263,11 @@ static int __init handle_no_stf_barrier(char *p) 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) { -- 2.33.0
next prev parent reply other threads:[~2021-10-05 20:26 UTC|newest] Thread overview: 33+ messages / expand[flat|nested] mbox.gz Atom feed top 2021-10-05 20:25 [PATCH v2 00/10] powerpc/bpf: Various fixes Naveen N. Rao 2021-10-05 20:25 ` Naveen N. Rao 2021-10-05 20:25 ` [PATCH v2 01/10] powerpc/lib: Add helper to check if offset is within conditional branch range Naveen N. Rao 2021-10-05 20:25 ` Naveen N. Rao 2021-10-06 4:50 ` Christophe Leroy 2021-10-05 20:25 ` [PATCH v2 02/10] powerpc/bpf: Validate branch ranges Naveen N. Rao 2021-10-05 20:25 ` Naveen N. Rao 2021-10-06 4:51 ` LEROY Christophe 2021-10-06 4:51 ` Christophe Leroy 2021-10-05 20:25 ` [PATCH v2 03/10] powerpc/bpf: Fix BPF_MOD when imm == 1 Naveen N. Rao 2021-10-05 20:25 ` Naveen N. Rao 2021-10-06 4:52 ` Christophe Leroy 2021-10-05 20:25 ` [PATCH v2 04/10] powerpc/bpf: Fix BPF_SUB when imm == 0x80000000 Naveen N. Rao 2021-10-05 20:25 ` Naveen N. Rao 2021-10-06 4:55 ` Christophe Leroy 2021-10-07 8:47 ` Naveen N. Rao 2021-10-05 20:25 ` Naveen N. Rao [this message] 2021-10-05 20:25 ` [PATCH v2 05/10] powerpc/security: Add a helper to query stf_barrier type Naveen N. Rao 2021-10-05 20:25 ` [PATCH v2 06/10] powerpc/bpf: Emit stf barrier instruction sequences for BPF_NOSPEC Naveen N. Rao 2021-10-05 20:25 ` Naveen N. Rao 2021-10-05 20:25 ` [PATCH v2 07/10] powerpc/bpf ppc32: Fix ALU32 BPF_ARSH operation Naveen N. Rao 2021-10-05 20:25 ` Naveen N. Rao 2021-10-06 4:56 ` Christophe Leroy 2021-10-05 20:25 ` [PATCH v2 08/10] powerpc/bpf ppc32: Fix JMP32_JSET_K Naveen N. Rao 2021-10-05 20:25 ` Naveen N. Rao 2021-10-06 5:00 ` Christophe Leroy 2021-10-05 20:25 ` [PATCH v2 09/10] powerpc/bpf ppc32: Do not emit zero extend instruction for 64-bit BPF_END Naveen N. Rao 2021-10-05 20:25 ` Naveen N. Rao 2021-10-06 5:03 ` Christophe Leroy 2021-10-05 20:25 ` [PATCH v2 10/10] powerpc/bpf ppc32: Fix BPF_SUB when imm == 0x80000000 Naveen N. Rao 2021-10-05 20:25 ` Naveen N. Rao 2021-10-06 5:02 ` Christophe Leroy 2021-10-08 13:22 ` [PATCH v2 00/10] powerpc/bpf: Various fixes Michael Ellerman
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=3bd5d7f96ea1547991ac2ce3137dc2b220bae285.1633464148.git.naveen.n.rao@linux.vnet.ibm.com \ --to=naveen.n.rao@linux.vnet.ibm.com \ --cc=alexei.starovoitov@gmail.com \ --cc=bpf@vger.kernel.org \ --cc=christophe.leroy@csgroup.eu \ --cc=daniel@iogearbox.net \ --cc=jniethe5@gmail.com \ --cc=johan.almbladh@anyfinetworks.com \ --cc=linuxppc-dev@lists.ozlabs.org \ --cc=mpe@ellerman.id.au \ --cc=npiggin@gmail.com \ --cc=songliubraving@fb.com \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.