Blame SOURCES/rh1566890_embargoed20180521.patch

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