Page MenuHomeFreeBSD

kinst/arm64: Handle an additional PC-relative instruction
ClosedPublic

Authored by markj on Wed, May 13, 4:04 PM.
Tags
None
Referenced Files
Unknown Object (File)
Mon, Jun 8, 7:24 PM
Unknown Object (File)
Fri, Jun 5, 7:14 PM
Unknown Object (File)
Fri, Jun 5, 9:29 AM
Unknown Object (File)
Fri, Jun 5, 9:23 AM
Unknown Object (File)
Fri, Jun 5, 3:29 AM
Unknown Object (File)
Fri, Jun 5, 3:25 AM
Unknown Object (File)
Fri, Jun 5, 12:49 AM
Unknown Object (File)
Tue, Jun 2, 11:26 PM
Subscribers

Details

Summary

"ldr <reg>, <literal>" loads a value from a literal memory address into
a register. It's PC-relative and so cannot be directly implemented
using the trampoline mechanism. Unfortunately, on arm64 it can't easily
be emulated either since the return-to-EL1 handler does not restore
callee-saved registers, so like adr/adrp, we simply don't handle it.
These instructions are fairly rare in an arm64 kernel.

While here, refactor the code so that all instruction decoding is done
in one place: introduce an enum type which characterizes the instruction
type, add a helper to map instructions to enum values, and store the
corresponding enum value in the probe description.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

markj requested review of this revision.Wed, May 13, 4:04 PM

Are there any updates we should do in D40874?

This revision is now accepted and ready to land.Thu, May 14, 2:34 PM

Are there any updates we should do in D40874?

You might mention that we don't trace ldr <literal> on arm64, same as adr/adrp.