Commit cd4cdc53 authored by Linus Torvalds's avatar Linus Torvalds
Browse files

Merge tag 'x86_microcode_for_v7.1_rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip

Pull x86 microcode loading updates from Borislav Petkov:
 "The kernel carries a table of Intel CPUs family, model, stepping, etc
  tuples which say what is the latest microcode for that particular CPU.

  Some CPU variants differ only by the platform ID which determines what
  microcode needs to be loaded on them.

  Carve out the platform ID handling from the microcode loader and make it
  available in a more generic place so that the old microcode
  verification machinery can use it"

* tag 'x86_microcode_for_v7.1_rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
  x86/microcode: Add platform mask to Intel microcode "old" list
  x86/cpu: Add platform ID to CPU matching structure
  x86/cpu: Add platform ID to CPU info structure
  x86/microcode: Refactor platform ID enumeration into a helper
parents e9635f2a 7989c393
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -61,6 +61,8 @@ static inline int intel_microcode_get_datasize(struct microcode_header_intel *hd
	return hdr->datasize ? : DEFAULT_UCODE_DATASIZE;
}

extern u32 intel_get_platform_id(void);

static inline u32 intel_get_microcode_revision(void)
{
	u32 rev, dummy;
+5 −0
Original line number Diff line number Diff line
@@ -140,6 +140,11 @@ struct cpuinfo_x86 {
		__u32		x86_vfm;
	};
	__u8			x86_stepping;
	union {
		// MSR_IA32_PLATFORM_ID[52-50]
		__u8			intel_platform_id;
		__u8			amd_unused;
	};
#ifdef CONFIG_X86_64
	/* Number of 4K pages in DTLB/ITLB combined(in pages): */
	int			x86_tlbsize;
+1 −0
Original line number Diff line number Diff line
@@ -205,6 +205,7 @@ static void early_init_intel(struct cpuinfo_x86 *c)

	if (c->x86 >= 6 && !cpu_has(c, X86_FEATURE_IA64))
		c->microcode = intel_get_microcode_revision();
	c->intel_platform_id = intel_get_platform_id();

	/* Now if any of them are set, check the blacklist and clear the lot */
	if ((cpu_has(c, X86_FEATURE_SPEC_CTRL) ||
+3 −0
Original line number Diff line number Diff line
@@ -76,6 +76,9 @@ const struct x86_cpu_id *x86_match_cpu(const struct x86_cpu_id *match)
		if (m->steppings != X86_STEPPING_ANY &&
		    !(BIT(c->x86_stepping) & m->steppings))
			continue;
		if (m->platform_mask != X86_PLATFORM_ANY &&
		    !(BIT(c->intel_platform_id) & m->platform_mask))
			continue;
		if (m->feature != X86_FEATURE_ANY && !cpu_has(c, m->feature))
			continue;
		if (!x86_match_vendor_cpu_type(c, m))
+238 −160

File changed.

Preview size limit exceeded, changes collapsed.

Loading