Commit 0fe5f9ca authored by Linus Torvalds's avatar Linus Torvalds
Browse files

Merge tag 'x86-urgent-2020-04-19' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip

Pull x86 and objtool fixes from Thomas Gleixner:
 "A set of fixes for x86 and objtool:

  objtool:

   - Ignore the double UD2 which is emitted in BUG() when
     CONFIG_UBSAN_TRAP is enabled.

   - Support clang non-section symbols in objtool ORC dump

   - Fix switch table detection in .text.unlikely

   - Make the BP scratch register warning more robust.

  x86:

   - Increase microcode maximum patch size for AMD to cope with new CPUs
     which have a larger patch size.

   - Fix a crash in the resource control filesystem when the removal of
     the default resource group is attempted.

   - Preserve Code and Data Prioritization enabled state accross CPU
     hotplug.

   - Update split lock cpu matching to use the new X86_MATCH macros.

   - Change the split lock enumeration as Intel finaly decided that the
     IA32_CORE_CAPABILITIES bits are not architectural contrary to what
     the SDM claims. !@#%$^!

   - Add Tremont CPU models to the split lock detection cpu match.

   - Add a missing static attribute to make sparse happy"

* tag 'x86-urgent-2020-04-19' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
  x86/split_lock: Add Tremont family CPU models
  x86/split_lock: Bits in IA32_CORE_CAPABILITIES are not architectural
  x86/resctrl: Preserve CDP enable over CPU hotplug
  x86/resctrl: Fix invalid attempt at removing the default resource group
  x86/split_lock: Update to use X86_MATCH_INTEL_FAM6_MODEL()
  x86/umip: Make umip_insns static
  x86/microcode/AMD: Increase microcode PATCH_MAX_SIZE
  objtool: Make BP scratch register warning more robust
  objtool: Fix switch table detection in .text.unlikely
  objtool: Support Clang non-section symbols in ORC generation
  objtool: Support Clang non-section symbols in ORC dump
  objtool: Fix CONFIG_UBSAN_TRAP unreachable warnings
parents 3e0dea57 8b9a18a9
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -41,7 +41,7 @@ struct microcode_amd {
	unsigned int			mpb[0];
};

#define PATCH_MAX_SIZE PAGE_SIZE
#define PATCH_MAX_SIZE (3 * PAGE_SIZE)

#ifdef CONFIG_MICROCODE_AMD
extern void __init load_ucode_amd_bsp(unsigned int family);
+36 −18
Original line number Diff line number Diff line
@@ -1119,35 +1119,53 @@ void switch_to_sld(unsigned long tifn)
	sld_update_msr(!(tifn & _TIF_SLD));
}

#define SPLIT_LOCK_CPU(model) {X86_VENDOR_INTEL, 6, model, X86_FEATURE_ANY}

/*
 * The following processors have the split lock detection feature. But
 * since they don't have the IA32_CORE_CAPABILITIES MSR, the feature cannot
 * be enumerated. Enable it by family and model matching on these
 * processors.
 * Bits in the IA32_CORE_CAPABILITIES are not architectural, so they should
 * only be trusted if it is confirmed that a CPU model implements a
 * specific feature at a particular bit position.
 *
 * The possible driver data field values:
 *
 * - 0: CPU models that are known to have the per-core split-lock detection
 *	feature even though they do not enumerate IA32_CORE_CAPABILITIES.
 *
 * - 1: CPU models which may enumerate IA32_CORE_CAPABILITIES and if so use
 *      bit 5 to enumerate the per-core split-lock detection feature.
 */
static const struct x86_cpu_id split_lock_cpu_ids[] __initconst = {
	SPLIT_LOCK_CPU(INTEL_FAM6_ICELAKE_X),
	SPLIT_LOCK_CPU(INTEL_FAM6_ICELAKE_L),
	X86_MATCH_INTEL_FAM6_MODEL(ICELAKE_X,		0),
	X86_MATCH_INTEL_FAM6_MODEL(ICELAKE_L,		0),
	X86_MATCH_INTEL_FAM6_MODEL(ATOM_TREMONT,	1),
	X86_MATCH_INTEL_FAM6_MODEL(ATOM_TREMONT_D,	1),
	X86_MATCH_INTEL_FAM6_MODEL(ATOM_TREMONT_L,	1),
	{}
};

