intel.c 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660
  1. // SPDX-License-Identifier: GPL-2.0-or-later
  2. /*
  3. * Intel CPU Microcode Update Driver for Linux
  4. *
  5. * Copyright (C) 2000-2006 Tigran Aivazian <aivazian.tigran@gmail.com>
  6. * 2006 Shaohua Li <shaohua.li@intel.com>
  7. *
  8. * Intel CPU microcode early update for Linux
  9. *
  10. * Copyright (C) 2012 Fenghua Yu <fenghua.yu@intel.com>
  11. * H Peter Anvin" <hpa@zytor.com>
  12. */
  13. #define pr_fmt(fmt) "microcode: " fmt
  14. #include <linux/earlycpio.h>
  15. #include <linux/firmware.h>
  16. #include <linux/uaccess.h>
  17. #include <linux/initrd.h>
  18. #include <linux/kernel.h>
  19. #include <linux/slab.h>
  20. #include <linux/cpu.h>
  21. #include <linux/uio.h>
  22. #include <linux/mm.h>
  23. #include <asm/cpu_device_id.h>
  24. #include <asm/processor.h>
  25. #include <asm/tlbflush.h>
  26. #include <asm/setup.h>
  27. #include <asm/msr.h>
  28. #include "internal.h"
  29. static const char ucode_path[] = "kernel/x86/microcode/GenuineIntel.bin";
  30. #define UCODE_BSP_LOADED ((struct microcode_intel *)0x1UL)
  31. /* Current microcode patch used in early patching on the APs. */
  32. static struct microcode_intel *ucode_patch_va __read_mostly;
  33. static struct microcode_intel *ucode_patch_late __read_mostly;
  34. /* last level cache size per core */
  35. static unsigned int llc_size_per_core __ro_after_init;
  36. /* microcode format is extended from prescott processors */
  37. struct extended_signature {
  38. unsigned int sig;
  39. unsigned int pf;
  40. unsigned int cksum;
  41. };
  42. struct extended_sigtable {
  43. unsigned int count;
  44. unsigned int cksum;
  45. unsigned int reserved[3];
  46. struct extended_signature sigs[];
  47. };
  48. #define DEFAULT_UCODE_TOTALSIZE (DEFAULT_UCODE_DATASIZE + MC_HEADER_SIZE)
  49. #define EXT_HEADER_SIZE (sizeof(struct extended_sigtable))
  50. #define EXT_SIGNATURE_SIZE (sizeof(struct extended_signature))
  51. static inline unsigned int get_totalsize(struct microcode_header_intel *hdr)
  52. {
  53. return hdr->datasize ? hdr->totalsize : DEFAULT_UCODE_TOTALSIZE;
  54. }
  55. static inline unsigned int exttable_size(struct extended_sigtable *et)
  56. {
  57. return et->count * EXT_SIGNATURE_SIZE + EXT_HEADER_SIZE;
  58. }
  59. void intel_collect_cpu_info(struct cpu_signature *sig)
  60. {
  61. sig->sig = cpuid_eax(1);
  62. sig->pf = 0;
  63. sig->rev = intel_get_microcode_revision();
  64. if (IFM(x86_family(sig->sig), x86_model(sig->sig)) >= INTEL_PENTIUM_III_DESCHUTES) {
  65. unsigned int val[2];
  66. /* get processor flags from MSR 0x17 */
  67. native_rdmsr(MSR_IA32_PLATFORM_ID, val[0], val[1]);
  68. sig->pf = 1 << ((val[1] >> 18) & 7);
  69. }
  70. }
  71. EXPORT_SYMBOL_GPL(intel_collect_cpu_info);
  72. static inline bool cpu_signatures_match(struct cpu_signature *s1, unsigned int sig2,
  73. unsigned int pf2)
  74. {
  75. if (s1->sig != sig2)
  76. return false;
  77. /* Processor flags are either both 0 or they intersect. */
  78. return ((!s1->pf && !pf2) || (s1->pf & pf2));
  79. }
  80. bool intel_find_matching_signature(void *mc, struct cpu_signature *sig)
  81. {
  82. struct microcode_header_intel *mc_hdr = mc;
  83. struct extended_signature *ext_sig;
  84. struct extended_sigtable *ext_hdr;
  85. int i;
  86. if (cpu_signatures_match(sig, mc_hdr->sig, mc_hdr->pf))
  87. return true;
  88. /* Look for ext. headers: */
  89. if (get_totalsize(mc_hdr) <= intel_microcode_get_datasize(mc_hdr) + MC_HEADER_SIZE)
  90. return false;
  91. ext_hdr = mc + intel_microcode_get_datasize(mc_hdr) + MC_HEADER_SIZE;
  92. ext_sig = (void *)ext_hdr + EXT_HEADER_SIZE;
  93. for (i = 0; i < ext_hdr->count; i++) {
  94. if (cpu_signatures_match(sig, ext_sig->sig, ext_sig->pf))
  95. return true;
  96. ext_sig++;
  97. }
  98. return 0;
  99. }
  100. EXPORT_SYMBOL_GPL(intel_find_matching_signature);
  101. /**
  102. * intel_microcode_sanity_check() - Sanity check microcode file.
  103. * @mc: Pointer to the microcode file contents.
  104. * @print_err: Display failure reason if true, silent if false.
  105. * @hdr_type: Type of file, i.e. normal microcode file or In Field Scan file.
  106. * Validate if the microcode header type matches with the type
  107. * specified here.
  108. *
  109. * Validate certain header fields and verify if computed checksum matches
  110. * with the one specified in the header.
  111. *
  112. * Return: 0 if the file passes all the checks, -EINVAL if any of the checks
  113. * fail.
  114. */
  115. int intel_microcode_sanity_check(void *mc, bool print_err, int hdr_type)
  116. {
  117. unsigned long total_size, data_size, ext_table_size;
  118. struct microcode_header_intel *mc_header = mc;
  119. struct extended_sigtable *ext_header = NULL;
  120. u32 sum, orig_sum, ext_sigcount = 0, i;
  121. struct extended_signature *ext_sig;
  122. total_size = get_totalsize(mc_header);
  123. data_size = intel_microcode_get_datasize(mc_header);
  124. if (data_size + MC_HEADER_SIZE > total_size) {
  125. if (print_err)
  126. pr_err("Error: bad microcode data file size.\n");
  127. return -EINVAL;
  128. }
  129. if (mc_header->ldrver != 1 || mc_header->hdrver != hdr_type) {
  130. if (print_err)
  131. pr_err("Error: invalid/unknown microcode update format. Header type %d\n",
  132. mc_header->hdrver);
  133. return -EINVAL;
  134. }
  135. ext_table_size = total_size - (MC_HEADER_SIZE + data_size);
  136. if (ext_table_size) {
  137. u32 ext_table_sum = 0;
  138. u32 *ext_tablep;
  139. if (ext_table_size < EXT_HEADER_SIZE ||
  140. ((ext_table_size - EXT_HEADER_SIZE) % EXT_SIGNATURE_SIZE)) {
  141. if (print_err)
  142. pr_err("Error: truncated extended signature table.\n");
  143. return -EINVAL;
  144. }
  145. ext_header = mc + MC_HEADER_SIZE + data_size;
  146. if (ext_table_size != exttable_size(ext_header)) {
  147. if (print_err)
  148. pr_err("Error: extended signature table size mismatch.\n");
  149. return -EFAULT;
  150. }
  151. ext_sigcount = ext_header->count;
  152. /*
  153. * Check extended table checksum: the sum of all dwords that
  154. * comprise a valid table must be 0.
  155. */
  156. ext_tablep = (u32 *)ext_header;
  157. i = ext_table_size / sizeof(u32);
  158. while (i--)
  159. ext_table_sum += ext_tablep[i];
  160. if (ext_table_sum) {
  161. if (print_err)
  162. pr_warn("Bad extended signature table checksum, aborting.\n");
  163. return -EINVAL;
  164. }
  165. }
  166. /*
  167. * Calculate the checksum of update data and header. The checksum of
  168. * valid update data and header including the extended signature table
  169. * must be 0.
  170. */
  171. orig_sum = 0;
  172. i = (MC_HEADER_SIZE + data_size) / sizeof(u32);
  173. while (i--)
  174. orig_sum += ((u32 *)mc)[i];
  175. if (orig_sum) {
  176. if (print_err)
  177. pr_err("Bad microcode data checksum, aborting.\n");
  178. return -EINVAL;
  179. }
  180. if (!ext_table_size)
  181. return 0;
  182. /*
  183. * Check extended signature checksum: 0 => valid.
  184. */
  185. for (i = 0; i < ext_sigcount; i++) {
  186. ext_sig = (void *)ext_header + EXT_HEADER_SIZE +
  187. EXT_SIGNATURE_SIZE * i;
  188. sum = (mc_header->sig + mc_header->pf + mc_header->cksum) -
  189. (ext_sig->sig + ext_sig->pf + ext_sig->cksum);
  190. if (sum) {
  191. if (print_err)
  192. pr_err("Bad extended signature checksum, aborting.\n");
  193. return -EINVAL;
  194. }
  195. }
  196. return 0;
  197. }
  198. EXPORT_SYMBOL_GPL(intel_microcode_sanity_check);
  199. static void update_ucode_pointer(struct microcode_intel *mc)
  200. {
  201. kvfree(ucode_patch_va);
  202. /*
  203. * Save the virtual address for early loading and for eventual free
  204. * on late loading.
  205. */
  206. ucode_patch_va = mc;
  207. }
  208. static void save_microcode_patch(struct microcode_intel *patch)
  209. {
  210. unsigned int size = get_totalsize(&patch->hdr);
  211. struct microcode_intel *mc;
  212. mc = kvmemdup(patch, size, GFP_KERNEL);
  213. if (mc)
  214. update_ucode_pointer(mc);
  215. else
  216. pr_err("Unable to allocate microcode memory size: %u\n", size);
  217. }
  218. /* Scan blob for microcode matching the boot CPUs family, model, stepping */
  219. static __init struct microcode_intel *scan_microcode(void *data, size_t size,
  220. struct ucode_cpu_info *uci,
  221. bool save)
  222. {
  223. struct microcode_header_intel *mc_header;
  224. struct microcode_intel *patch = NULL;
  225. u32 cur_rev = uci->cpu_sig.rev;
  226. unsigned int mc_size;
  227. for (; size >= sizeof(struct microcode_header_intel); size -= mc_size, data += mc_size) {
  228. mc_header = (struct microcode_header_intel *)data;
  229. mc_size = get_totalsize(mc_header);
  230. if (!mc_size || mc_size > size ||
  231. intel_microcode_sanity_check(data, false, MC_HEADER_TYPE_MICROCODE) < 0)
  232. break;
  233. if (!intel_find_matching_signature(data, &uci->cpu_sig))
  234. continue;
  235. /*
  236. * For saving the early microcode, find the matching revision which
  237. * was loaded on the BSP.
  238. *
  239. * On the BSP during early boot, find a newer revision than
  240. * actually loaded in the CPU.
  241. */
  242. if (save) {
  243. if (cur_rev != mc_header->rev)
  244. continue;
  245. } else if (cur_rev >= mc_header->rev) {
  246. continue;
  247. }
  248. patch = data;
  249. cur_rev = mc_header->rev;
  250. }
  251. return size ? NULL : patch;
  252. }
  253. static enum ucode_state __apply_microcode(struct ucode_cpu_info *uci,
  254. struct microcode_intel *mc,
  255. u32 *cur_rev)
  256. {
  257. u32 rev;
  258. if (!mc)
  259. return UCODE_NFOUND;
  260. /*
  261. * Save us the MSR write below - which is a particular expensive
  262. * operation - when the other hyperthread has updated the microcode
  263. * already.
  264. */
  265. *cur_rev = intel_get_microcode_revision();
  266. if (*cur_rev >= mc->hdr.rev) {
  267. uci->cpu_sig.rev = *cur_rev;
  268. return UCODE_OK;
  269. }
  270. /*
  271. * Writeback and invalidate caches before updating microcode to avoid
  272. * internal issues depending on what the microcode is updating.
  273. */
  274. native_wbinvd();
  275. /* write microcode via MSR 0x79 */
  276. native_wrmsrl(MSR_IA32_UCODE_WRITE, (unsigned long)mc->bits);
  277. rev = intel_get_microcode_revision();
  278. if (rev != mc->hdr.rev)
  279. return UCODE_ERROR;
  280. uci->cpu_sig.rev = rev;
  281. return UCODE_UPDATED;
  282. }
  283. static enum ucode_state apply_microcode_early(struct ucode_cpu_info *uci)
  284. {
  285. struct microcode_intel *mc = uci->mc;
  286. u32 cur_rev;
  287. return __apply_microcode(uci, mc, &cur_rev);
  288. }
  289. static __init bool load_builtin_intel_microcode(struct cpio_data *cp)
  290. {
  291. unsigned int eax = 1, ebx, ecx = 0, edx;
  292. struct firmware fw;
  293. char name[30];
  294. if (IS_ENABLED(CONFIG_X86_32))
  295. return false;
  296. native_cpuid(&eax, &ebx, &ecx, &edx);
  297. sprintf(name, "intel-ucode/%02x-%02x-%02x",
  298. x86_family(eax), x86_model(eax), x86_stepping(eax));
  299. if (firmware_request_builtin(&fw, name)) {
  300. cp->size = fw.size;
  301. cp->data = (void *)fw.data;
  302. return true;
  303. }
  304. return false;
  305. }
  306. static __init struct microcode_intel *get_microcode_blob(struct ucode_cpu_info *uci, bool save)
  307. {
  308. struct cpio_data cp;
  309. intel_collect_cpu_info(&uci->cpu_sig);
  310. if (!load_builtin_intel_microcode(&cp))
  311. cp = find_microcode_in_initrd(ucode_path);
  312. if (!(cp.data && cp.size))
  313. return NULL;
  314. return scan_microcode(cp.data, cp.size, uci, save);
  315. }
  316. /*
  317. * Invoked from an early init call to save the microcode blob which was
  318. * selected during early boot when mm was not usable. The microcode must be
  319. * saved because initrd is going away. It's an early init call so the APs
  320. * just can use the pointer and do not have to scan initrd/builtin firmware
  321. * again.
  322. */
  323. static int __init save_builtin_microcode(void)
  324. {
  325. struct ucode_cpu_info uci;
  326. if (xchg(&ucode_patch_va, NULL) != UCODE_BSP_LOADED)
  327. return 0;
  328. if (microcode_loader_disabled() || boot_cpu_data.x86_vendor != X86_VENDOR_INTEL)
  329. return 0;
  330. uci.mc = get_microcode_blob(&uci, true);
  331. if (uci.mc)
  332. save_microcode_patch(uci.mc);
  333. return 0;
  334. }
  335. early_initcall(save_builtin_microcode);
  336. /* Load microcode on BSP from initrd or builtin blobs */
  337. void __init load_ucode_intel_bsp(struct early_load_data *ed)
  338. {
  339. struct ucode_cpu_info uci;
  340. uci.mc = get_microcode_blob(&uci, false);
  341. ed->old_rev = uci.cpu_sig.rev;
  342. if (uci.mc && apply_microcode_early(&uci) == UCODE_UPDATED) {
  343. ucode_patch_va = UCODE_BSP_LOADED;
  344. ed->new_rev = uci.cpu_sig.rev;
  345. }
  346. }
  347. void load_ucode_intel_ap(void)
  348. {
  349. struct ucode_cpu_info uci;
  350. uci.mc = ucode_patch_va;
  351. if (uci.mc)
  352. apply_microcode_early(&uci);
  353. }
  354. /* Reload microcode on resume */
  355. void reload_ucode_intel(void)
  356. {
  357. struct ucode_cpu_info uci = { .mc = ucode_patch_va, };
  358. if (uci.mc)
  359. apply_microcode_early(&uci);
  360. }
  361. static int collect_cpu_info(int cpu_num, struct cpu_signature *csig)
  362. {
  363. intel_collect_cpu_info(csig);
  364. return 0;
  365. }
  366. static enum ucode_state apply_microcode_late(int cpu)
  367. {
  368. struct ucode_cpu_info *uci = ucode_cpu_info + cpu;
  369. struct microcode_intel *mc = ucode_patch_late;
  370. enum ucode_state ret;
  371. u32 cur_rev;
  372. if (WARN_ON_ONCE(smp_processor_id() != cpu))
  373. return UCODE_ERROR;
  374. ret = __apply_microcode(uci, mc, &cur_rev);
  375. if (ret != UCODE_UPDATED && ret != UCODE_OK)
  376. return ret;
  377. cpu_data(cpu).microcode = uci->cpu_sig.rev;
  378. if (!cpu)
  379. boot_cpu_data.microcode = uci->cpu_sig.rev;
  380. return ret;
  381. }
  382. static bool ucode_validate_minrev(struct microcode_header_intel *mc_header)
  383. {
  384. int cur_rev = boot_cpu_data.microcode;
  385. /*
  386. * When late-loading, ensure the header declares a minimum revision
  387. * required to perform a late-load. The previously reserved field
  388. * is 0 in older microcode blobs.
  389. */
  390. if (!mc_header->min_req_ver) {
  391. pr_info("Unsafe microcode update: Microcode header does not specify a required min version\n");
  392. return false;
  393. }
  394. /*
  395. * Check whether the current revision is either greater or equal to
  396. * to the minimum revision specified in the header.
  397. */
  398. if (cur_rev < mc_header->min_req_ver) {
  399. pr_info("Unsafe microcode update: Current revision 0x%x too old\n", cur_rev);
  400. pr_info("Current should be at 0x%x or higher. Use early loading instead\n", mc_header->min_req_ver);
  401. return false;
  402. }
  403. return true;
  404. }
  405. static enum ucode_state parse_microcode_blobs(int cpu, struct iov_iter *iter)
  406. {
  407. struct ucode_cpu_info *uci = ucode_cpu_info + cpu;
  408. bool is_safe, new_is_safe = false;
  409. int cur_rev = uci->cpu_sig.rev;
  410. unsigned int curr_mc_size = 0;
  411. u8 *new_mc = NULL, *mc = NULL;
  412. while (iov_iter_count(iter)) {
  413. struct microcode_header_intel mc_header;
  414. unsigned int mc_size, data_size;
  415. u8 *data;
  416. if (!copy_from_iter_full(&mc_header, sizeof(mc_header), iter)) {
  417. pr_err("error! Truncated or inaccessible header in microcode data file\n");
  418. goto fail;
  419. }
  420. mc_size = get_totalsize(&mc_header);
  421. if (mc_size < sizeof(mc_header)) {
  422. pr_err("error! Bad data in microcode data file (totalsize too small)\n");
  423. goto fail;
  424. }
  425. data_size = mc_size - sizeof(mc_header);
  426. if (data_size > iov_iter_count(iter)) {
  427. pr_err("error! Bad data in microcode data file (truncated file?)\n");
  428. goto fail;
  429. }
  430. /* For performance reasons, reuse mc area when possible */
  431. if (!mc || mc_size > curr_mc_size) {
  432. kvfree(mc);
  433. mc = kvmalloc(mc_size, GFP_KERNEL);
  434. if (!mc)
  435. goto fail;
  436. curr_mc_size = mc_size;
  437. }
  438. memcpy(mc, &mc_header, sizeof(mc_header));
  439. data = mc + sizeof(mc_header);
  440. if (!copy_from_iter_full(data, data_size, iter) ||
  441. intel_microcode_sanity_check(mc, true, MC_HEADER_TYPE_MICROCODE) < 0)
  442. goto fail;
  443. if (cur_rev >= mc_header.rev)
  444. continue;
  445. if (!intel_find_matching_signature(mc, &uci->cpu_sig))
  446. continue;
  447. is_safe = ucode_validate_minrev(&mc_header);
  448. if (force_minrev && !is_safe)
  449. continue;
  450. kvfree(new_mc);
  451. cur_rev = mc_header.rev;
  452. new_mc = mc;
  453. new_is_safe = is_safe;
  454. mc = NULL;
  455. }
  456. if (iov_iter_count(iter))
  457. goto fail;
  458. kvfree(mc);
  459. if (!new_mc)
  460. return UCODE_NFOUND;
  461. ucode_patch_late = (struct microcode_intel *)new_mc;
  462. return new_is_safe ? UCODE_NEW_SAFE : UCODE_NEW;
  463. fail:
  464. kvfree(mc);
  465. kvfree(new_mc);
  466. return UCODE_ERROR;
  467. }
  468. static bool is_blacklisted(unsigned int cpu)
  469. {
  470. struct cpuinfo_x86 *c = &cpu_data(cpu);
  471. /*
  472. * Late loading on model 79 with microcode revision less than 0x0b000021
  473. * and LLC size per core bigger than 2.5MB may result in a system hang.
  474. * This behavior is documented in item BDF90, #334165 (Intel Xeon
  475. * Processor E7-8800/4800 v4 Product Family).
  476. */
  477. if (c->x86_vfm == INTEL_BROADWELL_X &&
  478. c->x86_stepping == 0x01 &&
  479. llc_size_per_core > 2621440 &&
  480. c->microcode < 0x0b000021) {
  481. pr_err_once("Erratum BDF90: late loading with revision < 0x0b000021 (0x%x) disabled.\n", c->microcode);
  482. pr_err_once("Please consider either early loading through initrd/built-in or a potential BIOS update.\n");
  483. return true;
  484. }
  485. return false;
  486. }
  487. static enum ucode_state request_microcode_fw(int cpu, struct device *device)
  488. {
  489. struct cpuinfo_x86 *c = &cpu_data(cpu);
  490. const struct firmware *firmware;
  491. struct iov_iter iter;
  492. enum ucode_state ret;
  493. struct kvec kvec;
  494. char name[30];
  495. if (is_blacklisted(cpu))
  496. return UCODE_NFOUND;
  497. sprintf(name, "intel-ucode/%02x-%02x-%02x",
  498. c->x86, c->x86_model, c->x86_stepping);
  499. if (request_firmware_direct(&firmware, name, device)) {
  500. pr_debug("data file %s load failed\n", name);
  501. return UCODE_NFOUND;
  502. }
  503. kvec.iov_base = (void *)firmware->data;
  504. kvec.iov_len = firmware->size;
  505. iov_iter_kvec(&iter, ITER_SOURCE, &kvec, 1, firmware->size);
  506. ret = parse_microcode_blobs(cpu, &iter);
  507. release_firmware(firmware);
  508. return ret;
  509. }
  510. static void finalize_late_load(int result)
  511. {
  512. if (!result)
  513. update_ucode_pointer(ucode_patch_late);
  514. else
  515. kvfree(ucode_patch_late);
  516. ucode_patch_late = NULL;
  517. }
  518. static struct microcode_ops microcode_intel_ops = {
  519. .request_microcode_fw = request_microcode_fw,
  520. .collect_cpu_info = collect_cpu_info,
  521. .apply_microcode = apply_microcode_late,
  522. .finalize_late_load = finalize_late_load,
  523. .use_nmi = IS_ENABLED(CONFIG_X86_64),
  524. };
  525. static __init void calc_llc_size_per_core(struct cpuinfo_x86 *c)
  526. {
  527. u64 llc_size = c->x86_cache_size * 1024ULL;
  528. do_div(llc_size, topology_num_cores_per_package());
  529. llc_size_per_core = (unsigned int)llc_size;
  530. }
  531. struct microcode_ops * __init init_intel_microcode(void)
  532. {
  533. struct cpuinfo_x86 *c = &boot_cpu_data;
  534. if (c->x86_vendor != X86_VENDOR_INTEL || c->x86 < 6 ||
  535. cpu_has(c, X86_FEATURE_IA64)) {
  536. pr_err("Intel CPU family 0x%x not supported\n", c->x86);
  537. return NULL;
  538. }
  539. calc_llc_size_per_core(c);
  540. return &microcode_intel_ops;
  541. }