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)
Thu, May 16, 12:20 AM
Unknown Object (File)
Thu, May 9, 7:57 AM
Unknown Object (File)
Tue, May 7, 2:59 PM
Unknown Object (File)
Mon, May 6, 1:26 AM
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
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 Skipped
Unit
Tests Skipped
Build Status
Buildable 54163
Build 51053: arc lint + arc unit

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
220

there's gonna be a memory leak

224

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
220

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

224

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