Date: Thu, 16 Aug 2018 16:01:25 +0000 From: Matt Churchyard <matt.churchyard@userve.net> To: "Rodney W. Grimes" <freebsd-rwg@pdx.rh.CN85.dnsmgr.net> Cc: "freebsd-virtualization@freebsd.org" <freebsd-virtualization@freebsd.org> Subject: RE: Checking bhyve supported features (sysctls) Message-ID: <60d0e18d1ba34632aa6045c85c023bbd@SERVER.ad.usd-group.com> In-Reply-To: <201808161516.w7GFGtN1054010@pdx.rh.CN85.dnsmgr.net> References: <3393f8f3d32a4f0890aab87185fbed01@SERVER.ad.usd-group.com> <201808161516.w7GFGtN1054010@pdx.rh.CN85.dnsmgr.net>
next in thread | previous in thread | raw e-mail | index | archive | help
> Hello, >=20 > I'm looking for better ways to check for bhyve support / available featur= es without trying to scan through dmesg output. >Yes, it would be very good to remove that, as it usually tries to grep a n= on-existent file /var/run/dmesg.boot that is not created until after vm_bhy= ve has been called from /usr/local/etc/rc.d when you have things set to aut= ostartup >in /etc/rc.conf >=20 > I notice that the following 2 sysctl's appear to be set to 1 as soon=20 > as the vmm module is loaded >=20 > hw.vmm.vmx.initialized: 1 > hw.vmm.vmx.cap.unrestricted_guest: 1 >=20 > Will these be available on both Intel & AMD processors as a way to determ= ine if the module has loaded successfully and can run guests? >=20 > I also see the below sysctl related to iommu. >=20 > hw.vmm.iommu.initialized >=20 > Again, will this be set to 1 as soon as the module is loaded if iommu is = supported, or only when it is used? > There also seems to be a vmm.amdvi.enable sysctl. Would both these need c= hecking or is vmm.iommu enough to determine support on any processor. >Probalby the safest way for a shell script to decide if bhyve is up and ru= nning is to stat /dev/vmm, if that exists then the modules have loaded and = initialized and bhyve should be ready to process guests. Hmm, I don't get /dev/vmm unless I actually have running guests. >sysctl's mentiond above would be a poor way to make this determination. It would be nice if sysctls were better documented. If vmx.initialized is s= et once vmm has successfully loaded, I can't see a better way of checking f= or bhyve support (assuming it's not Intel specific). This entry definitely = exists and is set to 0 if you load the module on a non-supported system, an= d set to 1 as soon as vmm loads on my Intel test system. Matt --=20 Rod Grimes rgrimes@freebsd.= org
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?60d0e18d1ba34632aa6045c85c023bbd>