Page MenuHomeFreeBSD

Revert most of ce42e793100b460f597e4c85ec0da12e274f9394
ClosedPublic

Authored by kib on Jul 19 2021, 4:30 PM.

Details

Summary

It restores _umtx_lock() and _umtx_unlock() syscalls, and UMTX_OP_LOCK/UMTX_OP_UNLOCK umtx_op(2) operations.

UMUTEX_ERROR_CHECK flag is left out.

PR: 218571

Diff Detail

Repository
R10 FreeBSD src repository
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

kib requested review of this revision.Jul 19 2021, 4:30 PM

Seems generally reasonable. Fortunately we have't had RESERVED syscall numbers for long so this isn't violating our guarantee too badly.

sys/sys/umtx.h
79

Does it make sense to put these under #ifdef _KERNEL to prevent new code form using them without some effort?

This revision is now accepted and ready to land.Jul 19 2021, 9:35 PM
kib marked an inline comment as done.Jul 19 2021, 10:27 PM
kib added inline comments.
sys/sys/umtx.h
79

We do not do that for UMTX_OP_SEM_WAIT/WAKE.

I considered keeping RESERVED symbols in the header, and redefine them to LOCK/UNLOCK in kern_umtx.c, as well as defining struct umtx in kern_umtx.c too. But then I decided that this obfuscation is not worth it: the facilitiy is under COMPAT_FREEBSD10 anyway, so anybody trying to use it (why? also it is not documented in umtx_op(2)) needs to make an argument to himself.

emaste added inline comments.
sys/kern/kern_umtx.c
910

Discussed briefly on IRC with @kib, the kernel side of this existed in FreeBSD 10 but it was not used by default userland for quite some time, perhaps after FreeBSD 6. Should this be COMPAT_FREEBSD6 (or whatever the actual version was) in that case?

kib marked an inline comment as done.Jul 27 2021, 7:44 PM
kib added inline comments.
sys/kern/kern_umtx.c
910

We provide COMPATX for syscalls removed in HEAD-X, not when the syscall use disappeared from the base. So I believe that COMPAT10 is the proper separation line.

sys/kern/kern_umtx.c
910

My thinking is that we could have moved it under COMPAT_FREEBSD6 in FreeBSD 7 (assuming it was 6). I think the umtx syscalls is a bit of an unusual case wrt historical practice.

sys/kern/kern_umtx.c
910

Yes, but syscall was kept until 10. I agree that right action in FreeBSD 7 times was not the removal but bracing it with COMPAT6, of course.

It is both umtx op that was removed, and dedicated syscalls.