Skip to content

Commit 7e67f36

Browse files
sohilmehIngo Molnar
authored andcommitted
x86/cpu/intel: Fix the MOVSL alignment preference for extended Families
The alignment preference for 32-bit MOVSL based bulk memory move has been 8-byte for a long time. However this preference is only set for Family 6 and 15 processors. Use the same preference for upcoming Family numbers 18 and 19. Also, use a simpler VFM based check instead of switching based on Family numbers. Refresh the comment to reflect the new check. Signed-off-by: Sohil Mehta <[email protected]> Signed-off-by: Ingo Molnar <[email protected]> Acked-by: Dave Hansen <[email protected]> Cc: Andy Lutomirski <[email protected]> Cc: Brian Gerst <[email protected]> Cc: Juergen Gross <[email protected]> Cc: H. Peter Anvin <[email protected]> Cc: Linus Torvalds <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent 680d9b2 commit 7e67f36

File tree

1 file changed

+6
-13
lines changed

1 file changed

+6
-13
lines changed

arch/x86/kernel/cpu/intel.c

Lines changed: 6 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -440,23 +440,16 @@ static void intel_workarounds(struct cpuinfo_x86 *c)
440440
(c->x86_stepping < 0x6 || c->x86_stepping == 0xb))
441441
set_cpu_bug(c, X86_BUG_11AP);
442442

443-
444443
#ifdef CONFIG_X86_INTEL_USERCOPY
445444
/*
446-
* Set up the preferred alignment for movsl bulk memory moves
445+
* MOVSL bulk memory moves can be slow when source and dest are not
446+
* both 8-byte aligned. PII/PIII only like MOVSL with 8-byte alignment.
447+
*
448+
* Set the preferred alignment for Pentium Pro and newer processors, as
449+
* it has only been tested on these.
447450
*/
448-
switch (c->x86) {
449-
case 4: /* 486: untested */
450-
break;
451-
case 5: /* Old Pentia: untested */
452-
break;
453-
case 6: /* PII/PIII only like movsl with 8-byte alignment */
451+
if (c->x86_vfm >= INTEL_PENTIUM_PRO)
454452
movsl_mask.mask = 7;
455-
break;
456-
case 15: /* P4 is OK down to 8-byte alignment */
457-
movsl_mask.mask = 7;
458-
break;
459-
}
460453
#endif
461454

462455
intel_smp_check(c);

0 commit comments

Comments
 (0)