HomeFreeBSD

linux(4): Preserve %rcx (return address) like a Linux do

Description

linux(4): Preserve %rcx (return address) like a Linux do

Perhaps, this does not makes much sense as destroyng %rcx declared by
the x86_64 Linux syscall ABI. However,:
a) if we get a signal while we are in the kernel, we should restore

tf_rcx when preparing machine context for signal handlers.

b) the Linux world is strange, someone can depend on %rcx value

after syscall, something like go.

Differential Revision: https://reviews.freebsd.org/D40155
MFC after: 1 month

(cherry picked from commit 037b60fb0fbcb2dd6b6cbb632b05a2939ff4ff29)

Details

Provenance
dchaginAuthored on May 28 2023, 2:06 PM
Differential Revision
D40155: linux(4): Preserve %rcx (return address) like a Linux do
Parents
rG053cbecd29f8: linux(4): Simplify %r10 restoring on amd64
Branches
Unknown
Tags
Unknown