integ/kernel-rt/centos/patches/Add-missing-ifdef-around-max-latency-variable.patch
Jim Somerville 50a9ff6df4 Kernel Upgrades for Meltdown and Spectre
The kernel is moved ahead to version 3.10.0-693.21.1.el7

To summarize:

CVE-2017-5753 [bounds check bypass] aka 'Spectre Variant 1'
This is fixed by load fences and is "baked in" and cannot
be turned off.

CVE-2017-5715 [branch target injection] aka 'Spectre Variant 2'
This is fixed by a combination of retpolines and IBPB, or
IBRS+IBPB if on skylake.  This requires a microcode change in
the processors.  This feature, if on, has a significant performance
impact.  It is assumed on unless turned off via the
"nospectre_v2" bootarg.

CVE-2017-5754 [rogue data cache load] aka 'Meltdown' aka 'Variant 3'
This is fixed by page table isolation using the Kaiser patches.
This feature is assumed on unless turned off via the
"nopti" bootarg.

As of the commit date, we have changed the installer kickstarts
to issue both "nopti nospectre_v2" bootargs to minimize realtime
impacts by default.  The customer will be able to optionally
sacrifice performance for extra security at datafill time.

Change-Id: Id7c99923f2ee2ee91f77c7bd9940e684eff8b476
Signed-off-by: Jim Somerville <Jim.Somerville@windriver.com>
2018-06-22 12:53:11 -04:00

53 lines
1.6 KiB
Diff

From d871c73e670cdf54cbb396806273302bebd9da6e Mon Sep 17 00:00:00 2001
Message-Id: <d871c73e670cdf54cbb396806273302bebd9da6e.1522795097.git.Jim.Somerville@windriver.com>
In-Reply-To: <21c11de06542297206c798b405b54a3ec9052aa4.1522795097.git.Jim.Somerville@windriver.com>
References: <21c11de06542297206c798b405b54a3ec9052aa4.1522795097.git.Jim.Somerville@windriver.com>
From: Jim Somerville <Jim.Somerville@windriver.com>
Date: Thu, 22 Dec 2016 17:54:11 -0500
Subject: [PATCH 14/33] Add missing ifdef around max latency variable
Signed-off-by: Jim Somerville <Jim.Somerville@windriver.com>
---
kernel/trace/trace_hwlat.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/kernel/trace/trace_hwlat.c b/kernel/trace/trace_hwlat.c
index 4b30d8b..1bb578c 100644
--- a/kernel/trace/trace_hwlat.c
+++ b/kernel/trace/trace_hwlat.c
@@ -167,7 +167,9 @@ void trace_hwlat_callback(bool enter)
*/
static int get_sample(void)
{
+#ifdef CONFIG_TRACER_MAX_TRACE
struct trace_array *tr = hwlat_trace;
+#endif
time_type start, t1, t2, last_t2;
s64 diff, total, last_total = 0;
u64 sample = 0;
@@ -254,9 +256,11 @@ static int get_sample(void)
s.nmi_count = nmi_count;
trace_hwlat_sample(&s);
+#ifdef CONFIG_TRACER_MAX_TRACE
/* Keep a running maximum ever recorded hardware latency */
if (sample > tr->max_latency)
tr->max_latency = sample;
+#endif
}
out:
@@ -582,7 +586,9 @@ static int hwlat_tracer_init(struct trace_array *tr)
disable_migrate = false;
hwlat_data.count = 0;
+#ifdef CONFIG_TRACER_MAX_TRACE
tr->max_latency = 0;
+#endif
save_tracing_thresh = tracing_thresh;
/* tracing_thresh is in nsecs, we speak in usecs */
--
1.8.3.1