Page MenuHomeFreeBSD

[2/2] _umtx_op: introduce 32-bit/i386 flags for operations
ClosedPublic

Authored by kevans on Sun, Nov 15, 4:13 AM.

Details

Summary

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__32BIT_I386.

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

UMTX_OP__32BIT_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. freebsd32umtx_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.

This could be cleaned up a little more by moving the native compat32 bits out into compat/freebsd32, but we need them in the __32BIT case anyways (except on amd64).

Test Plan

Run libthr tests under freebsd32.

Run my local patch against qemu-bsd-user that patches all _umtx_op through to the kernel with appropriate flags as long as we're dealing with a same-endian target.

Diff Detail

Repository
rS FreeBSD src repository
Lint
Lint Skipped
Unit
Unit Tests Skipped
Build Status
Buildable 34804

Event Timeline

sys/kern/kern_umtx.c
4430

#elif defined(NEED_UMTX32) here perhaps? fails to compile on armv7 otherwise

This revision is now accepted and ready to land.Tue, Nov 17, 3:52 AM

Would be nice to update the man page later.

Will do- I've also got a patch to teach libsysdecode, et al., about these flags. It's a little sketchy because we don't seem to have a good pre-existing example of a syscall like this where it's typically just an integer op but we lopped off a couple high bits, but it works.