Re: [tip: x86/urgent] x86/cpu: Provide default cache line size if not enumerated

From: Jörn Heusipp
Date: Thu May 30 2024 - 11:08:30 EST



Hello Dave!

On 30/05/2024 16:23, tip-bot2 for Dave Hansen wrote:
The following commit has been merged into the x86/urgent branch of tip:

Commit-ID: b9210e56d71d9deb1ad692e405f6b2394f7baa4d
Gitweb: https://git.kernel.org/tip/b9210e56d71d9deb1ad692e405f6b2394f7baa4d
Author: Dave Hansen <dave.hansen@xxxxxxxxxxxxxxx>
AuthorDate: Fri, 17 May 2024 13:05:34 -07:00
Committer: Dave Hansen <dave.hansen@xxxxxxxxxxxxxxx>
CommitterDate: Thu, 30 May 2024 07:14:27 -07:00

Tested-by: Jörn Heusipp <osmanx@xxxxxxxxxx>

diff --git a/arch/x86/kernel/cpu/common.c b/arch/x86/kernel/cpu/common.c
index 2b170da..373b16b 100644
--- a/arch/x86/kernel/cpu/common.c
+++ b/arch/x86/kernel/cpu/common.c
@@ -1070,6 +1070,10 @@ void get_cpu_address_sizes(struct cpuinfo_x86 *c)
cpu_has(c, X86_FEATURE_PSE36))
c->x86_phys_bits = 36;
}
+
+ /* Provide a sane default if not enumerated: */
+ if (!c->x86_clflush_size)
+ c->x86_clflush_size = 32;
} else {
cpuid(0x80000008, &eax, &ebx, &ecx, &edx);


That honestly looks like a mis-merge to me. This is not what I did test.
x86_clflush_size needs to get set in the top-level else branch in which
it is not already set. commit 95bfb35269b2e85cff0dd2c957b2d42ebf95ae5f
had switched the if branches around.

Best regards,
Jörn