Page MenuHomeFreeBSD

ksyms: Fixup symbols for powerpc in the kernel, not just modules
ClosedPublic

Authored by jhibbits on May 19 2019, 3:04 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sat, May 11, 1:14 AM
Unknown Object (File)
Thu, May 2, 2:01 AM
Unknown Object (File)
Mar 20 2024, 12:15 PM
Unknown Object (File)
Mar 20 2024, 12:15 PM
Unknown Object (File)
Jan 6 2024, 6:32 PM
Unknown Object (File)
Jan 6 2024, 6:32 PM
Unknown Object (File)
Dec 22 2023, 9:05 PM
Unknown Object (File)
Sep 2 2023, 8:05 PM
Subscribers

Details

Summary

PowerPC kernels are fully position independent, just like kernel modules.
The same fixups that are done for modules therefore need to be done to the
kernel, else symbol resolution in, e.g., DTrace, cannot resolve the kernel
symbols, so only addresses in the kernel are printed, while kernel module
symbols are printed.

Test Plan

Run lockstat on powerpc64. Note symbols are resolved for kernel and
modules.

Diff Detail

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

Event Timeline

sys/dev/ksyms/ksyms.c
222 ↗(On Diff #57560)

I think this is somewhat obscure. Can you write it as something like

bool fixup = lf->id > 1 || fixup_kernel;

and define fixup_kernel as true on powerpc, false otherwise?

jhibbits added inline comments.
sys/dev/ksyms/ksyms.c
222 ↗(On Diff #57560)

Sure. That makes more sense, even if it wasn't necessary on powerpc.

jhibbits marked an inline comment as done.

Address feedback from markj.

sys/dev/ksyms/ksyms.c
210 ↗(On Diff #57561)

I guess it's still overcomplicated. You can just write:

#ifdef __powerpc__
fixup = true;
#else
fixup = lf->id > 1;
#endif

Makes sense. Should've thought of that when I made this change.

markj added inline comments.
sys/dev/ksyms/ksyms.c
206 ↗(On Diff #57566)

Should be true instead of 1.

This revision is now accepted and ready to land.May 19 2019, 6:07 PM
jhibbits added inline comments.
sys/dev/ksyms/ksyms.c
206 ↗(On Diff #57566)

Of course. Maybe I should stop creating reviews between flights.

This revision was automatically updated to reflect the committed changes.
jhibbits marked an inline comment as done.