23 May 2013 00:17
binmiscctl(8) (and imgact_binmisc kernel module)
Stacey Son <sson <at> FreeBSD.org>
2013-05-22 22:17:29 GMT
2013-05-22 22:17:29 GMT
Hi all: I added a command-line utility called 'binmiscctl' for the imgact_binmisc kernel module that I previously proposed on this list. As you may recall, imgact_binmisc is an image activator for miscellaneous binary file types that are executed with the help of a user-level interpreter or emulator. It has been proposed that imgact_binmisc be added to the kernel as a module. The main reason I created this is to support cross building packages using qemu user mode (see my dev summit slides at http://people.freebsd.org/~sson/imgact_binmisc/20130515-bsdcan-xbuild-ports.pdf) but there are a lot of other applications for this module as well. For example, Nathan Whitehorn previously proposed on this list a similar code change (but much less general) to support transparently execute LLVM bitcode using the 'lli' JIT compiler. This kernel module if flexible enough that it supports that as well. Baptiste has also added support in poudrière for cross-building mips64 packages in a "cross jail" using qemu user mode. See his slides from BSDCan 2013 (pg. 7): http://people.freebsd.org/~bapt/modern-package-management.pdf Bapt mentioned that he built over 10,000 mips64 packages in about 30 hours. Of course, this is before adding imgact_binmisc which greatly improves the cross build speed by allowing both native (amd64) cross build tools to be used along with emulated mips64 binaries in a hybrid fashion. With my limited testing of cross building a handful of ports the overhead compared to building the port natively on a commodity amd64 host is 2x to 4x using this kernel module. Without the module the overhead is 10x or much more. The recently added 'binmiscctl' command-line utility allows for easy configuration and management of the image activators in this imgact_binmisc kernel module. For example, to add an image activator for qemu-mips64 (the qemu user mode emulator for mips64): # binmiscctl add mips64elf --interpreter "/usr/local/bin/qemu-mips64" --magic \ "\x7f\x45\x4c\x46\x02\x02\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x08" \ --mask "\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff"(Continue reading)
RSS Feed