Page MenuHomeFreeBSD

arm64: Use the Linux sigframe to restore registers
ClosedPublic

Authored by andrew on Oct 25 2023, 10:35 AM.
Tags
None
Referenced Files
Unknown Object (File)
Sun, Apr 28, 5:10 AM
Unknown Object (File)
Sat, Apr 27, 11:59 PM
Unknown Object (File)
Fri, Apr 26, 2:08 AM
Unknown Object (File)
Mon, Apr 22, 1:37 PM
Unknown Object (File)
Mon, Apr 22, 6:21 AM
Unknown Object (File)
Mon, Apr 22, 1:25 AM
Unknown Object (File)
Fri, Apr 5, 2:47 PM
Unknown Object (File)
Fri, Apr 5, 10:42 AM
Subscribers

Details

Summary

When returning from a Linux signal use the Linux sigframe to find the
register values to restore.

Remove the FreeBSD ucontext from the stack as it's now unneeded.

Sponsored by: Arm Ltd

Diff Detail

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

Event Timeline

Remove a change intended for a future review

Nice, that was in my plans, I was waiting when SVE to be finished. Thanks!
So are the go tests suite passes now? I suspected that similarly to amd64 the problem is in the sigcontext layout on arm64.

sys/arm64/linux/linux_sysvec.c
278

there's gonna be a memory leak

282

Is it possible to out this code into a separate function?

I don't know about the go test suite. I've only tested with my tool to read the ID registers from userspace https://github.com/zxombie/arm64id/. This changes the pc the signal handler returns to and sets x0 to indicate the ID register is unable to be read from userspace.

sys/arm64/linux/linux_sysvec.c
278

Whoops, was added at the last minute & forgot to change the error path

282

We can. Linux also checks there is only one of each type.

  • Split out parsing the reserved array to a new function
  • Fix a memory leak

Please add PR: 270250 to the commit message,
You have fixed this bug, golang tests suite passed. Thank you

This revision is now accepted and ready to land.Oct 25 2023, 4:50 PM