Page MenuHomeFreeBSD

Powerpc64: Add the facility unavailable trap subsystem
ClosedPublic

Authored by breno.leitao_gmail.com on Mar 2 2018, 5:50 PM.

Details

Summary

This code adds the basic infrastructure for the facility subsystem. A facility
trap is raised when an unavailable instruction is executed. One example is
executing a Hardware Transactional Memory instruction while the MSR[TM] is
disabled. In the past, there was a specific interrupt for it (FP, VEC), but the
new instructions seem to be multiplexed on this facility interrupt.

The root cause of the trap is provided on Facility Status and Control Register
(FSCR) register.

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 added inline comments.Mar 3 2018, 1:47 AM
sys/powerpc/include/facility.h
1 ↗(On Diff #39888)

I would put the definitions from this header into spr.h under the SPR_FSCR, like other SPR bits.

sys/powerpc/powerpc/trap.c
302 ↗(On Diff #39888)

Don't forget the break; here, otherwise it falls through.

hi Justin, thanks for the review. I will work on a v2 patchset.

sys/powerpc/include/facility.h
1 ↗(On Diff #39888)

ok!

sys/powerpc/powerpc/trap.c
302 ↗(On Diff #39888)

In fact, I was expecting it to fall through, execute the EXC_HEA code and return the SIGILL, but I think it will be better if I split and break both, and return SIGILL in the two cases.

breno.leitao_gmail.com updated this revision to Diff 39921.EditedMar 3 2018, 7:28 PM

Patchset v2. Changes as requested by Justin (Thanks!):

  • Move the SPR_FSCR definitions to spr.h
  • Split the code between EXC_FAC and EXC_HEA.
nwhitehorn accepted this revision.Mar 4 2018, 9:56 PM
This revision is now accepted and ready to land.Mar 4 2018, 9:56 PM
This revision was automatically updated to reflect the committed changes.