Page MenuHomeFreeBSD

powerpc64: Add DSCR support

Authored by on Apr 16 2018, 1:01 AM.



Powerpc64 has support for a register called Data Stream Control Register
(DSCR), which basically controls how the hardware controls the caching and
prefetch for stream operations.

Since mfdscr and mtdscr are privileged instructions, we need to emulate them, and
keep the custom DSCR configuration per thread.

The purpose of this feature is to change DSCR depending on the operation, set
to DSCR Default Prefetch Depth to deepest on string operations, as memcpy.

Diff Detail

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

Event Timeline

jhibbits added inline comments.Apr 16 2018, 9:59 PM
140 ↗(On Diff #41497)

Is there a benefit to this over mfspr(SPR_DSCR)?

144 ↗(On Diff #41497)

If you keep this, you should use the named constant SPR_DSCR (I think "K" is the right constraint for integer constants).

Removing mfdscr() inline function and replacing by mfspr(SPR_DSCR).

jhibbits requested changes to this revision.Apr 17 2018, 4:57 PM

Fix the minor nits, and otherwise looks good.

132 ↗(On Diff #41569)

Use SPR_DSCR here.

210 ↗(On Diff #41569)

And here

This revision now requires changes to proceed.Apr 17 2018, 4:57 PM

Use SPR_DSCR macro instead of SPR number (0x11)

jhibbits accepted this revision.Apr 18 2018, 3:32 PM
This revision is now accepted and ready to land.Apr 18 2018, 3:32 PM
This revision was automatically updated to reflect the committed changes.