Blame SOURCES/rh1566890_embargoed20180521.patch

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