Blame SOURCES/rh1566890_embargoed20180521.patch

6b07ba
# ssbd2.patch
6b07ba
--- ./openjdk/hotspot/src/os/linux/vm/os_linux.cpp~	2018-05-02 13:02:51.924489199 -0400
6b07ba
+++ ./openjdk/hotspot/src/os/linux/vm/os_linux.cpp	2018-05-02 13:04:57.274216581 -0400
6b07ba
@@ -125,6 +125,8 @@
6b07ba
 # include <inttypes.h>
6b07ba
 # include <sys/ioctl.h>
6b07ba
 
6b07ba
+#include <sys/prctl.h>
6b07ba
+
6b07ba
 #ifndef _GNU_SOURCE
6b07ba
   #define _GNU_SOURCE
6b07ba
   #include <sched.h>
6b07ba
@@ -4892,6 +4894,31 @@
6b07ba
   }
6b07ba
 }
6b07ba
 
6b07ba
+/* Per task speculation control */
6b07ba
+#ifndef PR_GET_SPECULATION_CTRL
6b07ba
+#define PR_GET_SPECULATION_CTRL    52
6b07ba
+#endif
6b07ba
+#ifndef PR_SET_SPECULATION_CTRL
6b07ba
+#define PR_SET_SPECULATION_CTRL    53
6b07ba
+#endif
6b07ba
+/* Speculation control variants */
6b07ba
+# undef PR_SPEC_STORE_BYPASS
6b07ba
+# define PR_SPEC_STORE_BYPASS          0
6b07ba
+/* Return and control values for PR_SET/GET_SPECULATION_CTRL */
6b07ba
+# undef PR_SPEC_NOT_AFFECTED
6b07ba
+# undef PR_SPEC_PRCTL
6b07ba
+# undef PR_SPEC_ENABLE
6b07ba
+# undef PR_SPEC_DISABLE
6b07ba
+# define PR_SPEC_NOT_AFFECTED          0
6b07ba
+# define PR_SPEC_PRCTL                 (1UL << 0)
6b07ba
+# define PR_SPEC_ENABLE                (1UL << 1)
6b07ba
+# define PR_SPEC_DISABLE               (1UL << 2)
6b07ba
+
6b07ba
+static void set_speculation() __attribute__((constructor));
6b07ba
+static void set_speculation() {
6b07ba
+  prctl(PR_SET_SPECULATION_CTRL, PR_SPEC_STORE_BYPASS, PR_SPEC_DISABLE, 0, 0);
6b07ba
+}
6b07ba
+
6b07ba
 // this is called _before_ the most of global arguments have been parsed
6b07ba
 void os::init(void) {
6b07ba
   char dummy;   /* used to get a guess on initial stack address */