summaryrefslogtreecommitdiffstats
path: root/0001-Add-support-for-deprecating-processors.patch
blob: 189a971566154af6b8163a401b697351ed6b9c8e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Laura Abbott <labbott@redhat.com>
Date: Wed, 13 Nov 2019 14:44:30 -0500
Subject: [PATCH] Add support for deprecating processors

Message-id: <20191113144431.9403-4-labbott@redhat.com>
Patchwork-id: 286081
O-Subject: [ARK INTERNAL PATCHv2 3/4] [redhat] Add support for deprecating processors
Bugzilla:
RH-Acked-by: Don Zickus <dzickus@redhat.com>
RH-Acked-by: Prarit Bhargava <prarit@redhat.com>
RH-Acked-by: Jiri Benc <jbenc@redhat.com>

This is the squashed version of the following patches
modifed to use the new CONFIG_RH_DISABLE_DEPRECATED option

add rh_check_supported

Message-id: <1525313397-75200-1-git-send-email-darcari@redhat.com>
Patchwork-id: 212189
O-Subject: [RHEL8.0 BZ 1565717 v2] x86: add rh_check_supported
Bugzilla: 1565717
RH-Acked-by: Steve Best <sbest@redhat.com>
RH-Acked-by: Mikulas Patocka <mpatocka@redhat.com>

Description:

Add code to verify that the booted x86 processor is supported by
Red Hat.  In cases where the processor is not supported a critical
message is logged.

Initially the supported set of processors for RHEL8 remains the same
as RHEL7.

Bugzilla: http://bugzilla.redhat.com/1565717
Brew: https://brewweb.devel.redhat.com/taskinfo?taskID=15966242

Test: Booted brew build on supported (Haswell) and unsupported processor (CNL)
      and achieved desired results.

Upstream: RHEL Only

Cc: David Arcari <darcari@redhat.com>
Cc: Mikulas Patocka <mpatocka@redhat.com>
Cc: Dave Young <dyoung@redhat.com>
Cc: Josh Poimboeuf <jpoimboe@redhat.com>
Signed-off-by: Herton R. Krzesinski <herton@redhat.com>

update rh_check_supported processor list

Message-id: <1530618602-17477-1-git-send-email-darcari@redhat.com>
Patchwork-id: 223452
O-Subject: [RHEL8.0 BZ 1595918] x86: update rh_check_supported processor list
Bugzilla: 1595918
RH-Acked-by: Jarod Wilson <jarod@redhat.com>
RH-Acked-by: Prarit Bhargava <prarit@redhat.com>
RH-Acked-by: Steve Best <sbest@redhat.com>

Bugzilla: http://bugzilla.redhat.com/1595918
Upstream Status: RHEL_only
Build Info: https://brewweb.engineering.redhat.com/brew/taskinfo?taskID=16916208
Tested: Verified on a varity of supported and unsupported Intel and AMD systems.
	Results as expected.

In RHEL8, we are marking some of the older processors as unsupported. No code
is being removed; however, the older processors are not supported and as such
are not candidates for certification.

Cc: David Arcari <darcari@redhat.com>
Cc: Prarit Bhargava <prarit@redhat.com>
Cc: Steve Best <sbest@redhat.com>
Signed-off-by: Herton R. Krzesinski <herton@redhat.com>
Signed-off-by: Jakub Racek <jracek@redhat.com>
refresh: rename FAM6_ATOM again, see f2c4db1bd

mark whiskey-lake processor supported

Message-id: <1533125629-12870-1-git-send-email-darcari@redhat.com>
Patchwork-id: 225809
O-Subject: [ BZ 1609604] mark whiskey-lake processor supported
Bugzilla: 1609604
RH-Acked-by: Steve Best <sbest@redhat.com>
RH-Acked-by: Tony Camuso <tcamuso@redhat.com>
RH-Acked-by: Prarit Bhargava <prarit@redhat.com>

Bugzilla: http://bugzilla.redhat.com/1609604
Build Info: https://brewweb.devel.redhat.com/taskinfo?taskID=17474338
Upstream Status: RHEL Only
Tested: Successful excecution of platform-test suite.

