Skip to content

Commit 3e9679a

Browse files
committed
Merge branch 'x86-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull x86 fixes from Ingo Molnar: "Three fixes, a hw-enablement and a cross-arch fix/enablement change: - SGI/UV fix for older platforms - x32 signal handling fix - older x86 platform bootup APIC fix - AVX512-4VNNIW (Neural Network Instructions) and AVX512-4FMAPS (Multiply Accumulation Single precision instructions) enablement. - move thread_info back into x86 specific code, to make life easier for other architectures trying to make use of CONFIG_THREAD_INFO_IN_TASK_STRUCT=y" * 'x86-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: x86/boot/smp: Don't try to poke disabled/non-existent APIC sched/core, x86: Make struct thread_info arch specific again x86/signal: Remove bogus user_64bit_mode() check from sigaction_compat_abi() x86/platform/UV: Fix support for EFI_OLD_MEMMAP after BIOS callback updates x86/cpufeature: Add AVX512_4VNNIW and AVX512_4FMAPS features x86/vmware: Skip timer_irq_works() check on VMware
2 parents 86c5bf7 + ff85605 commit 3e9679a

10 files changed

Lines changed: 40 additions & 22 deletions

File tree

arch/x86/include/asm/cpufeatures.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -194,6 +194,8 @@
194194
#define X86_FEATURE_PROC_FEEDBACK ( 7*32+ 9) /* AMD ProcFeedbackInterface */
195195

196196
#define X86_FEATURE_INTEL_PT ( 7*32+15) /* Intel Processor Trace */
197+
#define X86_FEATURE_AVX512_4VNNIW (7*32+16) /* AVX-512 Neural Network Instructions */
198+
#define X86_FEATURE_AVX512_4FMAPS (7*32+17) /* AVX-512 Multiply Accumulation Single precision */
197199

198200
/* Virtualization flags: Linux defined, word 8 */
199201
#define X86_FEATURE_TPR_SHADOW ( 8*32+ 0) /* Intel TPR Shadow */

arch/x86/include/asm/thread_info.h

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,15 @@ struct task_struct;
5252
#include <asm/cpufeature.h>
5353
#include <linux/atomic.h>
5454

55+
struct thread_info {
56+
unsigned long flags; /* low level flags */
57+
};
58+
59+
#define INIT_THREAD_INFO(tsk) \
60+
{ \
61+
.flags = 0, \
62+
}
63+
5564
#define init_stack (init_thread_union.stack)
5665

5766
#else /* !__ASSEMBLY__ */

arch/x86/kernel/cpu/scattered.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@ void init_scattered_cpuid_features(struct cpuinfo_x86 *c)
3232

3333
static const struct cpuid_bit cpuid_bits[] = {
3434
{ X86_FEATURE_INTEL_PT, CR_EBX,25, 0x00000007, 0 },
35+
{ X86_FEATURE_AVX512_4VNNIW, CR_EDX, 2, 0x00000007, 0 },
36+
{ X86_FEATURE_AVX512_4FMAPS, CR_EDX, 3, 0x00000007, 0 },
3537
{ X86_FEATURE_APERFMPERF, CR_ECX, 0, 0x00000006, 0 },
3638
{ X86_FEATURE_EPB, CR_ECX, 3, 0x00000006, 0 },
3739
{ X86_FEATURE_HW_PSTATE, CR_EDX, 7, 0x80000007, 0 },

arch/x86/kernel/cpu/vmware.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
#include <asm/div64.h>
2828
#include <asm/x86_init.h>
2929
#include <asm/hypervisor.h>
30+
#include <asm/timer.h>
3031
#include <asm/apic.h>
3132

3233
#define CPUID_VMWARE_INFO_LEAF 0x40000000
@@ -94,6 +95,10 @@ static void __init vmware_platform_setup(void)
9495
} else {
9596
pr_warn("Failed to get TSC freq from the hypervisor\n");
9697
}
98+
99+
#ifdef CONFIG_X86_IO_APIC
100+
no_timer_check = 1;
101+
#endif
97102
}
98103

99104
/*

arch/x86/kernel/fpu/xstate.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,8 @@ void fpu__xstate_clear_all_cpu_caps(void)
7474
setup_clear_cpu_cap(X86_FEATURE_MPX);
7575
setup_clear_cpu_cap(X86_FEATURE_XGETBV1);
7676
setup_clear_cpu_cap(X86_FEATURE_PKU);
77+
setup_clear_cpu_cap(X86_FEATURE_AVX512_4VNNIW);
78+
setup_clear_cpu_cap(X86_FEATURE_AVX512_4FMAPS);
7779
}
7880

7981
/*

arch/x86/kernel/signal_compat.c

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -105,9 +105,6 @@ void sigaction_compat_abi(struct k_sigaction *act, struct k_sigaction *oact)
105105
/* Don't let flags to be set from userspace */
106106
act->sa.sa_flags &= ~(SA_IA32_ABI | SA_X32_ABI);
107107