void __init cpu_set_core_cap_bits(struct cpuinfo_x86 *c)
{
	u64 ia32_core_caps = 0;
	const struct x86_cpu_id *m;
	u64 ia32_core_caps;

	if (c->x86_vendor != X86_VENDOR_INTEL)
	if (boot_cpu_has(X86_FEATURE_HYPERVISOR))
		return;

	m = x86_match_cpu(split_lock_cpu_ids);
	if (!m)
		return;

	switch (m->driver_data) {
	case 0:
		break;
	case 1:
		if (!cpu_has(c, X86_FEATURE_CORE_CAPABILITIES))
			return;
	if (cpu_has(c, X86_FEATURE_CORE_CAPABILITIES)) {
		/* Enumerate features reported in IA32_CORE_CAPABILITIES MSR. */
		rdmsrl(MSR_IA32_CORE_CAPS, ia32_core_caps);
	} else if (!boot_cpu_has(X86_FEATURE_HYPERVISOR)) {
		/* Enumerate split lock detection by family and model. */
		if (x86_match_cpu(split_lock_cpu_ids))
			ia32_core_caps |= MSR_IA32_CORE_CAPS_SPLIT_LOCK_DETECT;
		if (!(ia32_core_caps & MSR_IA32_CORE_CAPS_SPLIT_LOCK_DETECT))
			return;
		break;
	default:
		return;
	}

	if (ia32_core_caps & MSR_IA32_CORE_CAPS_SPLIT_LOCK_DETECT)
	split_lock_setup();
}
+2 −0
Original line number Diff line number Diff line
@@ -578,6 +578,8 @@ static void domain_add_cpu(int cpu, struct rdt_resource *r)
	d->id = id;
	cpumask_set_cpu(cpu, &d->cpu_mask);

	rdt_domain_reconfigure_cdp(r);

	if (r->alloc_capable && domain_setup_ctrlval(r, d)) {
		kfree(d);
		return;
+1 −0
Original line number Diff line number Diff line
@@ -601,5 +601,6 @@ bool has_busy_rmid(struct rdt_resource *r, struct rdt_domain *d);
void __check_limbo(struct rdt_domain *d, bool force_free);
bool cbm_validate_intel(char *buf, u32 *data, struct rdt_resource *r);
bool cbm_validate_amd(char *buf, u32 *data, struct rdt_resource *r);
void rdt_domain_reconfigure_cdp(struct rdt_resource *r);

#endif /* _ASM_X86_RESCTRL_INTERNAL_H */
+15 −1
Original line number Diff line number Diff line
@@ -1859,6 +1859,19 @@ static int set_cache_qos_cfg(int level, bool enable)
	return 0;
}

/* Restore the qos cfg state when a domain comes online */
void rdt_domain_reconfigure_cdp(struct rdt_resource *r)
{
	if (!r->alloc_capable)
		return;

	if (r == &rdt_resources_all[RDT_RESOURCE_L2DATA])
		l2_qos_cfg_update(&r->alloc_enabled);

	if (r == &rdt_resources_all[RDT_RESOURCE_L3DATA])
		l3_qos_cfg_update(&r->alloc_enabled);
}

/*
 * Enable or disable the MBA software controller
 * which helps user specify bandwidth in MBps.
@@ -3072,7 +3085,8 @@ static int rdtgroup_rmdir(struct kernfs_node *kn)
	 * If the rdtgroup is a mon group and parent directory
	 * is a valid "mon_groups" directory, remove the mon group.
	 */
	if (rdtgrp->type == RDTCTRL_GROUP && parent_kn == rdtgroup_default.kn) {
	if (rdtgrp->type == RDTCTRL_GROUP && parent_kn == rdtgroup_default.kn &&
	    rdtgrp != &rdtgroup_default) {
		if (rdtgrp->mode == RDT_MODE_PSEUDO_LOCKSETUP ||
		    rdtgrp->mode == RDT_MODE_PSEUDO_LOCKED) {
			ret = rdtgroup_ctrl_remove(kn, rdtgrp);
Loading