Blame SOURCES/rh1566890_embargoed20180521.patch

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