epoll-shim icon indicating copy to clipboard operation
epoll-shim copied to clipboard

Add support for CheriBSD

Open arichardson opened this issue 2 years ago • 13 comments

I tried running the tests on my Morello board and noticed that most of them were failing. This patch series makes epoll-shim work correctly when running on CheriBSD (a fork of FreeBSD that adds support for CHERI-enabled architectures such as CHERI-RISC-V and Arm Morello).

With this patch series all but two tests pass for me and the last remaining failures will go away once https://github.com/CTSRD-CHERI/cheribsd/issues/1424 has been fixed.

arichardson avatar Jun 19 '22 15:06 arichardson

Thank you for this! Those changes look reasonable to me at a first glance.

CheriBSD looks like a cool project! Is there a way for me to test it without a dev board? Is https://www.cl.cam.ac.uk/research/security/ctsrd/cheri/cheri-qemu.html the way to go?

jiixyj avatar Jun 19 '22 17:06 jiixyj

Thank you for this! Those changes look reasonable to me at a first glance.

CheriBSD looks like a cool project! Is there a way for me to test it without a dev board? Is https://www.cl.cam.ac.uk/research/security/ctsrd/cheri/cheri-qemu.html the way to go?

Yes, QEMU is the best way to get started. If you clone cheribuild, running cheribuild.py run-morello-purecap -d will build all the dependencies and spawn a cheribsd instance in qemu (might take a while since you have to build LLVM and FreeBSD).

arichardson avatar Jun 19 '22 19:06 arichardson

And there is of course a target to build epoll-shim as well, cheribuild.py epoll-shim-morello-purecap -d. However, due to microatf not being particularly friendly to cross-compiling, the easiest way to build the tests right now is if you have real hardware. Qemu probably works, but running clang inside qemu is pretty slow...

arichardson avatar Jun 19 '22 19:06 arichardson

Friendly ping :)

arichardson avatar Jul 01 '22 18:07 arichardson

ping?

arichardson avatar Aug 09 '22 21:08 arichardson

Sorry to ping again, but would it be possible to merge this?

arichardson avatar Aug 17 '22 12:08 arichardson

ping?

arichardson avatar Sep 05 '22 10:09 arichardson

rebased on latest master, @jiixyj any chance this could be merged?

arichardson avatar Sep 15 '22 12:09 arichardson

ping?

arichardson avatar Oct 17 '22 09:10 arichardson

ping? It would be nice if we could drop the local patch from CheriBSD ports

arichardson avatar Dec 02 '22 00:12 arichardson

@jiixyj Any chance this could be merged?

arichardson avatar Jan 28 '23 13:01 arichardson

Thanks for your patience -- I haven't forgotten about this! Some thoughts:

  • Are the POLLRDHUP changes essential? I'd like to fix this separately, if possible (see also https://github.com/jiixyj/epoll-shim/issues/33).
  • Duplicating that much fcntl logic doesn't bode well for maintenance... It would be much nicer if there was an "official" way to interpose fnctl.

jiixyj avatar Feb 05 '23 08:02 jiixyj

Sorry for the delay - I've rebased the changes. Unfortunately there is currently no way to interpose fcntl more easily...

arichardson avatar Sep 03 '23 20:09 arichardson

No longer the most recent version, see https://github.com/jiixyj/epoll-shim/pull/55 as well as #54 #53 #52 #51

arichardson avatar Aug 12 '24 16:08 arichardson