Skip to content

Commit

Permalink
x86/cpu: Remove pointless evaluation of x86_coreid_bits
Browse files Browse the repository at this point in the history
cpuinfo_x86::x86_coreid_bits is only used by the AMD numa topology code. No
point in evaluating it on non AMD systems.

No functional change.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Tested-by: Juergen Gross <jgross@suse.com>
Tested-by: Sohil Mehta <sohil.mehta@intel.com>
Tested-by: Michael Kelley <mikelley@microsoft.com>
Tested-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Tested-by: Zhang Rui <rui.zhang@intel.com>
Reviewed-by: Arjan van de Ven <arjan@linux.intel.com>
Acked-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Link: https://lore.kernel.org/r/20230814085112.687588373@linutronix.de
  • Loading branch information
KAGA-KOKO committed Oct 10, 2023
1 parent e3c0c5d commit 594957d
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 27 deletions.
13 changes: 0 additions & 13 deletions arch/x86/kernel/cpu/intel.c
Original file line number Diff line number Diff line change
Expand Up @@ -314,19 +314,6 @@ static void early_init_intel(struct cpuinfo_x86 *c)
setup_clear_cpu_cap(X86_FEATURE_PGE);
}

if (c->cpuid_level >= 0x00000001) {
u32 eax, ebx, ecx, edx;

cpuid(0x00000001, &eax, &ebx, &ecx, &edx);
/*
* If HTT (EDX[28]) is set EBX[16:23] contain the number of
* apicids which are reserved per package. Store the resulting
* shift value for the package management code.
*/
if (edx & (1U << 28))
c->x86_coreid_bits = get_count_order((ebx >> 16) & 0xff);
}

check_memory_type_self_snoop_errata(c);

/*
Expand Down
14 changes: 0 additions & 14 deletions arch/x86/kernel/cpu/zhaoxin.c
Original file line number Diff line number Diff line change
Expand Up @@ -65,20 +65,6 @@ static void early_init_zhaoxin(struct cpuinfo_x86 *c)
set_cpu_cap(c, X86_FEATURE_CONSTANT_TSC);
set_cpu_cap(c, X86_FEATURE_NONSTOP_TSC);
}

if (c->cpuid_level >= 0x00000001) {
u32 eax, ebx, ecx, edx;

cpuid(0x00000001, &eax, &ebx, &ecx, &edx);
/*
* If HTT (EDX[28]) is set EBX[16:23] contain the number of
* apicids which are reserved per package. Store the resulting
* shift value for the package management code.
*/
if (edx & (1U << 28))
c->x86_coreid_bits = get_count_order((ebx >> 16) & 0xff);
}

}

static void init_zhaoxin(struct cpuinfo_x86 *c)
Expand Down

0 comments on commit 594957d

Please sign in to comment.