Page MenuHomeFreeBSD

powerpc64: Fix "show spr" command on ELFv2 kernels
ClosedPublic

Authored by bdragon on Nov 2 2018, 4:04 AM.
Referenced Files
Unknown Object (File)
Sun, Nov 24, 2:24 AM
Unknown Object (File)
Sep 26 2024, 2:19 AM
Unknown Object (File)
Sep 22 2024, 12:37 PM
Unknown Object (File)
Sep 16 2024, 7:57 AM
Unknown Object (File)
Sep 12 2024, 8:21 AM
Unknown Object (File)
Sep 9 2024, 1:53 AM
Unknown Object (File)
Sep 8 2024, 8:29 AM
Unknown Object (File)
Sep 8 2024, 7:53 AM
Subscribers

Details

Summary

When compiling for ELFv2, it is necessary to adjust the offset to get_spr and factor in the function prologue to ensure the correct instruction is being edited.

Test Plan

Before:

db> show spr 110
KDB: reentering
KDB: stack backtrace:
0xc008000020fb96e0: at 0xc000000002bb2e34 = kdb_backtrace+0x68
0xc008000020fb97f0: at 0xc000000002bb3798 = kdb_reenter+0x54
0xc008000020fb9860: at 0xc000000002f87090 = trap+0x4e4
0xc008000020fb9990: at 0xc000000002f78a60 = powerpc_interrupt+0x110
0xc008000020fb9a20: kernel trap 0xe40 by 0xc000000002401978 = get_spr+0x8: srr1=0x9000000000001032
            r1=0xc008000020fb9cd0 cr=0x80009438 xer=0x20040000 ctr=0xc000000002f7b40c r2=0xc0000000037fd000
saved LR(0xfffffffffffffffb) is invalid.

After:

db> show spr 110
SPR 272(110): c000000003cae900

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

This revision was not accepted when it landed; it landed in state Needs Review.Nov 8 2018, 8:48 PM
This revision was automatically updated to reflect the committed changes.