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)
Fri, Apr 18, 8:45 PM
Unknown Object (File)
Mon, Mar 31, 2:55 PM
Unknown Object (File)
Sun, Mar 30, 8:27 AM
Unknown Object (File)
Mar 8 2025, 3:29 PM
Unknown Object (File)
Feb 26 2025, 9:49 PM
Unknown Object (File)
Feb 21 2025, 10:13 PM
Unknown Object (File)
Feb 19 2025, 4:03 AM
Unknown Object (File)
Jan 26 2025, 3:56 AM
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

Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 29783
Build 27617: arc lint + arc unit

Event Timeline

lib/libc/powerpc64/string/bcopy_resolver.c
64–69

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.