Page MenuHomeFreeBSD

[PowerPC64] restrict memcpy/bcopy optimization to POWER ISA >=V2.07
ClosedPublic

Authored by alfredo on Mar 4 2020, 5:50 PM.
Referenced Files
Unknown Object (File)
Nov 3 2024, 5:04 PM
Unknown Object (File)
Oct 2 2024, 5:34 AM
Unknown Object (File)
Oct 1 2024, 2:45 PM
Unknown Object (File)
Sep 30 2024, 4:49 AM
Unknown Object (File)
Sep 21 2024, 5:49 AM
Unknown Object (File)
Sep 20 2024, 1:22 PM
Unknown Object (File)
Sep 19 2024, 4:57 AM
Unknown Object (File)
Sep 8 2024, 10:40 PM
Subscribers

Details

Summary

VSX instructions were added in POWER ISA V2.06 (POWER7), but it requires data to be word-aligned. Such requirement was removed in ISA V2.07B (POWER8).

Since current memcpy/bcopy optimization relies on VSX instructions handling misalignment transparently, and kernel doesn't currently implement an alignment error handler, we should restrict this to ISA V2.07 onwards.

SIGBUS on stxvd2x instruction was reproduced in POWER7+ CPU.

Test Plan

Buildworld and chroot
Installworld and reboot

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

lib/libc/powerpc64/string/bcopy_resolver.c
64 ↗(On Diff #69165)

Perhaps put a comment here explaining why this was chosen, so nobody's tempted to change it back to PPC_FEATURE_HAS_VSX a couple years down the road when we've forgotten this.

This revision is now accepted and ready to land.Mar 4 2020, 5:57 PM

Looks fine to me as well.