108-
if (user_64bit_mode(current_pt_regs()))
109-
return;
110-
111108
if (in_ia32_syscall())
112109
act->sa.sa_flags |= SA_IA32_ABI;
113110
if (in_x32_syscall())

arch/x86/kernel/smpboot.c

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1409,15 +1409,17 @@ __init void prefill_possible_map(void)
14091409

14101410
/* No boot processor was found in mptable or ACPI MADT */
14111411
if (!num_processors) {
1412-
int apicid = boot_cpu_physical_apicid;
1413-
int cpu = hard_smp_processor_id();
1412+
if (boot_cpu_has(X86_FEATURE_APIC)) {
1413+
int apicid = boot_cpu_physical_apicid;
1414+
int cpu = hard_smp_processor_id();
14141415

1415-
pr_warn("Boot CPU (id %d) not listed by BIOS\n", cpu);
1416+
pr_warn("Boot CPU (id %d) not listed by BIOS\n", cpu);
14161417

1417-
/* Make sure boot cpu is enumerated */
1418-
if (apic->cpu_present_to_apicid(0) == BAD_APICID &&
1419-
apic->apic_id_valid(apicid))
1420-
generic_processor_info(apicid, boot_cpu_apic_version);
1418+
/* Make sure boot cpu is enumerated */
1419+
if (apic->cpu_present_to_apicid(0) == BAD_APICID &&
1420+
apic->apic_id_valid(apicid))
1421+
generic_processor_info(apicid, boot_cpu_apic_version);
1422+
}
14211423

14221424
if (!num_processors)
14231425
num_processors = 1;

arch/x86/platform/uv/bios_uv.c

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,15 @@ s64 uv_bios_call(enum uv_bios_cmd which, u64 a1, u64 a2, u64 a3, u64 a4, u64 a5)
4040
*/
4141
return BIOS_STATUS_UNIMPLEMENTED;
4242

43-
ret = efi_call_virt_pointer(tab, function, (u64)which, a1, a2, a3, a4, a5);
43+
/*
44+
* If EFI_OLD_MEMMAP is set, we need to fall back to using our old EFI
45+
* callback method, which uses efi_call() directly, with the kernel page tables:
46+
*/
47+
if (unlikely(test_bit(EFI_OLD_MEMMAP, &efi.flags)))
48+
ret = efi_call((void *)__va(tab->function), (u64)which, a1, a2, a3, a4, a5);
49+
else
50+
ret = efi_call_virt_pointer(tab, function, (u64)which, a1, a2, a3, a4, a5);
51+
4452
return ret;
4553
}
4654
EXPORT_SYMBOL_GPL(uv_bios_call);

include/linux/thread_info.h

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -13,17 +13,6 @@
1313
struct timespec;
1414
struct compat_timespec;
1515

16-
#ifdef CONFIG_THREAD_INFO_IN_TASK
17-
struct thread_info {
18-
unsigned long flags; /* low level flags */
19-
};
20-
21-
#define INIT_THREAD_INFO(tsk) \
22-
{ \
23-
.flags = 0, \
24-
}
25-
#endif
26-
2716
#ifdef CONFIG_THREAD_INFO_IN_TASK
2817
#define current_thread_info() ((struct thread_info *)current)
2918
#endif

tools/arch/x86/include/asm/cpufeatures.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -194,6 +194,8 @@
194194
#define X86_FEATURE_PROC_FEEDBACK ( 7*32+ 9) /* AMD ProcFeedbackInterface */
195195

196196
#define X86_FEATURE_INTEL_PT ( 7*32+15) /* Intel Processor Trace */
197+
#define X86_FEATURE_AVX512_4VNNIW (7*32+16) /* AVX-512 Neural Network Instructions */
198+
#define X86_FEATURE_AVX512_4FMAPS (7*32+17) /* AVX-512 Multiply Accumulation Single precision */
197199

198200
/* Virtualization flags: Linux defined, word 8 */
199201
#define X86_FEATURE_TPR_SHADOW ( 8*32+ 0) /* Intel TPR Shadow */

0 commit comments

Comments
 (0)