Whiskey Lake is cpu model 142 with stepping 11.  Stepping > 11 for cpu model
142 is not supported.

For model 158, the highest supported stepping is 10.

Cc: Prarit Bhargava <prarit@redhat.com>
Cc: David Arcari <darcari@redhat.com>
Cc: Dave Young <dyoung@redhat.com>
Signed-off-by: Herton R. Krzesinski <herton@redhat.com>

mark intel knights landing and knights mill unsupported

Message-id: <1533580277-126323-1-git-send-email-darcari@redhat.com>
Patchwork-id: 226187
O-Subject: [RHEL8.0 BZ 1610493] mark intel knights landing and knights mill unsupported
Bugzilla: 1610493
RH-Acked-by: Tony Camuso <tcamuso@redhat.com>
RH-Acked-by: Prarit Bhargava <prarit@redhat.com>
RH-Acked-by: Steve Best <sbest@redhat.com>

Bugzilla: http://bugzilla.redhat.com/1610493
Build Info: https://brewweb.engineering.redhat.com/brew/taskinfo?taskID=17625348

Tested: verified on KNL/KNM system
Upstream Status: RHEL Only
Depends: http://bugzilla.redhat.com/1609604

We are marking KNL/KNM processors as unsupported. No code is being removed;
however, the older processors are not supported and as such are not
candidates for certification.

Upstream Status: RHEL only
Cc: Prarit Bhargava <prarit@redhat.com>
Cc: David Arcari <darcari@redhat.com>
Cc: Dave Young <dyoung@redhat.com>
Signed-off-by: Herton R. Krzesinski <herton@redhat.com>
---
 arch/x86/kernel/cpu/common.c |   1 +
 arch/x86/kernel/setup.c      | 132 ++++++++++++++++++++++++++++++++++-
 2 files changed, 132 insertions(+), 1 deletion(-)

diff --git a/arch/x86/kernel/cpu/common.c b/arch/x86/kernel/cpu/common.c
index 95c090a45b4b..bcc6d2df56c0 100644
--- a/arch/x86/kernel/cpu/common.c
+++ b/arch/x86/kernel/cpu/common.c
@@ -1236,6 +1236,7 @@ static void __init early_identify_cpu(struct cpuinfo_x86 *c)
 		cpu_detect(c);
 		get_cpu_vendor(c);
 		get_cpu_cap(c);
+		get_model_name(c); /* RHEL: get model name for unsupported check */
 		get_cpu_address_sizes(c);
 		setup_force_cpu_cap(X86_FEATURE_CPUID);

diff --git a/arch/x86/kernel/setup.c b/arch/x86/kernel/setup.c
index a3767e74c758..a1b8cb9a2579 100644
--- a/arch/x86/kernel/setup.c
+++ b/arch/x86/kernel/setup.c
@@ -44,6 +44,7 @@
 #include <asm/unwind.h>
 #include <asm/vsyscall.h>
 #include <linux/vmalloc.h>
