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
F133658946: D23958.id69212.diff
Mon, Oct 27, 8:39 AM
Unknown Object (File)
Fri, Oct 24, 5:49 AM
Unknown Object (File)
Fri, Oct 24, 5:25 AM
Unknown Object (File)
Fri, Oct 24, 1:00 AM
Unknown Object (File)
Thu, Oct 23, 2:41 AM
Unknown Object (File)
Sun, Oct 19, 9:08 AM
Unknown Object (File)
Sun, Oct 19, 9:08 AM
Unknown Object (File)
Sun, Oct 19, 9:08 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.