Page MenuHomeFreeBSD

bhyve: Move libcasper dependecy to lib9p
ClosedPublic

Authored by gusev.vitaliy_gmail.com on Mar 4 2023, 11:07 AM.
Tags
Referenced Files
Unknown Object (File)
Wed, Nov 6, 3:01 PM
Unknown Object (File)
Tue, Nov 5, 11:19 AM
Unknown Object (File)
Thu, Oct 24, 12:54 AM
Unknown Object (File)
Wed, Oct 16, 9:17 PM
Unknown Object (File)
Tue, Oct 15, 10:44 AM
Unknown Object (File)
Oct 13 2024, 8:52 AM
Unknown Object (File)
Oct 12 2024, 2:52 PM
Unknown Object (File)
Oct 11 2024, 6:33 AM

Details

Summary

libcasper(3) is not used in bhyve. So move dependency to the appropriate place.

Sponsored by: vStack

Test Plan

Compile, Run VM.

W/o patch, rebuilt bhyve:

$ ldd /data/bin/bhyve
  /data/bin/bhyve:
  libvmmapi.so.5 => /usr/lib/libvmmapi.so.5 (0x13beb90e9000)
  libmd.so.6 => /lib/libmd.so.6 (0x13bebae97000)
  libnv.so.1 => /lib/libnv.so.1 (0x13beb92e2000)
  libz.so.6 => /lib/libz.so.6 (0x13beb95a5000)
  libutil.so.9 => /lib/libutil.so.9 (0x13beb9b25000)
  libsbuf.so.6 => /lib/libsbuf.so.6 (0x13beb9c59000)
  libcam.so.7 => /lib/libcam.so.7 (0x13beba5f5000)
  lib9p.so.1 => /usr/lib/lib9p.so.1 (0x13bebbcee000)
  libcasper.so.1 => /lib/libcasper.so.1 (0x13bebcdde000)
  libcap_pwd.so.1 => /lib/casper/libcap_pwd.so.1 (0x13bebc3e2000)
  libcap_grp.so.1 => /lib/casper/libcap_grp.so.1 (0x13bebe215000)
  libprivateucl.so.1 => /usr/lib/libprivateucl.so.1 (0x13bebd495000)
  libxo.so.0 => /lib/libxo.so.0 (0x13bebe26d000)
  libnetgraph.so.4 => /usr/lib/libnetgraph.so.4 (0x13bebf7f4000)
  libcrypto.so.111 => /lib/libcrypto.so.111 (0x13bebe375000)
  libthr.so.3 => /lib/libthr.so.3 (0x13bebea4f000)
  libc.so.7 => /lib/libc.so.7 (0x13bebff5c000)
  libm.so.5 => /lib/libm.so.5 (0x13bec18a8000)
  [vdso] (0x13beb6c68580)

With patch, rebuilt bhyve:

$ ldd /data/bin/bhyve
  /data/bin/bhyve:
  libvmmapi.so.5 => /usr/lib/libvmmapi.so.5 (0x173b99437000)
  libmd.so.6 => /lib/libmd.so.6 (0x173b99fe5000)
  libnv.so.1 => /lib/libnv.so.1 (0x173b9adee000)
  libz.so.6 => /lib/libz.so.6 (0x173b9c20b000)
  libutil.so.9 => /lib/libutil.so.9 (0x173b9ae80000)
  libsbuf.so.6 => /lib/libsbuf.so.6 (0x173b9baaf000)
  libcam.so.7 => /lib/libcam.so.7 (0x173b9d762000)
  lib9p.so.1 => /usr/lib/lib9p.so.1 (0x173b9c4f8000)
  libprivateucl.so.1 => /usr/lib/libprivateucl.so.1 (0x173b9cbaa000)
  libxo.so.0 => /lib/libxo.so.0 (0x173b9dd25000)
  libnetgraph.so.4 => /usr/lib/libnetgraph.so.4 (0x173b9eb51000)
  libcrypto.so.111 => /lib/libcrypto.so.111 (0x173b9f02c000)
  libthr.so.3 => /lib/libthr.so.3 (0x173ba09c0000)
  libc.so.7 => /lib/libc.so.7 (0x173b9f69b000)
  libm.so.5 => /lib/libm.so.5 (0x173ba170b000)
  [vdso] (0x173b97423580)

Without patch, rebuilt lib9p:

$ ldd /usr/obj/usr/home/vetal/work/freebsd/amd64.amd64/lib/lib9p/lib9p.so
   /usr/obj/usr/home/vetal/work/freebsd/amd64.amd64/lib/lib9p/lib9p.so:
   libsbuf.so.6 => /lib/libsbuf.so.6 (0x3119ae8b9000)
   libc.so.7 => /lib/libc.so.7 (0x3119aa25d000)

With patch, rebuilt lib9p:

$ ldd /usr/obj/usr/home/vetal/work/freebsd/amd64.amd64/lib/lib9p/lib9p.so
  /usr/obj/usr/home/vetal/work/freebsd/amd64.amd64/lib/lib9p/lib9p.so:
  libsbuf.so.6 => /lib/libsbuf.so.6 (0x1424f37d8000)
  libcasper.so.1 => /lib/libcasper.so.1 (0x1424f4df5000)
  libcap_pwd.so.1 => /lib/casper/libcap_pwd.so.1 (0x1424f434f000)
  libcap_grp.so.1 => /lib/casper/libcap_grp.so.1 (0x1424f5851000)
  libc.so.7 => /lib/libc.so.7 (0x1424ef86b000)
  libnv.so.1 => /lib/libnv.so.1 (0x1424f6376000)

Diff Detail

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

Event Timeline

Seems ok. Did you test 9pfs in the guest? I would suggest trying it if so. In particular, we have no other examples where a shared library depends on casper libraries. Up until now, it is always executables which depend on casper libraries. So there might be some subtle problem or interaction.

This revision is now accepted and ready to land.Mar 4 2023, 3:58 PM

Seems ok. Did you test 9pfs in the guest? I would suggest trying it if so. In particular, we have no other examples where a shared library depends on casper libraries. Up until now, it is always executables which depend on casper libraries. So there might be some subtle problem or interaction.

@markj Yes, I tested p9fs and it worked fine.

Checked Cases:

libpbhyvemount from VM
MK_CASPER=yesCAPSICUM=yesOK
MK_CASPER=yesCAPSICUM=noOK
MK_CASPER=noCAPSICUM=noOK
MK_CASPER=noCAPSICUM=yesFAIL

4-th case (failed) is about ticket : https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=269827

It is not related to this change, but mention that p9fs needs additional efforts with capsicum/libcasper.

Seems ok. Did you test 9pfs in the guest? I would suggest trying it if so. In particular, we have no other examples where a shared library depends on casper libraries. Up until now, it is always executables which depend on casper libraries. So there might be some subtle problem or interaction.

@markj Yes, I tested p9fs and it worked fine.

Checked Cases:

libpbhyvemount from VM
MK_CASPER=yesCAPSICUM=yesOK
MK_CASPER=yesCAPSICUM=noOK
MK_CASPER=noCAPSICUM=noOK
MK_CASPER=noCAPSICUM=yesFAIL

4-th case (failed) is about ticket : https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=269827

It is not related to this change, but mention that p9fs needs additional efforts with capsicum/libcasper.

I see, thank you for testing.

share/mk/src.libnames.mk
273

Please keep the same whitespace as before.

This revision now requires review to proceed.Mar 6 2023, 4:00 PM
This revision was not accepted when it landed; it landed in state Needs Review.Mar 7 2023, 4:14 PM
This revision was automatically updated to reflect the committed changes.