+#include <asm/intel-family.h>

 /*
  * max_low_pfn_mapped: highest directly mapped pfn < 4 GB
@@ -753,7 +754,132 @@ static void __init trim_low_memory_range(void)
 {
 	memblock_reserve(0, ALIGN(reserve_low, PAGE_SIZE));
 }
-	
+
+static bool valid_amd_processor(__u8 family, const char *model_id)
+{
+	bool valid;
+
+	switch(family) {
+	case 0x15:
+		valid = true;
+		break;
+
+	case 0x17:
+		valid = strstr(model_id, "AMD EPYC 7");
+		break;
+
+	default:
+		valid = false;
+		break;
+	}
+
+	return valid;
+}
+
+static bool valid_intel_processor(__u8 family, __u8 model, __u8 stepping)
+{
+	bool valid;
+
+	if (family != 6)
+		return false;
+
+	switch(model) {
+	case INTEL_FAM6_ATOM_GOLDMONT_D:
+	case INTEL_FAM6_ATOM_GOLDMONT_PLUS:
+
+	case INTEL_FAM6_BROADWELL:
+	case INTEL_FAM6_BROADWELL_G:
+	case INTEL_FAM6_BROADWELL_X:
+	case INTEL_FAM6_BROADWELL_D:
+
+	case INTEL_FAM6_HASWELL:
+	case INTEL_FAM6_HASWELL_G:
+	case INTEL_FAM6_HASWELL_L:
+	case INTEL_FAM6_HASWELL_X:
+		valid = true;
+		break;
+
+	case INTEL_FAM6_KABYLAKE:
+		valid = (stepping <= 10);
+		break;
+
+	case INTEL_FAM6_KABYLAKE_L:
+		valid = (stepping <= 11);
+		break;
+
+	case INTEL_FAM6_SKYLAKE_L:
+	case INTEL_FAM6_SKYLAKE:
+	case INTEL_FAM6_SKYLAKE_X:
+		/* stepping > 4 is Cascade Lake and is not supported */
+		valid = (stepping <= 4);
+		break;
+
+	default:
+		valid = false;
+		break;
+	}
+
+	return valid;
+}
+
+static void rh_check_supported(void)
+{
+	bool guest;
+
+	guest = (x86_hyper_type != X86_HYPER_NATIVE || boot_cpu_has(X86_FEATURE_HYPERVISOR));
+
+	/* RHEL supports single cpu on guests only */
+	if (((boot_cpu_data.x86_max_cores * smp_num_siblings) == 1) &&
+	    !guest && is_kdump_kernel()) {
+		pr_crit("Detected single cpu native boot.\n");
+		pr_crit("Important:  In this kernel, single threaded, single CPU 64-bit physical systems are unsupported.");
+	}
+
+	/*
+	 * If the RHEL kernel does not support this hardware, the kernel will
+	 * attempt to boot, but no support is provided for this hardware
+	 */
+	switch (boot_cpu_data.x86_vendor) {
+	case X86_VENDOR_AMD:
+		if (!valid_amd_processor(boot_cpu_data.x86,
+					 boot_cpu_data.x86_model_id)) {
+			pr_crit("Detected CPU family %xh model %d\n",
+				boot_cpu_data.x86,
+				boot_cpu_data.x86_model);
+			mark_hardware_unsupported("AMD Processor");
+		}
+		break;
+
+	case X86_VENDOR_INTEL:
+		if (!valid_intel_processor(boot_cpu_data.x86,
+					   boot_cpu_data.x86_model,
+					   boot_cpu_data.x86_stepping)) {
+			pr_crit("Detected CPU family %d model %d stepping %d\n",
+				boot_cpu_data.x86,
+				boot_cpu_data.x86_model,
+				boot_cpu_data.x86_stepping);
+			mark_hardware_unsupported("Intel Processor");
+		}
+		break;
+
+	default:
+		pr_crit("Detected processor %s %s\n",
+			boot_cpu_data.x86_vendor_id,
+			boot_cpu_data.x86_model_id);
+		mark_hardware_unsupported("Processor");
+		break;
+	}
+
+	/*
+	 * Due to the complexity of x86 lapic & ioapic enumeration, and PCI IRQ
+	 * routing, ACPI is required for x86.  acpi=off is a valid debug kernel
+	 * parameter, so just print out a loud warning in case something
+	 * goes wrong (which is most of the time).
+	 */
+	if (acpi_disabled && !guest)
+		pr_crit("ACPI has been disabled or is not available on this hardware.  This may result in a single cpu boot, incorrect PCI IRQ routing, or boot failure.\n");
+}
+
 /*
  * Dump out kernel offset information on panic.
  */
@@ -1250,6 +1376,10 @@ void __init setup_arch(char **cmdline_p)
 		efi_apply_memmap_quirks();
 #endif

+#ifdef CONFIG_RH_DISABLE_DEPRECATED
+	rh_check_supported();
+#endif
+
 	unwind_init();
 }

-- 
2.26.2