HomeFreeBSD

MFC kern: _umtx_op: introduce 32-bit/i386 flags for operations

Description

MFC kern: _umtx_op: introduce 32-bit/i386 flags for operations

This patch takes advantage of the consolidation that happened to provide two
flags that can be used with the native _umtx_op(2): UMTX_OP___32BIT and
UMTX_OP__I386.

UMTX_OP__32BIT iindicates that we are being provided with 32-bit structures.
Note that this flag alone indicates a 64bit time_t, since this is the
majority case.

UMTX_OP__I386 has been provided so that we can emulate i386 as well,
regardless of whether the host is amd64 or not.

Both imply a different set of copyops in sysumtx_op. freebsd32__umtx_op
simply ignores the flags, since it's already doing a 32-bit operation and
it's unlikely we'll be running an emulator under compat32. Future work
could consider it, but the author sees little benefit.

This will be used by qemu-bsd-user to pass on all _umtx_op calls to the
native interface as long as the host/target endianness matches, effectively
eliminating most if not all of the remaining unresolved deadlocks for most.

This version changed a fair amount from what was under review, mostly in
response to refactoring of the prereq reorganization and battle-testing
it with qemu-bsd-user. The main changes are as follows:

1.) The i386 flag got renamed to omit '32BIT' since this is redundant.
2.) The flags are now properly handled on 32-bit platforms to emulate other

32-bit platforms.

3.) Robust list handling was fixed, and the 32-bit functionality that was

previously gated by COMPAT_FREEBSD32 is now unconditional.

4.) Robust list handling was also improved, including the error reported

when a process has already registered 32-bit ABI lists and also
detecting if native robust lists have already been registered. Both
scenarios now return EBUSY rather than EINVAL, because the input is
technically valid but we're too busy with another ABI's lists.

libsysdecode/kdump/truss support will go into review soon-ish, along with
the associated manpage update.

(cherry picked from commit e0cb5b2a776208d70b8463c063a126893fafa101)

Details

Provenance
kevansAuthored on Nov 22 2020, 5:47 AM
Parents
rG2be2474a198c: MFC kern: _umtx_op: compat32 refactoring
Branches
Unknown
Tags
Unknown