Re: [PATCH v2 05/17] x86/cpu/intel: Fix page copy performance for extended Families

From: Dave Hansen
Date: Tue Feb 11 2025 - 15:53:28 EST


On 2/11/25 11:43, Sohil Mehta wrote:
> + /*
> + * Modern CPUs are generally expected to have a sane fast string
> + * implementation. However, the BIOS may disable it on certain CPUs
> + * via the architectural FAST_STRING bit.
> + */
> + if (IS_ENABLED(CONFIG_X86_64) && (c->x86 == 6 || c->x86 > 15))
> + set_cpu_cap(c, X86_FEATURE_REP_GOOD);

I'm not sure the BIOS comment is helpful here.

Also, at this point, let's just make the check >=6 (or the >=PPRO
equivalent).

It will only matter if *all* of these are true:
1. Someone has a 64-bit capable P4 that powers on
2. They're running a 64-bit mainline kernel
3. String copy is *actually* slower than the alternative
4. They are performance sensitive enough to notice

We don't even know the answer to #3 for sure. Let's just say what we're
doing in a comment:

/* Assume that any 64-bit CPU has a good implementation */