diff options
Diffstat (limited to 'arch/x86/kernel/apic/apic.c')
| -rw-r--r-- | arch/x86/kernel/apic/apic.c | 23 | 
1 files changed, 22 insertions, 1 deletions
| diff --git a/arch/x86/kernel/apic/apic.c b/arch/x86/kernel/apic/apic.c index 2aabd4cb0e3f..84132eddb5a8 100644 --- a/arch/x86/kernel/apic/apic.c +++ b/arch/x86/kernel/apic/apic.c @@ -56,6 +56,7 @@  #include <asm/hypervisor.h>  #include <asm/cpu_device_id.h>  #include <asm/intel-family.h> +#include <asm/irq_regs.h>  unsigned int num_processors; @@ -573,6 +574,9 @@ static u32 skx_deadline_rev(void)  	case 0x04: return 0x02000014;  	} +	if (boot_cpu_data.x86_stepping > 4) +		return 0; +  	return ~0U;  } @@ -937,7 +941,7 @@ static int __init calibrate_APIC_clock(void)  	if (levt->features & CLOCK_EVT_FEAT_DUMMY) {  		pr_warning("APIC timer disabled due to verification failure\n"); -			return -1; +		return -1;  	}  	return 0; @@ -2189,6 +2193,23 @@ static int cpuid_to_apicid[] = {  	[0 ... NR_CPUS - 1] = -1,  }; +#ifdef CONFIG_SMP +/** + * apic_id_is_primary_thread - Check whether APIC ID belongs to a primary thread + * @id:	APIC ID to check + */ +bool apic_id_is_primary_thread(unsigned int apicid) +{ +	u32 mask; + +	if (smp_num_siblings == 1) +		return true; +	/* Isolate the SMT bit(s) in the APICID and check for 0 */ +	mask = (1U << (fls(smp_num_siblings) - 1)) - 1; +	return !(apicid & mask); +} +#endif +  /*   * Should use this API to allocate logical CPU IDs to keep nr_logical_cpuids   * and cpuid_to_apicid[] synchronized. |