intel.c 30 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036
  1. // SPDX-License-Identifier: GPL-2.0
  2. #include <linux/kernel.h>
  3. #include <linux/string.h>
  4. #include <linux/bitops.h>
  5. #include <linux/smp.h>
  6. #include <linux/sched.h>
  7. #include <linux/sched/clock.h>
  8. #include <linux/thread_info.h>
  9. #include <linux/init.h>
  10. #include <linux/uaccess.h>
  11. #include <asm/cpufeature.h>
  12. #include <asm/pgtable.h>
  13. #include <asm/msr.h>
  14. #include <asm/bugs.h>
  15. #include <asm/cpu.h>
  16. #include <asm/intel-family.h>
  17. #include <asm/microcode_intel.h>
  18. #include <asm/hwcap2.h>
  19. #include <asm/elf.h>
  20. #ifdef CONFIG_X86_64
  21. #include <linux/topology.h>
  22. #endif
  23. #include "cpu.h"
  24. #ifdef CONFIG_X86_LOCAL_APIC
  25. #include <asm/mpspec.h>
  26. #include <asm/apic.h>
  27. #endif
  28. /*
  29. * Just in case our CPU detection goes bad, or you have a weird system,
  30. * allow a way to override the automatic disabling of MPX.
  31. */
  32. static int forcempx;
  33. static int __init forcempx_setup(char *__unused)
  34. {
  35. forcempx = 1;
  36. return 1;
  37. }
  38. __setup("intel-skd-046-workaround=disable", forcempx_setup);
  39. void check_mpx_erratum(struct cpuinfo_x86 *c)
  40. {
  41. if (forcempx)
  42. return;
  43. /*
  44. * Turn off the MPX feature on CPUs where SMEP is not
  45. * available or disabled.
  46. *
  47. * Works around Intel Erratum SKD046: "Branch Instructions
  48. * May Initialize MPX Bound Registers Incorrectly".
  49. *
  50. * This might falsely disable MPX on systems without
  51. * SMEP, like Atom processors without SMEP. But there
  52. * is no such hardware known at the moment.
  53. */
  54. if (cpu_has(c, X86_FEATURE_MPX) && !cpu_has(c, X86_FEATURE_SMEP)) {
  55. setup_clear_cpu_cap(X86_FEATURE_MPX);
  56. pr_warn("x86/mpx: Disabling MPX since SMEP not present\n");
  57. }
  58. }
  59. static bool ring3mwait_disabled __read_mostly;
  60. static int __init ring3mwait_disable(char *__unused)
  61. {
  62. ring3mwait_disabled = true;
  63. return 0;
  64. }
  65. __setup("ring3mwait=disable", ring3mwait_disable);
  66. static void probe_xeon_phi_r3mwait(struct cpuinfo_x86 *c)
  67. {
  68. /*
  69. * Ring 3 MONITOR/MWAIT feature cannot be detected without
  70. * cpu model and family comparison.
  71. */
  72. if (c->x86 != 6)
  73. return;
  74. switch (c->x86_model) {
  75. case INTEL_FAM6_XEON_PHI_KNL:
  76. case INTEL_FAM6_XEON_PHI_KNM:
  77. break;
  78. default:
  79. return;
  80. }
  81. if (ring3mwait_disabled)
  82. return;
  83. set_cpu_cap(c, X86_FEATURE_RING3MWAIT);
  84. this_cpu_or(msr_misc_features_shadow,
  85. 1UL << MSR_MISC_FEATURES_ENABLES_RING3MWAIT_BIT);
  86. if (c == &boot_cpu_data)
  87. ELF_HWCAP2 |= HWCAP2_RING3MWAIT;
  88. }
  89. /*
  90. * Early microcode releases for the Spectre v2 mitigation were broken.
  91. * Information taken from;
  92. * - https://newsroom.intel.com/wp-content/uploads/sites/11/2018/03/microcode-update-guidance.pdf
  93. * - https://kb.vmware.com/s/article/52345
  94. * - Microcode revisions observed in the wild
  95. * - Release note from 20180108 microcode release
  96. */
  97. struct sku_microcode {
  98. u8 model;
  99. u8 stepping;
  100. u32 microcode;
  101. };
  102. static const struct sku_microcode spectre_bad_microcodes[] = {
  103. { INTEL_FAM6_KABYLAKE_DESKTOP, 0x0B, 0x80 },
  104. { INTEL_FAM6_KABYLAKE_DESKTOP, 0x0A, 0x80 },
  105. { INTEL_FAM6_KABYLAKE_DESKTOP, 0x09, 0x80 },
  106. { INTEL_FAM6_KABYLAKE_MOBILE, 0x0A, 0x80 },
  107. { INTEL_FAM6_KABYLAKE_MOBILE, 0x09, 0x80 },
  108. { INTEL_FAM6_SKYLAKE_X, 0x03, 0x0100013e },
  109. { INTEL_FAM6_SKYLAKE_X, 0x04, 0x0200003c },
  110. { INTEL_FAM6_BROADWELL_CORE, 0x04, 0x28 },
  111. { INTEL_FAM6_BROADWELL_GT3E, 0x01, 0x1b },
  112. { INTEL_FAM6_BROADWELL_XEON_D, 0x02, 0x14 },
  113. { INTEL_FAM6_BROADWELL_XEON_D, 0x03, 0x07000011 },
  114. { INTEL_FAM6_BROADWELL_X, 0x01, 0x0b000025 },
  115. { INTEL_FAM6_HASWELL_ULT, 0x01, 0x21 },
  116. { INTEL_FAM6_HASWELL_GT3E, 0x01, 0x18 },
  117. { INTEL_FAM6_HASWELL_CORE, 0x03, 0x23 },
  118. { INTEL_FAM6_HASWELL_X, 0x02, 0x3b },
  119. { INTEL_FAM6_HASWELL_X, 0x04, 0x10 },
  120. { INTEL_FAM6_IVYBRIDGE_X, 0x04, 0x42a },
  121. /* Observed in the wild */
  122. { INTEL_FAM6_SANDYBRIDGE_X, 0x06, 0x61b },
  123. { INTEL_FAM6_SANDYBRIDGE_X, 0x07, 0x712 },
  124. };
  125. static bool bad_spectre_microcode(struct cpuinfo_x86 *c)
  126. {
  127. int i;
  128. /*
  129. * We know that the hypervisor lie to us on the microcode version so
  130. * we may as well hope that it is running the correct version.
  131. */
  132. if (cpu_has(c, X86_FEATURE_HYPERVISOR))
  133. return false;
  134. if (c->x86 != 6)
  135. return false;
  136. for (i = 0; i < ARRAY_SIZE(spectre_bad_microcodes); i++) {
  137. if (c->x86_model == spectre_bad_microcodes[i].model &&
  138. c->x86_stepping == spectre_bad_microcodes[i].stepping)
  139. return (c->microcode <= spectre_bad_microcodes[i].microcode);
  140. }
  141. return false;
  142. }
  143. static void early_init_intel(struct cpuinfo_x86 *c)
  144. {
  145. u64 misc_enable;
  146. /* Unmask CPUID levels if masked: */
  147. if (c->x86 > 6 || (c->x86 == 6 && c->x86_model >= 0xd)) {
  148. if (msr_clear_bit(MSR_IA32_MISC_ENABLE,
  149. MSR_IA32_MISC_ENABLE_LIMIT_CPUID_BIT) > 0) {
  150. c->cpuid_level = cpuid_eax(0);
  151. get_cpu_cap(c);
  152. }
  153. }
  154. if ((c->x86 == 0xf && c->x86_model >= 0x03) ||
  155. (c->x86 == 0x6 && c->x86_model >= 0x0e))
  156. set_cpu_cap(c, X86_FEATURE_CONSTANT_TSC);
  157. if (c->x86 >= 6 && !cpu_has(c, X86_FEATURE_IA64))
  158. c->microcode = intel_get_microcode_revision();
  159. /* Now if any of them are set, check the blacklist and clear the lot */
  160. if ((cpu_has(c, X86_FEATURE_SPEC_CTRL) ||
  161. cpu_has(c, X86_FEATURE_INTEL_STIBP) ||
  162. cpu_has(c, X86_FEATURE_IBRS) || cpu_has(c, X86_FEATURE_IBPB) ||
  163. cpu_has(c, X86_FEATURE_STIBP)) && bad_spectre_microcode(c)) {
  164. pr_warn("Intel Spectre v2 broken microcode detected; disabling Speculation Control\n");
  165. setup_clear_cpu_cap(X86_FEATURE_IBRS);
  166. setup_clear_cpu_cap(X86_FEATURE_IBPB);
  167. setup_clear_cpu_cap(X86_FEATURE_STIBP);
  168. setup_clear_cpu_cap(X86_FEATURE_SPEC_CTRL);
  169. setup_clear_cpu_cap(X86_FEATURE_MSR_SPEC_CTRL);
  170. setup_clear_cpu_cap(X86_FEATURE_INTEL_STIBP);
  171. setup_clear_cpu_cap(X86_FEATURE_SSBD);
  172. setup_clear_cpu_cap(X86_FEATURE_SPEC_CTRL_SSBD);
  173. }
  174. /*
  175. * Atom erratum AAE44/AAF40/AAG38/AAH41:
  176. *
  177. * A race condition between speculative fetches and invalidating
  178. * a large page. This is worked around in microcode, but we
  179. * need the microcode to have already been loaded... so if it is
  180. * not, recommend a BIOS update and disable large pages.
  181. */
  182. if (c->x86 == 6 && c->x86_model == 0x1c && c->x86_stepping <= 2 &&
  183. c->microcode < 0x20e) {
  184. pr_warn("Atom PSE erratum detected, BIOS microcode update recommended\n");
  185. clear_cpu_cap(c, X86_FEATURE_PSE);
  186. }
  187. #ifdef CONFIG_X86_64
  188. set_cpu_cap(c, X86_FEATURE_SYSENTER32);
  189. #else
  190. /* Netburst reports 64 bytes clflush size, but does IO in 128 bytes */
  191. if (c->x86 == 15 && c->x86_cache_alignment == 64)
  192. c->x86_cache_alignment = 128;
  193. #endif
  194. /* CPUID workaround for 0F33/0F34 CPU */
  195. if (c->x86 == 0xF && c->x86_model == 0x3
  196. && (c->x86_stepping == 0x3 || c->x86_stepping == 0x4))
  197. c->x86_phys_bits = 36;
  198. /*
  199. * c->x86_power is 8000_0007 edx. Bit 8 is TSC runs at constant rate
  200. * with P/T states and does not stop in deep C-states.
  201. *
  202. * It is also reliable across cores and sockets. (but not across
  203. * cabinets - we turn it off in that case explicitly.)
  204. */
  205. if (c->x86_power & (1 << 8)) {
  206. set_cpu_cap(c, X86_FEATURE_CONSTANT_TSC);
  207. set_cpu_cap(c, X86_FEATURE_NONSTOP_TSC);
  208. }
  209. /* Penwell and Cloverview have the TSC which doesn't sleep on S3 */
  210. if (c->x86 == 6) {
  211. switch (c->x86_model) {
  212. case 0x27: /* Penwell */
  213. case 0x35: /* Cloverview */
  214. case 0x4a: /* Merrifield */
  215. set_cpu_cap(c, X86_FEATURE_NONSTOP_TSC_S3);
  216. break;
  217. default:
  218. break;
  219. }
  220. }
  221. /*
  222. * There is a known erratum on Pentium III and Core Solo
  223. * and Core Duo CPUs.
  224. * " Page with PAT set to WC while associated MTRR is UC
  225. * may consolidate to UC "
  226. * Because of this erratum, it is better to stick with
  227. * setting WC in MTRR rather than using PAT on these CPUs.
  228. *
  229. * Enable PAT WC only on P4, Core 2 or later CPUs.
  230. */
  231. if (c->x86 == 6 && c->x86_model < 15)
  232. clear_cpu_cap(c, X86_FEATURE_PAT);
  233. /*
  234. * If fast string is not enabled in IA32_MISC_ENABLE for any reason,
  235. * clear the fast string and enhanced fast string CPU capabilities.
  236. */
  237. if (c->x86 > 6 || (c->x86 == 6 && c->x86_model >= 0xd)) {
  238. rdmsrl(MSR_IA32_MISC_ENABLE, misc_enable);
  239. if (!(misc_enable & MSR_IA32_MISC_ENABLE_FAST_STRING)) {
  240. pr_info("Disabled fast string operations\n");
  241. setup_clear_cpu_cap(X86_FEATURE_REP_GOOD);
  242. setup_clear_cpu_cap(X86_FEATURE_ERMS);
  243. }
  244. }
  245. /*
  246. * Intel Quark Core DevMan_001.pdf section 6.4.11
  247. * "The operating system also is required to invalidate (i.e., flush)
  248. * the TLB when any changes are made to any of the page table entries.
  249. * The operating system must reload CR3 to cause the TLB to be flushed"
  250. *
  251. * As a result, boot_cpu_has(X86_FEATURE_PGE) in arch/x86/include/asm/tlbflush.h
  252. * should be false so that __flush_tlb_all() causes CR3 insted of CR4.PGE
  253. * to be modified.
  254. */
  255. if (c->x86 == 5 && c->x86_model == 9) {
  256. pr_info("Disabling PGE capability bit\n");
  257. setup_clear_cpu_cap(X86_FEATURE_PGE);
  258. }
  259. if (c->cpuid_level >= 0x00000001) {
  260. u32 eax, ebx, ecx, edx;
  261. cpuid(0x00000001, &eax, &ebx, &ecx, &edx);
  262. /*
  263. * If HTT (EDX[28]) is set EBX[16:23] contain the number of
  264. * apicids which are reserved per package. Store the resulting
  265. * shift value for the package management code.
  266. */
  267. if (edx & (1U << 28))
  268. c->x86_coreid_bits = get_count_order((ebx >> 16) & 0xff);
  269. }
  270. check_mpx_erratum(c);
  271. /*
  272. * Get the number of SMT siblings early from the extended topology
  273. * leaf, if available. Otherwise try the legacy SMT detection.
  274. */
  275. if (detect_extended_topology_early(c) < 0)
  276. detect_ht_early(c);
  277. }
  278. #ifdef CONFIG_X86_32
  279. /*
  280. * Early probe support logic for ppro memory erratum #50
  281. *
  282. * This is called before we do cpu ident work
  283. */
  284. int ppro_with_ram_bug(void)
  285. {
  286. /* Uses data from early_cpu_detect now */
  287. if (boot_cpu_data.x86_vendor == X86_VENDOR_INTEL &&
  288. boot_cpu_data.x86 == 6 &&
  289. boot_cpu_data.x86_model == 1 &&
  290. boot_cpu_data.x86_stepping < 8) {
  291. pr_info("Pentium Pro with Errata#50 detected. Taking evasive action.\n");
  292. return 1;
  293. }
  294. return 0;
  295. }
  296. static void intel_smp_check(struct cpuinfo_x86 *c)
  297. {
  298. /* calling is from identify_secondary_cpu() ? */
  299. if (!c->cpu_index)
  300. return;
  301. /*
  302. * Mask B, Pentium, but not Pentium MMX
  303. */
  304. if (c->x86 == 5 &&
  305. c->x86_stepping >= 1 && c->x86_stepping <= 4 &&
  306. c->x86_model <= 3) {
  307. /*
  308. * Remember we have B step Pentia with bugs
  309. */
  310. WARN_ONCE(1, "WARNING: SMP operation may be unreliable"
  311. "with B stepping processors.\n");
  312. }
  313. }
  314. static int forcepae;
  315. static int __init forcepae_setup(char *__unused)
  316. {
  317. forcepae = 1;
  318. return 1;
  319. }
  320. __setup("forcepae", forcepae_setup);
  321. static void intel_workarounds(struct cpuinfo_x86 *c)
  322. {
  323. #ifdef CONFIG_X86_F00F_BUG
  324. /*
  325. * All models of Pentium and Pentium with MMX technology CPUs
  326. * have the F0 0F bug, which lets nonprivileged users lock up the
  327. * system. Announce that the fault handler will be checking for it.
  328. * The Quark is also family 5, but does not have the same bug.
  329. */
  330. clear_cpu_bug(c, X86_BUG_F00F);
  331. if (c->x86 == 5 && c->x86_model < 9) {
  332. static int f00f_workaround_enabled;
  333. set_cpu_bug(c, X86_BUG_F00F);
  334. if (!f00f_workaround_enabled) {
  335. pr_notice("Intel Pentium with F0 0F bug - workaround enabled.\n");
  336. f00f_workaround_enabled = 1;
  337. }
  338. }
  339. #endif
  340. /*
  341. * SEP CPUID bug: Pentium Pro reports SEP but doesn't have it until
  342. * model 3 mask 3
  343. */
  344. if ((c->x86<<8 | c->x86_model<<4 | c->x86_stepping) < 0x633)
  345. clear_cpu_cap(c, X86_FEATURE_SEP);
  346. /*
  347. * PAE CPUID issue: many Pentium M report no PAE but may have a
  348. * functionally usable PAE implementation.
  349. * Forcefully enable PAE if kernel parameter "forcepae" is present.
  350. */
  351. if (forcepae) {
  352. pr_warn("PAE forced!\n");
  353. set_cpu_cap(c, X86_FEATURE_PAE);
  354. add_taint(TAINT_CPU_OUT_OF_SPEC, LOCKDEP_NOW_UNRELIABLE);
  355. }
  356. /*
  357. * P4 Xeon erratum 037 workaround.
  358. * Hardware prefetcher may cause stale data to be loaded into the cache.
  359. */
  360. if ((c->x86 == 15) && (c->x86_model == 1) && (c->x86_stepping == 1)) {
  361. if (msr_set_bit(MSR_IA32_MISC_ENABLE,
  362. MSR_IA32_MISC_ENABLE_PREFETCH_DISABLE_BIT) > 0) {
  363. pr_info("CPU: C0 stepping P4 Xeon detected.\n");
  364. pr_info("CPU: Disabling hardware prefetching (Erratum 037)\n");
  365. }
  366. }
  367. /*
  368. * See if we have a good local APIC by checking for buggy Pentia,
  369. * i.e. all B steppings and the C2 stepping of P54C when using their
  370. * integrated APIC (see 11AP erratum in "Pentium Processor
  371. * Specification Update").
  372. */
  373. if (boot_cpu_has(X86_FEATURE_APIC) && (c->x86<<8 | c->x86_model<<4) == 0x520 &&
  374. (c->x86_stepping < 0x6 || c->x86_stepping == 0xb))
  375. set_cpu_bug(c, X86_BUG_11AP);
  376. #ifdef CONFIG_X86_INTEL_USERCOPY
  377. /*
  378. * Set up the preferred alignment for movsl bulk memory moves
  379. */
  380. switch (c->x86) {
  381. case 4: /* 486: untested */
  382. break;
  383. case 5: /* Old Pentia: untested */
  384. break;
  385. case 6: /* PII/PIII only like movsl with 8-byte alignment */
  386. movsl_mask.mask = 7;
  387. break;
  388. case 15: /* P4 is OK down to 8-byte alignment */
  389. movsl_mask.mask = 7;
  390. break;
  391. }
  392. #endif
  393. intel_smp_check(c);
  394. }
  395. #else
  396. static void intel_workarounds(struct cpuinfo_x86 *c)
  397. {
  398. }
  399. #endif
  400. static void srat_detect_node(struct cpuinfo_x86 *c)
  401. {
  402. #ifdef CONFIG_NUMA
  403. unsigned node;
  404. int cpu = smp_processor_id();
  405. /* Don't do the funky fallback heuristics the AMD version employs
  406. for now. */
  407. node = numa_cpu_node(cpu);
  408. if (node == NUMA_NO_NODE || !node_online(node)) {
  409. /* reuse the value from init_cpu_to_node() */
  410. node = cpu_to_node(cpu);
  411. }
  412. numa_set_node(cpu, node);
  413. #endif
  414. }
  415. static void detect_vmx_virtcap(struct cpuinfo_x86 *c)
  416. {
  417. /* Intel VMX MSR indicated features */
  418. #define X86_VMX_FEATURE_PROC_CTLS_TPR_SHADOW 0x00200000
  419. #define X86_VMX_FEATURE_PROC_CTLS_VNMI 0x00400000
  420. #define X86_VMX_FEATURE_PROC_CTLS_2ND_CTLS 0x80000000
  421. #define X86_VMX_FEATURE_PROC_CTLS2_VIRT_APIC 0x00000001
  422. #define X86_VMX_FEATURE_PROC_CTLS2_EPT 0x00000002
  423. #define X86_VMX_FEATURE_PROC_CTLS2_VPID 0x00000020
  424. #define x86_VMX_FEATURE_EPT_CAP_AD 0x00200000
  425. u32 vmx_msr_low, vmx_msr_high, msr_ctl, msr_ctl2;
  426. u32 msr_vpid_cap, msr_ept_cap;
  427. clear_cpu_cap(c, X86_FEATURE_TPR_SHADOW);
  428. clear_cpu_cap(c, X86_FEATURE_VNMI);
  429. clear_cpu_cap(c, X86_FEATURE_FLEXPRIORITY);
  430. clear_cpu_cap(c, X86_FEATURE_EPT);
  431. clear_cpu_cap(c, X86_FEATURE_VPID);
  432. clear_cpu_cap(c, X86_FEATURE_EPT_AD);
  433. rdmsr(MSR_IA32_VMX_PROCBASED_CTLS, vmx_msr_low, vmx_msr_high);
  434. msr_ctl = vmx_msr_high | vmx_msr_low;
  435. if (msr_ctl & X86_VMX_FEATURE_PROC_CTLS_TPR_SHADOW)
  436. set_cpu_cap(c, X86_FEATURE_TPR_SHADOW);
  437. if (msr_ctl & X86_VMX_FEATURE_PROC_CTLS_VNMI)
  438. set_cpu_cap(c, X86_FEATURE_VNMI);
  439. if (msr_ctl & X86_VMX_FEATURE_PROC_CTLS_2ND_CTLS) {
  440. rdmsr(MSR_IA32_VMX_PROCBASED_CTLS2,
  441. vmx_msr_low, vmx_msr_high);
  442. msr_ctl2 = vmx_msr_high | vmx_msr_low;
  443. if ((msr_ctl2 & X86_VMX_FEATURE_PROC_CTLS2_VIRT_APIC) &&
  444. (msr_ctl & X86_VMX_FEATURE_PROC_CTLS_TPR_SHADOW))
  445. set_cpu_cap(c, X86_FEATURE_FLEXPRIORITY);
  446. if (msr_ctl2 & X86_VMX_FEATURE_PROC_CTLS2_EPT) {
  447. set_cpu_cap(c, X86_FEATURE_EPT);
  448. rdmsr(MSR_IA32_VMX_EPT_VPID_CAP,
  449. msr_ept_cap, msr_vpid_cap);
  450. if (msr_ept_cap & x86_VMX_FEATURE_EPT_CAP_AD)
  451. set_cpu_cap(c, X86_FEATURE_EPT_AD);
  452. }
  453. if (msr_ctl2 & X86_VMX_FEATURE_PROC_CTLS2_VPID)
  454. set_cpu_cap(c, X86_FEATURE_VPID);
  455. }
  456. }
  457. #define MSR_IA32_TME_ACTIVATE 0x982
  458. /* Helpers to access TME_ACTIVATE MSR */
  459. #define TME_ACTIVATE_LOCKED(x) (x & 0x1)
  460. #define TME_ACTIVATE_ENABLED(x) (x & 0x2)
  461. #define TME_ACTIVATE_POLICY(x) ((x >> 4) & 0xf) /* Bits 7:4 */
  462. #define TME_ACTIVATE_POLICY_AES_XTS_128 0
  463. #define TME_ACTIVATE_KEYID_BITS(x) ((x >> 32) & 0xf) /* Bits 35:32 */
  464. #define TME_ACTIVATE_CRYPTO_ALGS(x) ((x >> 48) & 0xffff) /* Bits 63:48 */
  465. #define TME_ACTIVATE_CRYPTO_AES_XTS_128 1
  466. /* Values for mktme_status (SW only construct) */
  467. #define MKTME_ENABLED 0
  468. #define MKTME_DISABLED 1
  469. #define MKTME_UNINITIALIZED 2
  470. static int mktme_status = MKTME_UNINITIALIZED;
  471. static void detect_tme(struct cpuinfo_x86 *c)
  472. {
  473. u64 tme_activate, tme_policy, tme_crypto_algs;
  474. int keyid_bits = 0, nr_keyids = 0;
  475. static u64 tme_activate_cpu0 = 0;
  476. rdmsrl(MSR_IA32_TME_ACTIVATE, tme_activate);
  477. if (mktme_status != MKTME_UNINITIALIZED) {
  478. if (tme_activate != tme_activate_cpu0) {
  479. /* Broken BIOS? */
  480. pr_err_once("x86/tme: configuration is inconsistent between CPUs\n");
  481. pr_err_once("x86/tme: MKTME is not usable\n");
  482. mktme_status = MKTME_DISABLED;
  483. /* Proceed. We may need to exclude bits from x86_phys_bits. */
  484. }
  485. } else {
  486. tme_activate_cpu0 = tme_activate;
  487. }
  488. if (!TME_ACTIVATE_LOCKED(tme_activate) || !TME_ACTIVATE_ENABLED(tme_activate)) {
  489. pr_info_once("x86/tme: not enabled by BIOS\n");
  490. mktme_status = MKTME_DISABLED;
  491. return;
  492. }
  493. if (mktme_status != MKTME_UNINITIALIZED)
  494. goto detect_keyid_bits;
  495. pr_info("x86/tme: enabled by BIOS\n");
  496. tme_policy = TME_ACTIVATE_POLICY(tme_activate);
  497. if (tme_policy != TME_ACTIVATE_POLICY_AES_XTS_128)
  498. pr_warn("x86/tme: Unknown policy is active: %#llx\n", tme_policy);
  499. tme_crypto_algs = TME_ACTIVATE_CRYPTO_ALGS(tme_activate);
  500. if (!(tme_crypto_algs & TME_ACTIVATE_CRYPTO_AES_XTS_128)) {
  501. pr_err("x86/mktme: No known encryption algorithm is supported: %#llx\n",
  502. tme_crypto_algs);
  503. mktme_status = MKTME_DISABLED;
  504. }
  505. detect_keyid_bits:
  506. keyid_bits = TME_ACTIVATE_KEYID_BITS(tme_activate);
  507. nr_keyids = (1UL << keyid_bits) - 1;
  508. if (nr_keyids) {
  509. pr_info_once("x86/mktme: enabled by BIOS\n");
  510. pr_info_once("x86/mktme: %d KeyIDs available\n", nr_keyids);
  511. } else {
  512. pr_info_once("x86/mktme: disabled by BIOS\n");
  513. }
  514. if (mktme_status == MKTME_UNINITIALIZED) {
  515. /* MKTME is usable */
  516. mktme_status = MKTME_ENABLED;
  517. }
  518. /*
  519. * KeyID bits effectively lower the number of physical address
  520. * bits. Update cpuinfo_x86::x86_phys_bits accordingly.
  521. */
  522. c->x86_phys_bits -= keyid_bits;
  523. }
  524. static void init_intel_energy_perf(struct cpuinfo_x86 *c)
  525. {
  526. u64 epb;
  527. /*
  528. * Initialize MSR_IA32_ENERGY_PERF_BIAS if not already initialized.
  529. * (x86_energy_perf_policy(8) is available to change it at run-time.)
  530. */
  531. if (!cpu_has(c, X86_FEATURE_EPB))
  532. return;
  533. rdmsrl(MSR_IA32_ENERGY_PERF_BIAS, epb);
  534. if ((epb & 0xF) != ENERGY_PERF_BIAS_PERFORMANCE)
  535. return;
  536. pr_warn_once("ENERGY_PERF_BIAS: Set to 'normal', was 'performance'\n");
  537. pr_warn_once("ENERGY_PERF_BIAS: View and update with x86_energy_perf_policy(8)\n");
  538. epb = (epb & ~0xF) | ENERGY_PERF_BIAS_NORMAL;
  539. wrmsrl(MSR_IA32_ENERGY_PERF_BIAS, epb);
  540. }
  541. static void intel_bsp_resume(struct cpuinfo_x86 *c)
  542. {
  543. /*
  544. * MSR_IA32_ENERGY_PERF_BIAS is lost across suspend/resume,
  545. * so reinitialize it properly like during bootup:
  546. */
  547. init_intel_energy_perf(c);
  548. }
  549. static void init_cpuid_fault(struct cpuinfo_x86 *c)
  550. {
  551. u64 msr;
  552. if (!rdmsrl_safe(MSR_PLATFORM_INFO, &msr)) {
  553. if (msr & MSR_PLATFORM_INFO_CPUID_FAULT)
  554. set_cpu_cap(c, X86_FEATURE_CPUID_FAULT);
  555. }
  556. }
  557. static void init_intel_misc_features(struct cpuinfo_x86 *c)
  558. {
  559. u64 msr;
  560. if (rdmsrl_safe(MSR_MISC_FEATURES_ENABLES, &msr))
  561. return;
  562. /* Clear all MISC features */
  563. this_cpu_write(msr_misc_features_shadow, 0);
  564. /* Check features and update capabilities and shadow control bits */
  565. init_cpuid_fault(c);
  566. probe_xeon_phi_r3mwait(c);
  567. msr = this_cpu_read(msr_misc_features_shadow);
  568. wrmsrl(MSR_MISC_FEATURES_ENABLES, msr);
  569. }
  570. static void init_intel(struct cpuinfo_x86 *c)
  571. {
  572. early_init_intel(c);
  573. intel_workarounds(c);
  574. /*
  575. * Detect the extended topology information if available. This
  576. * will reinitialise the initial_apicid which will be used
  577. * in init_intel_cacheinfo()
  578. */
  579. detect_extended_topology(c);
  580. if (!cpu_has(c, X86_FEATURE_XTOPOLOGY)) {
  581. /*
  582. * let's use the legacy cpuid vector 0x1 and 0x4 for topology
  583. * detection.
  584. */
  585. detect_num_cpu_cores(c);
  586. #ifdef CONFIG_X86_32
  587. detect_ht(c);
  588. #endif
  589. }
  590. init_intel_cacheinfo(c);
  591. if (c->cpuid_level > 9) {
  592. unsigned eax = cpuid_eax(10);
  593. /* Check for version and the number of counters */
  594. if ((eax & 0xff) && (((eax>>8) & 0xff) > 1))
  595. set_cpu_cap(c, X86_FEATURE_ARCH_PERFMON);
  596. }
  597. if (cpu_has(c, X86_FEATURE_XMM2))
  598. set_cpu_cap(c, X86_FEATURE_LFENCE_RDTSC);
  599. if (boot_cpu_has(X86_FEATURE_DS)) {
  600. unsigned int l1, l2;
  601. rdmsr(MSR_IA32_MISC_ENABLE, l1, l2);
  602. if (!(l1 & (1<<11)))
  603. set_cpu_cap(c, X86_FEATURE_BTS);
  604. if (!(l1 & (1<<12)))
  605. set_cpu_cap(c, X86_FEATURE_PEBS);
  606. }
  607. if (c->x86 == 6 && boot_cpu_has(X86_FEATURE_CLFLUSH) &&
  608. (c->x86_model == 29 || c->x86_model == 46 || c->x86_model == 47))
  609. set_cpu_bug(c, X86_BUG_CLFLUSH_MONITOR);
  610. if (c->x86 == 6 && boot_cpu_has(X86_FEATURE_MWAIT) &&
  611. ((c->x86_model == INTEL_FAM6_ATOM_GOLDMONT)))
  612. set_cpu_bug(c, X86_BUG_MONITOR);
  613. #ifdef CONFIG_X86_64
  614. if (c->x86 == 15)
  615. c->x86_cache_alignment = c->x86_clflush_size * 2;
  616. if (c->x86 == 6)
  617. set_cpu_cap(c, X86_FEATURE_REP_GOOD);
  618. #else
  619. /*
  620. * Names for the Pentium II/Celeron processors
  621. * detectable only by also checking the cache size.
  622. * Dixon is NOT a Celeron.
  623. */
  624. if (c->x86 == 6) {
  625. unsigned int l2 = c->x86_cache_size;
  626. char *p = NULL;
  627. switch (c->x86_model) {
  628. case 5:
  629. if (l2 == 0)
  630. p = "Celeron (Covington)";
  631. else if (l2 == 256)
  632. p = "Mobile Pentium II (Dixon)";
  633. break;
  634. case 6:
  635. if (l2 == 128)
  636. p = "Celeron (Mendocino)";
  637. else if (c->x86_stepping == 0 || c->x86_stepping == 5)
  638. p = "Celeron-A";
  639. break;
  640. case 8:
  641. if (l2 == 128)
  642. p = "Celeron (Coppermine)";
  643. break;
  644. }
  645. if (p)
  646. strcpy(c->x86_model_id, p);
  647. }
  648. if (c->x86 == 15)
  649. set_cpu_cap(c, X86_FEATURE_P4);
  650. if (c->x86 == 6)
  651. set_cpu_cap(c, X86_FEATURE_P3);
  652. #endif
  653. /* Work around errata */
  654. srat_detect_node(c);
  655. if (cpu_has(c, X86_FEATURE_VMX))
  656. detect_vmx_virtcap(c);
  657. if (cpu_has(c, X86_FEATURE_TME))
  658. detect_tme(c);
  659. init_intel_energy_perf(c);
  660. init_intel_misc_features(c);
  661. if (tsx_ctrl_state == TSX_CTRL_ENABLE)
  662. tsx_enable();
  663. if (tsx_ctrl_state == TSX_CTRL_DISABLE)
  664. tsx_disable();
  665. }
  666. #ifdef CONFIG_X86_32
  667. static unsigned int intel_size_cache(struct cpuinfo_x86 *c, unsigned int size)
  668. {
  669. /*
  670. * Intel PIII Tualatin. This comes in two flavours.
  671. * One has 256kb of cache, the other 512. We have no way
  672. * to determine which, so we use a boottime override
  673. * for the 512kb model, and assume 256 otherwise.
  674. */
  675. if ((c->x86 == 6) && (c->x86_model == 11) && (size == 0))
  676. size = 256;
  677. /*
  678. * Intel Quark SoC X1000 contains a 4-way set associative
  679. * 16K cache with a 16 byte cache line and 256 lines per tag
  680. */
  681. if ((c->x86 == 5) && (c->x86_model == 9))
  682. size = 16;
  683. return size;
  684. }
  685. #endif
  686. #define TLB_INST_4K 0x01
  687. #define TLB_INST_4M 0x02
  688. #define TLB_INST_2M_4M 0x03
  689. #define TLB_INST_ALL 0x05
  690. #define TLB_INST_1G 0x06
  691. #define TLB_DATA_4K 0x11
  692. #define TLB_DATA_4M 0x12
  693. #define TLB_DATA_2M_4M 0x13
  694. #define TLB_DATA_4K_4M 0x14
  695. #define TLB_DATA_1G 0x16
  696. #define TLB_DATA0_4K 0x21
  697. #define TLB_DATA0_4M 0x22
  698. #define TLB_DATA0_2M_4M 0x23
  699. #define STLB_4K 0x41
  700. #define STLB_4K_2M 0x42
  701. static const struct _tlb_table intel_tlb_table[] = {
  702. { 0x01, TLB_INST_4K, 32, " TLB_INST 4 KByte pages, 4-way set associative" },
  703. { 0x02, TLB_INST_4M, 2, " TLB_INST 4 MByte pages, full associative" },
  704. { 0x03, TLB_DATA_4K, 64, " TLB_DATA 4 KByte pages, 4-way set associative" },
  705. { 0x04, TLB_DATA_4M, 8, " TLB_DATA 4 MByte pages, 4-way set associative" },
  706. { 0x05, TLB_DATA_4M, 32, " TLB_DATA 4 MByte pages, 4-way set associative" },
  707. { 0x0b, TLB_INST_4M, 4, " TLB_INST 4 MByte pages, 4-way set associative" },
  708. { 0x4f, TLB_INST_4K, 32, " TLB_INST 4 KByte pages */" },
  709. { 0x50, TLB_INST_ALL, 64, " TLB_INST 4 KByte and 2-MByte or 4-MByte pages" },
  710. { 0x51, TLB_INST_ALL, 128, " TLB_INST 4 KByte and 2-MByte or 4-MByte pages" },
  711. { 0x52, TLB_INST_ALL, 256, " TLB_INST 4 KByte and 2-MByte or 4-MByte pages" },
  712. { 0x55, TLB_INST_2M_4M, 7, " TLB_INST 2-MByte or 4-MByte pages, fully associative" },
  713. { 0x56, TLB_DATA0_4M, 16, " TLB_DATA0 4 MByte pages, 4-way set associative" },
  714. { 0x57, TLB_DATA0_4K, 16, " TLB_DATA0 4 KByte pages, 4-way associative" },
  715. { 0x59, TLB_DATA0_4K, 16, " TLB_DATA0 4 KByte pages, fully associative" },
  716. { 0x5a, TLB_DATA0_2M_4M, 32, " TLB_DATA0 2-MByte or 4 MByte pages, 4-way set associative" },
  717. { 0x5b, TLB_DATA_4K_4M, 64, " TLB_DATA 4 KByte and 4 MByte pages" },
  718. { 0x5c, TLB_DATA_4K_4M, 128, " TLB_DATA 4 KByte and 4 MByte pages" },
  719. { 0x5d, TLB_DATA_4K_4M, 256, " TLB_DATA 4 KByte and 4 MByte pages" },
  720. { 0x61, TLB_INST_4K, 48, " TLB_INST 4 KByte pages, full associative" },
  721. { 0x63, TLB_DATA_1G, 4, " TLB_DATA 1 GByte pages, 4-way set associative" },
  722. { 0x6b, TLB_DATA_4K, 256, " TLB_DATA 4 KByte pages, 8-way associative" },
  723. { 0x6c, TLB_DATA_2M_4M, 128, " TLB_DATA 2 MByte or 4 MByte pages, 8-way associative" },
  724. { 0x6d, TLB_DATA_1G, 16, " TLB_DATA 1 GByte pages, fully associative" },
  725. { 0x76, TLB_INST_2M_4M, 8, " TLB_INST 2-MByte or 4-MByte pages, fully associative" },
  726. { 0xb0, TLB_INST_4K, 128, " TLB_INST 4 KByte pages, 4-way set associative" },
  727. { 0xb1, TLB_INST_2M_4M, 4, " TLB_INST 2M pages, 4-way, 8 entries or 4M pages, 4-way entries" },
  728. { 0xb2, TLB_INST_4K, 64, " TLB_INST 4KByte pages, 4-way set associative" },
  729. { 0xb3, TLB_DATA_4K, 128, " TLB_DATA 4 KByte pages, 4-way set associative" },
  730. { 0xb4, TLB_DATA_4K, 256, " TLB_DATA 4 KByte pages, 4-way associative" },
  731. { 0xb5, TLB_INST_4K, 64, " TLB_INST 4 KByte pages, 8-way set associative" },
  732. { 0xb6, TLB_INST_4K, 128, " TLB_INST 4 KByte pages, 8-way set associative" },
  733. { 0xba, TLB_DATA_4K, 64, " TLB_DATA 4 KByte pages, 4-way associative" },
  734. { 0xc0, TLB_DATA_4K_4M, 8, " TLB_DATA 4 KByte and 4 MByte pages, 4-way associative" },
  735. { 0xc1, STLB_4K_2M, 1024, " STLB 4 KByte and 2 MByte pages, 8-way associative" },
  736. { 0xc2, TLB_DATA_2M_4M, 16, " DTLB 2 MByte/4MByte pages, 4-way associative" },
  737. { 0xca, STLB_4K, 512, " STLB 4 KByte pages, 4-way associative" },
  738. { 0x00, 0, 0 }
  739. };
  740. static void intel_tlb_lookup(const unsigned char desc)
  741. {
  742. unsigned char k;
  743. if (desc == 0)
  744. return;
  745. /* look up this descriptor in the table */
  746. for (k = 0; intel_tlb_table[k].descriptor != desc && \
  747. intel_tlb_table[k].descriptor != 0; k++)
  748. ;
  749. if (intel_tlb_table[k].tlb_type == 0)
  750. return;
  751. switch (intel_tlb_table[k].tlb_type) {
  752. case STLB_4K:
  753. if (tlb_lli_4k[ENTRIES] < intel_tlb_table[k].entries)
  754. tlb_lli_4k[ENTRIES] = intel_tlb_table[k].entries;
  755. if (tlb_lld_4k[ENTRIES] < intel_tlb_table[k].entries)
  756. tlb_lld_4k[ENTRIES] = intel_tlb_table[k].entries;
  757. break;
  758. case STLB_4K_2M:
  759. if (tlb_lli_4k[ENTRIES] < intel_tlb_table[k].entries)
  760. tlb_lli_4k[ENTRIES] = intel_tlb_table[k].entries;
  761. if (tlb_lld_4k[ENTRIES] < intel_tlb_table[k].entries)
  762. tlb_lld_4k[ENTRIES] = intel_tlb_table[k].entries;
  763. if (tlb_lli_2m[ENTRIES] < intel_tlb_table[k].entries)
  764. tlb_lli_2m[ENTRIES] = intel_tlb_table[k].entries;
  765. if (tlb_lld_2m[ENTRIES] < intel_tlb_table[k].entries)
  766. tlb_lld_2m[ENTRIES] = intel_tlb_table[k].entries;
  767. if (tlb_lli_4m[ENTRIES] < intel_tlb_table[k].entries)
  768. tlb_lli_4m[ENTRIES] = intel_tlb_table[k].entries;
  769. if (tlb_lld_4m[ENTRIES] < intel_tlb_table[k].entries)
  770. tlb_lld_4m[ENTRIES] = intel_tlb_table[k].entries;
  771. break;
  772. case TLB_INST_ALL:
  773. if (tlb_lli_4k[ENTRIES] < intel_tlb_table[k].entries)
  774. tlb_lli_4k[ENTRIES] = intel_tlb_table[k].entries;
  775. if (tlb_lli_2m[ENTRIES] < intel_tlb_table[k].entries)
  776. tlb_lli_2m[ENTRIES] = intel_tlb_table[k].entries;
  777. if (tlb_lli_4m[ENTRIES] < intel_tlb_table[k].entries)
  778. tlb_lli_4m[ENTRIES] = intel_tlb_table[k].entries;
  779. break;
  780. case TLB_INST_4K:
  781. if (tlb_lli_4k[ENTRIES] < intel_tlb_table[k].entries)
  782. tlb_lli_4k[ENTRIES] = intel_tlb_table[k].entries;
  783. break;
  784. case TLB_INST_4M:
  785. if (tlb_lli_4m[ENTRIES] < intel_tlb_table[k].entries)
  786. tlb_lli_4m[ENTRIES] = intel_tlb_table[k].entries;
  787. break;
  788. case TLB_INST_2M_4M:
  789. if (tlb_lli_2m[ENTRIES] < intel_tlb_table[k].entries)
  790. tlb_lli_2m[ENTRIES] = intel_tlb_table[k].entries;
  791. if (tlb_lli_4m[ENTRIES] < intel_tlb_table[k].entries)
  792. tlb_lli_4m[ENTRIES] = intel_tlb_table[k].entries;
  793. break;
  794. case TLB_DATA_4K:
  795. case TLB_DATA0_4K:
  796. if (tlb_lld_4k[ENTRIES] < intel_tlb_table[k].entries)
  797. tlb_lld_4k[ENTRIES] = intel_tlb_table[k].entries;
  798. break;
  799. case TLB_DATA_4M:
  800. case TLB_DATA0_4M:
  801. if (tlb_lld_4m[ENTRIES] < intel_tlb_table[k].entries)
  802. tlb_lld_4m[ENTRIES] = intel_tlb_table[k].entries;
  803. break;
  804. case TLB_DATA_2M_4M:
  805. case TLB_DATA0_2M_4M:
  806. if (tlb_lld_2m[ENTRIES] < intel_tlb_table[k].entries)
  807. tlb_lld_2m[ENTRIES] = intel_tlb_table[k].entries;
  808. if (tlb_lld_4m[ENTRIES] < intel_tlb_table[k].entries)
  809. tlb_lld_4m[ENTRIES] = intel_tlb_table[k].entries;
  810. break;
  811. case TLB_DATA_4K_4M:
  812. if (tlb_lld_4k[ENTRIES] < intel_tlb_table[k].entries)
  813. tlb_lld_4k[ENTRIES] = intel_tlb_table[k].entries;
  814. if (tlb_lld_4m[ENTRIES] < intel_tlb_table[k].entries)
  815. tlb_lld_4m[ENTRIES] = intel_tlb_table[k].entries;
  816. break;
  817. case TLB_DATA_1G:
  818. if (tlb_lld_1g[ENTRIES] < intel_tlb_table[k].entries)
  819. tlb_lld_1g[ENTRIES] = intel_tlb_table[k].entries;
  820. break;
  821. }
  822. }
  823. static void intel_detect_tlb(struct cpuinfo_x86 *c)
  824. {
  825. int i, j, n;
  826. unsigned int regs[4];
  827. unsigned char *desc = (unsigned char *)regs;
  828. if (c->cpuid_level < 2)
  829. return;
  830. /* Number of times to iterate */
  831. n = cpuid_eax(2) & 0xFF;
  832. for (i = 0 ; i < n ; i++) {
  833. cpuid(2, &regs[0], &regs[1], &regs[2], &regs[3]);
  834. /* If bit 31 is set, this is an unknown format */
  835. for (j = 0 ; j < 3 ; j++)
  836. if (regs[j] & (1 << 31))
  837. regs[j] = 0;
  838. /* Byte 0 is level count, not a descriptor */
  839. for (j = 1 ; j < 16 ; j++)
  840. intel_tlb_lookup(desc[j]);
  841. }
  842. }
  843. static const struct cpu_dev intel_cpu_dev = {
  844. .c_vendor = "Intel",
  845. .c_ident = { "GenuineIntel" },
  846. #ifdef CONFIG_X86_32
  847. .legacy_models = {
  848. { .family = 4, .model_names =
  849. {
  850. [0] = "486 DX-25/33",
  851. [1] = "486 DX-50",
  852. [2] = "486 SX",
  853. [3] = "486 DX/2",
  854. [4] = "486 SL",
  855. [5] = "486 SX/2",
  856. [7] = "486 DX/2-WB",
  857. [8] = "486 DX/4",
  858. [9] = "486 DX/4-WB"
  859. }
  860. },
  861. { .family = 5, .model_names =
  862. {
  863. [0] = "Pentium 60/66 A-step",
  864. [1] = "Pentium 60/66",
  865. [2] = "Pentium 75 - 200",
  866. [3] = "OverDrive PODP5V83",
  867. [4] = "Pentium MMX",
  868. [7] = "Mobile Pentium 75 - 200",
  869. [8] = "Mobile Pentium MMX",
  870. [9] = "Quark SoC X1000",
  871. }
  872. },
  873. { .family = 6, .model_names =
  874. {
  875. [0] = "Pentium Pro A-step",
  876. [1] = "Pentium Pro",
  877. [3] = "Pentium II (Klamath)",
  878. [4] = "Pentium II (Deschutes)",
  879. [5] = "Pentium II (Deschutes)",
  880. [6] = "Mobile Pentium II",
  881. [7] = "Pentium III (Katmai)",
  882. [8] = "Pentium III (Coppermine)",
  883. [10] = "Pentium III (Cascades)",
  884. [11] = "Pentium III (Tualatin)",
  885. }
  886. },
  887. { .family = 15, .model_names =
  888. {
  889. [0] = "Pentium 4 (Unknown)",
  890. [1] = "Pentium 4 (Willamette)",
  891. [2] = "Pentium 4 (Northwood)",
  892. [4] = "Pentium 4 (Foster)",
  893. [5] = "Pentium 4 (Foster)",
  894. }
  895. },
  896. },
  897. .legacy_cache_size = intel_size_cache,
  898. #endif
  899. .c_detect_tlb = intel_detect_tlb,
  900. .c_early_init = early_init_intel,
  901. .c_init = init_intel,
  902. .c_bsp_resume = intel_bsp_resume,
  903. .c_x86_vendor = X86_VENDOR_INTEL,
  904. };
  905. cpu_dev_register(intel_cpu_dev);