Page MenuHomeFreeBSD

powerpc: Use IFUNCs for copyin/copyout/etc
ClosedPublic

Authored by jhibbits on Jun 4 2020, 4:33 PM.

Details

Summary

Radix on AIM, and all of Book-E (currently), can do direct addressing of
user space, instead of needing to map user addresses into kernel space.
Take advantage of this to optimize the copy(9) functions for this
behavior, and avoid effectively NOP translations.

Test Plan

Tested on powerpcspe, powerpc64/booke, powerpc64/AIM

Diff Detail

Repository
rS FreeBSD src repository
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

jhibbits created this revision.

Fix booke, which doesn't use ifuncs for copyin/copyout. Use a "naked function"
definition instead, since it's really treated as a secondary return path.

boot tests:

powerpcspe/RB800 ok
powerpc64/X5000 ok
powerpc/G4 ok
powerpc64/POWER9 Radix ok (old elfv1 userland)
powerpc64/POWER9 HPT ok (old elfv1 userland)

Only found comment related issues in readthrough.

sys/powerpc/powerpc/copyinout.c
78 ↗(On Diff #72752)

minor nit: s/IFUNcs/IFUNCs/

81 ↗(On Diff #72752)

s/powerpc64/AIM powerpc64/ as Book-E is described in the next paragraph

91 ↗(On Diff #72752)

The last two paragraphs are overloading the term "direct" -- the rest of the code treat "direct" as in "doesn't map user pointers" instead of "direct" as in "bypasses ifunc"

128 ↗(On Diff #72752)

english nit: s/if/whether/ might be easier to read

This revision is now accepted and ready to land.Jun 5 2020, 11:08 PM
This revision was automatically updated to reflect the committed changes.