All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dave Hansen <dave.hansen@intel.com>
To: speck@linutronix.de
Cc: Dave Hansen <dave.hansen@linux.intel.com>
Subject: [MODERATED] [PATCH 1/5] SSB extra v2 1
Date: Mon,  7 May 2018 16:18:42 -0700	[thread overview]
Message-ID: <=?utf-8?q?=3C8de240e7d1e070bf12e1614443782815d514a6c5=2E152573?= =?utf-8?q?4796=2Egit=2Edave=2Ehansen=40intel=2Ecom=3E?=> (raw)
In-Reply-To: <cover.1525734796.git.dave.hansen@intel.com>
In-Reply-To: <cover.1525734796.git.dave.hansen@intel.com>

From: Thomas Gleixner <tglx@linutronix.de>

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
---
 include/linux/nospec.h | 4 ++++
 kernel/bpf/core.c      | 5 +++++
 2 files changed, 9 insertions(+)

diff --git a/include/linux/nospec.h b/include/linux/nospec.h
index a908c95..d04ca98 100644
--- a/include/linux/nospec.h
+++ b/include/linux/nospec.h
@@ -63,4 +63,8 @@ int arch_prctl_spec_ctrl_get(struct task_struct *task, unsigned long which);
 int arch_prctl_spec_ctrl_set(struct task_struct *task, unsigned long which,
 			     unsigned long ctrl);
 
+/* Speculation control for BPF enforced mitigation */
+void arch_bpf_spec_ctrl_disable(void);
+void arch_bpf_spec_ctrl_enable(void);
+
 #endif /* _LINUX_NOSPEC_H */
diff --git a/kernel/bpf/core.c b/kernel/bpf/core.c
index ba03ec3..dd7caa1 100644
--- a/kernel/bpf/core.c
+++ b/kernel/bpf/core.c
@@ -31,6 +31,7 @@
 #include <linux/rbtree_latch.h>
 #include <linux/kallsyms.h>
 #include <linux/rcupdate.h>
+#include <linux/nospec.h>
 
 #include <asm/unaligned.h>
 
@@ -1805,6 +1806,10 @@ const struct bpf_func_proto bpf_tail_call_proto = {
 	.arg3_type	= ARG_ANYTHING,
 };
 
+/* Stubs for architectures which do not implement BPF speculation control */
+void __weak arch_bpf_spec_ctrl_disable(void) { }
+void __weak arch_bpf_spec_ctrl_enable(void) { }
+
 /* Stub for JITs that only support cBPF. eBPF programs are interpreted.
  * It is encouraged to implement bpf_int_jit_compile() instead, so that
  * eBPF and implicitly also cBPF can get JITed!
-- 
2.9.5

  reply	other threads:[~2018-05-07 23:24 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-07 23:18 [MODERATED] [PATCH 0/5] SSB extra v2 0 Dave Hansen
2018-05-07 23:18 ` Dave Hansen [this message]
2018-05-07 23:18 ` [MODERATED] [PATCH 2/5] SSB extra v2 2 Dave Hansen
2018-05-07 23:18 ` [MODERATED] [PATCH 3/5] SSB extra v2 3 Dave Hansen
2018-05-07 23:18 ` [MODERATED] [PATCH 4/5] SSB extra v2 4 Dave Hansen
2018-05-07 23:18 ` [MODERATED] [PATCH 5/5] SSB extra v2 5 Dave Hansen
2018-05-08  0:36 ` [MODERATED] " Andi Kleen
2018-05-08  0:46   ` Dave Hansen
2018-05-09 15:36     ` Thomas Gleixner
2018-05-09 15:43       ` [MODERATED] " Dave Hansen
2018-05-09 15:55         ` Greg KH
2018-05-09 16:03           ` Dave Hansen
2018-05-09 16:05             ` Jiri Kosina
2018-05-09 16:36               ` Dave Hansen
2018-05-16 15:23                 ` Jon Masters
2018-05-09 21:04         ` Linus Torvalds

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='=?utf-8?q?=3C8de240e7d1e070bf12e1614443782815d514a6c5=2E152573?= =?utf-8?q?4796=2Egit=2Edave=2Ehansen=40intel=2Ecom=3E?=' \
    --to=dave.hansen@intel.com \
    --cc=dave.hansen@linux.intel.com \
    --cc=speck@linutronix.de \
    /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: link
Be 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.