diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2018-12-26 20:35:41 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2018-12-26 20:35:41 -0500 |
commit | db2ab474c4a434872e1794c2af8b2e561caa756e (patch) | |
tree | b2edb128f38e0a799508e2cd390d802f2d944ceb | |
parent | 312a466155108329c458049dc76a21ad56106960 (diff) | |
parent | aa02ef099cff042c2a9109782ec2bf1bffc955d4 (diff) |
Merge branch 'x86-cpu-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull x86 cpu updates from Ingo Molnar:
"Misc changes:
- Fix nr_cpus= boot option interaction bug with logical package
management
- Clean up UMIP detection messages
- Add WBNOINVD instruction detection
- Remove the unused get_scattered_cpuid_leaf() function"
* 'x86-cpu-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
x86/topology: Use total_cpus for max logical packages calculation
x86/umip: Make the UMIP activated message generic
x86/umip: Print UMIP line only once
x86/cpufeatures: Add WBNOINVD feature definition
x86/cpufeatures: Remove get_scattered_cpuid_leaf()
-rw-r--r-- | arch/x86/kernel/cpu/common.c | 2 | ||||
-rw-r--r-- | arch/x86/kernel/cpu/cpu.h | 3 | ||||
-rw-r--r-- | arch/x86/kernel/cpu/scattered.c | 24 | ||||
-rw-r--r-- | arch/x86/kernel/smpboot.c | 2 |
4 files changed, 2 insertions, 29 deletions
diff --git a/arch/x86/kernel/cpu/common.c b/arch/x86/kernel/cpu/common.c index ffb181f959d2..cb28e98a0659 100644 --- a/arch/x86/kernel/cpu/common.c +++ b/arch/x86/kernel/cpu/common.c | |||
@@ -353,7 +353,7 @@ static __always_inline void setup_umip(struct cpuinfo_x86 *c) | |||
353 | 353 | ||
354 | cr4_set_bits(X86_CR4_UMIP); | 354 | cr4_set_bits(X86_CR4_UMIP); |
355 | 355 | ||
356 | pr_info("x86/cpu: Activated the Intel User Mode Instruction Prevention (UMIP) CPU feature\n"); | 356 | pr_info_once("x86/cpu: User Mode Instruction Prevention (UMIP) activated\n"); |
357 | 357 | ||
358 | return; | 358 | return; |
359 | 359 | ||
diff --git a/arch/x86/kernel/cpu/cpu.h b/arch/x86/kernel/cpu/cpu.h index da5446acc241..5eb946b9a9f3 100644 --- a/arch/x86/kernel/cpu/cpu.h +++ b/arch/x86/kernel/cpu/cpu.h | |||
@@ -49,9 +49,6 @@ extern void get_cpu_cap(struct cpuinfo_x86 *c); | |||
49 | extern void get_cpu_address_sizes(struct cpuinfo_x86 *c); | 49 | extern void get_cpu_address_sizes(struct cpuinfo_x86 *c); |
50 | extern void cpu_detect_cache_sizes(struct cpuinfo_x86 *c); | 50 | extern void cpu_detect_cache_sizes(struct cpuinfo_x86 *c); |
51 | extern void init_scattered_cpuid_features(struct cpuinfo_x86 *c); | 51 | extern void init_scattered_cpuid_features(struct cpuinfo_x86 *c); |
52 | extern u32 get_scattered_cpuid_leaf(unsigned int level, | ||
53 | unsigned int sub_leaf, | ||
54 | enum cpuid_regs_idx reg); | ||
55 | extern void init_intel_cacheinfo(struct cpuinfo_x86 *c); | 52 | extern void init_intel_cacheinfo(struct cpuinfo_x86 *c); |
56 | extern void init_amd_cacheinfo(struct cpuinfo_x86 *c); | 53 | extern void init_amd_cacheinfo(struct cpuinfo_x86 *c); |
57 | extern void init_hygon_cacheinfo(struct cpuinfo_x86 *c); | 54 | extern void init_hygon_cacheinfo(struct cpuinfo_x86 *c); |
diff --git a/arch/x86/kernel/cpu/scattered.c b/arch/x86/kernel/cpu/scattered.c index 0277267239f2..94aa1c72ca98 100644 --- a/arch/x86/kernel/cpu/scattered.c +++ b/arch/x86/kernel/cpu/scattered.c | |||
@@ -62,27 +62,3 @@ void init_scattered_cpuid_features(struct cpuinfo_x86 *c) | |||
62 | set_cpu_cap(c, cb->feature); | 62 | set_cpu_cap(c, cb->feature); |
63 | } | 63 | } |
64 | } | 64 | } |
65 | |||
66 | u32 get_scattered_cpuid_leaf(unsigned int level, unsigned int sub_leaf, | ||
67 | enum cpuid_regs_idx reg) | ||
68 | { | ||
69 | const struct cpuid_bit *cb; | ||
70 | u32 cpuid_val = 0; | ||
71 | |||
72 | for (cb = cpuid_bits; cb->feature; cb++) { | ||
73 | |||
74 | if (level > cb->level) | ||
75 | continue; | ||
76 | |||
77 | if (level < cb->level) | ||
78 | break; | ||
79 | |||
80 | if (reg == cb->reg && sub_leaf == cb->sub_leaf) { | ||
81 | if (cpu_has(&boot_cpu_data, cb->feature)) | ||
82 | cpuid_val |= BIT(cb->bit); | ||
83 | } | ||
84 | } | ||
85 | |||
86 | return cpuid_val; | ||
87 | } | ||
88 | EXPORT_SYMBOL_GPL(get_scattered_cpuid_leaf); | ||
diff --git a/arch/x86/kernel/smpboot.c b/arch/x86/kernel/smpboot.c index a9134d1910b9..ccd1f2a8e557 100644 --- a/arch/x86/kernel/smpboot.c +++ b/arch/x86/kernel/smpboot.c | |||
@@ -1347,7 +1347,7 @@ void __init calculate_max_logical_packages(void) | |||
1347 | * extrapolate the boot cpu's data to all packages. | 1347 | * extrapolate the boot cpu's data to all packages. |
1348 | */ | 1348 | */ |
1349 | ncpus = cpu_data(0).booted_cores * topology_max_smt_threads(); | 1349 | ncpus = cpu_data(0).booted_cores * topology_max_smt_threads(); |
1350 | __max_logical_packages = DIV_ROUND_UP(nr_cpu_ids, ncpus); | 1350 | __max_logical_packages = DIV_ROUND_UP(total_cpus, ncpus); |
1351 | pr_info("Max logical packages: %u\n", __max_logical_packages); | 1351 | pr_info("Max logical packages: %u\n", __max_logical_packages); |
1352 | } | 1352 | } |
1353 | 1353 | ||