Page MenuHomeFreeBSD

[PowerPC] Fix offset calculations in bridge mode
ClosedPublic

Authored by bdragon on Jan 6 2020, 8:03 PM.
Referenced Files
Unknown Object (File)
Jan 11 2024, 10:42 PM
Unknown Object (File)
Dec 23 2023, 2:17 AM
Unknown Object (File)
Nov 26 2023, 10:58 AM
Unknown Object (File)
Nov 14 2023, 8:16 AM
Unknown Object (File)
Nov 12 2023, 8:17 AM
Unknown Object (File)
Nov 9 2023, 9:31 PM
Unknown Object (File)
Nov 9 2023, 3:53 AM
Unknown Object (File)
Nov 6 2023, 8:12 PM

Details

Summary

In rS354701, I replaced text relocations with offsets from &generictrap.

Unfortunately, the magic variable I was using doesn't actually mean the address of &generictrap, in bridge mode it actually means &generictrap64.

So, for bridge mode to work, it is necessary to differentiate between "where do we need to branch to to handle a trap" and "where is &generictrap for purposes of doing relative math".

Introduce a new TRAP_ENTRY and use it instead of TRAP_GENTRAP for doing actual calls to the generic trap handler.

Unfortunately, bridge mode is still broken even with this change due to the memory corruption problem.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Skipped
Unit
Tests Skipped

Event Timeline

sys/powerpc/include/trap.h
149–150

Is 0x1e8 taken?

sys/powerpc/include/trap.h
149–150

Nope, I just apparently can't count backwards in hex.

Use different address. I meant to have them next to each other but I jumped from f to d.

I *meant* to alphabetize this in the first place.
This puts TRAP_GENTRAP back at its original address, too.

This revision is now accepted and ready to land.Jan 18 2020, 2:13 AM