Page MenuHomeFreeBSD

Split kern_break from sys_break and use it in linuxulator
ClosedPublic

Authored by emaste on Jun 26 2018, 6:17 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sat, Oct 25, 7:20 PM
Unknown Object (File)
Thu, Oct 23, 3:51 AM
Unknown Object (File)
Wed, Oct 22, 7:55 PM
Unknown Object (File)
Wed, Oct 22, 7:55 PM
Unknown Object (File)
Wed, Oct 22, 7:55 PM
Unknown Object (File)
Wed, Oct 22, 9:34 AM
Unknown Object (File)
Oct 21 2025, 7:24 AM
Unknown Object (File)
Oct 2 2025, 3:05 AM
Subscribers

Details

Summary

Previously the linuxulator's linux_brk invoked the FreeBSD sys_break syscall implementation directly. Instead, move the bulk of the existing implementation to kern_break, and use that from both sys_break and linux_brk.

This also addresses a minor bug in linux_brk in that we now return the actual (rounded up) break address, rather than the requested value.

Diff Detail

Lint
Lint Skipped
Unit
Tests Skipped

Event Timeline

Looks good to me. I wonder if we also want to restore ibcs2's int return value?

This revision is now accepted and ready to land.Jun 26 2018, 10:46 PM
sys/compat/linux/linux_misc.c
241–244

BTW, type of td_retval is register_t, not long.

242

Remove excess ().

sys/vm/vm_unix.c
76

Excess (). And the cast too.

87

Mismatched types: prototype uses uintptr_t *addr.

This revision now requires review to proceed.Jun 27 2018, 12:42 PM
sys/vm/vm_unix.c
76

What about the cast?

I wonder if we also want to restore ibcs2's int return value?

Would that be implementing a ibcs2-specific wrapper? I suspect it's not worth it.

sys/vm/vm_unix.c
76

typo, corrected locally to uap->nsize

This revision was not accepted when it landed; it landed in state Needs Review.Jun 27 2018, 2:45 PM
This revision was automatically updated to reflect the committed changes.

I wonder if we also want to restore ibcs2's int return value?

Would that be implementing a ibcs2-specific wrapper? I suspect it's not worth it.

I agree it probably isn't worth it.