Skip to content

Commit 6c4f5ab

Browse files
ssuthiku-amdKAGA-KOKO
authored andcommitted
x86/CPU: Modify detect_extended_topology() to return result
Current implementation does not communicate whether it can successfully detect CPUID function 0xB information. Therefore, modify the function to return success or error codes. This will be used by subsequent patches. Signed-off-by: Suravee Suthikulpanit <[email protected]> Signed-off-by: Borislav Petkov <[email protected]> Signed-off-by: Thomas Gleixner <[email protected]> Reviewed-by: Borislav Petkov <[email protected]> Link: http://lkml.kernel.org/r/[email protected]
1 parent 68091ee commit 6c4f5ab

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

arch/x86/include/asm/processor.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ extern u32 get_scattered_cpuid_leaf(unsigned int level,
193193
extern unsigned int init_intel_cacheinfo(struct cpuinfo_x86 *c);
194194
extern void init_amd_cacheinfo(struct cpuinfo_x86 *c);
195195

196-
extern void detect_extended_topology(struct cpuinfo_x86 *c);
196+
extern int detect_extended_topology(struct cpuinfo_x86 *c);
197197
extern void detect_ht(struct cpuinfo_x86 *c);
198198

199199
#ifdef CONFIG_X86_32

arch/x86/kernel/cpu/topology.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
* exists, use it for populating initial_apicid and cpu topology
2828
* detection.
2929
*/
30-
void detect_extended_topology(struct cpuinfo_x86 *c)
30+
int detect_extended_topology(struct cpuinfo_x86 *c)
3131
{
3232
#ifdef CONFIG_SMP
3333
unsigned int eax, ebx, ecx, edx, sub_index;
@@ -36,15 +36,15 @@ void detect_extended_topology(struct cpuinfo_x86 *c)
3636
static bool printed;
3737

3838
if (c->cpuid_level < 0xb)
39-
return;
39+
return -1;
4040

4141
cpuid_count(0xb, SMT_LEVEL, &eax, &ebx, &ecx, &edx);
4242

4343
/*
4444
* check if the cpuid leaf 0xb is actually implemented.
4545
*/
4646
if (ebx == 0 || (LEAFB_SUBTYPE(ecx) != SMT_TYPE))
47-
return;
47+
return -1;
4848

4949
set_cpu_cap(c, X86_FEATURE_XTOPOLOGY);
5050

@@ -95,6 +95,6 @@ void detect_extended_topology(struct cpuinfo_x86 *c)
9595
c->cpu_core_id);
9696
printed = 1;
9797
}
98-
return;
9998
#endif
99+
return 0;
100100
}

0 commit comments

Comments
 (0)