Page MenuHomeFreeBSD

Rework Linux ppoll system call.
ClosedPublic

Authored by dchagin on Jun 10 2021, 12:23 PM.
Tags
None
Referenced Files
F109871939: D30716.diff
Mon, Feb 10, 2:33 PM
Unknown Object (File)
Sat, Jan 25, 7:48 PM
Unknown Object (File)
Sat, Jan 25, 7:29 PM
Unknown Object (File)
Sat, Jan 25, 7:19 PM
Unknown Object (File)
Fri, Jan 24, 5:41 PM
Unknown Object (File)
Mon, Jan 20, 7:59 PM
Unknown Object (File)
Sun, Jan 19, 7:00 PM
Unknown Object (File)
Sat, Jan 18, 5:24 PM
Subscribers

Details

Summary

For now the Linux emulation layer uses in kernel ppoll(2) without
conversion of user supplied fd 'events', and does not convert the
kernel supplied fd 'revents'.

At least POLLRDHUP is handled by FreeBSD differently than by
Linux. Seems that Linux silencly ignores POLLRDHUP on non socket fd's
unlike FreeBSD, which does more strictly check and fails.

Rework the Linux ppoll, using kern_poll and converting 'events'
and 'revents' values.
While here, move poll events defines to the MI part of code as they
mostly identical on all arches except arm.

Test Plan

ltp

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

Looks reasonable

sys/compat/linux/linux.c
686–689

we may need to add some sort of ratelimiting for these (as a followup)?

fix grammar, rate limit diagnostics.

move conversion routines declaration to linux_common.h as
linux.h does not intended for MD things

emaste@, what are you think about using fget_unlocked() in linux_to_bsd_poll_events?

This revision was not accepted when it landed; it landed in state Needs Review.Jun 21 2021, 4:30 PM
This revision was automatically updated to reflect the committed changes.