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)
Fri, Dec 13, 1:28 PM
Unknown Object (File)
Wed, Dec 4, 11:01 PM
Unknown Object (File)
Nov 22 2024, 5:53 PM
Unknown Object (File)
Nov 20 2024, 11:52 PM
Unknown Object (File)
Nov 16 2024, 8:42 AM
Unknown Object (File)
Oct 27 2024, 12:36 PM
Unknown Object (File)
Oct 25 2024, 7:29 AM
Unknown Object (File)
Oct 2 2024, 6:42 AM
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.