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)
Sun, Jun 29, 5:55 PM
Unknown Object (File)
Fri, Jun 27, 3:20 PM
Unknown Object (File)
Thu, Jun 26, 8:05 AM
Unknown Object (File)
Sun, Jun 22, 6:36 PM
Unknown Object (File)
Sat, Jun 21, 8:26 AM
Unknown Object (File)
Wed, Jun 18, 2:25 AM
Unknown Object (File)
Fri, Jun 13, 1:09 AM
Unknown Object (File)
Wed, Jun 11, 2:26 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

Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 29782
Build 27616: arc lint + arc unit

Event Timeline

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

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.