bhyve What will I lose if I don't use the bhyve -A -H -P -w -S flags?

My bhyve command looks like this:
Code:
bhyve \
    -c 64 \
    -l bootrom,/usr/local/share/uefi-firmware/BHYVE_UEFI.fd \
    -l com1,stdio \
    -m 64G \
    -s 0,hostbridge \
    -s 1,lpc \
    -s 2,virtio-net,tap0 \
    -s 3,nvme,/dev/zvol/test/debian \
    debian

However, after reading man bhyve with examples several times, I still do not understand the need for flags:

Code:
-A Generate ACPI tables.  Required for FreeBSD/amd64 guests.

-H Yield the virtual CPU thread when a HLT instruction is detected.
   If this option is not specified, virtual CPUs will use 100% of a host
   CPU.

-P Force the guest virtual CPU to exit when a PAUSE instruction is detected.

-w Ignore accesses to unimplemented Model Specific Registers (MSRs).
   This is intended for debug purposes.

-S Wire guest memory.

These flags are very common in all the examples, including the examples from man bhyve, but I absolutely don’t understand why they should be used.
  • -A - the virtual machine starts without it. Explain what this flag does for me and what I will lose if I don't use it.
  • -H - this option is needed so that bhyve processes do not consume 100% of the CPU, but as much as they actually consume. In other words, without -H, idle processes will consume 100% of each of the 64 cores. But I don’t notice the effect of this consumption on processor temperature. With the machine running, the CPU temperature is 45 degrees Celsius regardless of whether I use -H or not.
  • -P - I don’t understand why this flag should be used. Explain, please.
  • -w - I don’t understand the purpose of this flag.
General question: what will I lose if I don't use the -A -H -S -P -w flags?

System:
FreeBSD 13.2
AMD EPYC 7763 64-core
RAM: 128Gb
Filesystem: ZFS with default settings.
 
I think all options are well explained in the man page. Except maybe the S which is mandatory only when you passthru a device in the VM.

Really surprised that the lack of H option does nothing on the CPU temperature. The host is as responsive as with H?
 
I think all options are well explained in the man page.
I don't even understand what "FreeBSD/adm64 guests" is. Is this only FreeBSD with amd64 architecture or does this also apply to Linux with amd64 architecture?

The examples at the end of the manual do not explain at all why flags are used or not used.
Really surprised that the lack of H option does nothing on the CPU temperature. The host is as responsive as with H?
I didn't notice any abnormalities. The processor temperature is absolutely normal, and in general there were no other effects other than the usual ones.

But my question is what will I lose (in terms of the virtual machine performance). I would like to get maximum performance inside the virtual machine because I compile certain programs in it.

Therefore, I need the correct interpretation of these flags.

For example, if I don't use -H but use -S, will I get better performance when consulting inside a virtual machine?
 
If I were in your situation, I'd use a dedicated computer for this (even refurbished one), because you'll get much more performance than any VM, especially for heavy use like compiling...
 
If I were in your situation, I'd use a dedicated computer for this (even refurbished one), because you'll get much more performance than any VM, especially for heavy use like compiling...
It really depends on the host CPU. E.g. my old Xeon E5-1650v3 exhibits excellent performance running a Windows and a Debian VMs used for compilation.
 
It really depends on the host CPU. E.g. my old Xeon E5-1650v3 exhibits excellent performance running a Windows and a Debian VMs used for compilation.
I missed that indeed, Xeons are very good for VT-x !
For Windows, it'd be great to "clean" as much of the bloatware (background apps, telemetry, etc etc), or ideally a LTSB/LTSC licence. Not that hard to find, they were often sold with thin clients.
I'm testing nvme controller on W10 install, but it crashes so I use virtio-blk. Some say nvme is better.
 
On my host (Xeon 5120 Gold, two sockets) I do not use '-A', as with this option Windows VMs do not load
Code:
sudo bhyve -c 16,sockets=2,cores=2,threads=4 -m 32G -H -w -S \  
 -s 0,hostbridge \  
 -s 3,ahci-cd,/mirlo/iso/SSS_X64FREV_EN-US_DV9.iso \  
 -s 4,ahci-hd,/mirlo/bsd/vms/ws2022_1.img \  
 -s 5,ahci-cd,/mirlo/iso/virtio-win-0.1.240.iso \  
 -s 6,virtio-net,tap0 \  
 -s 7,passthru,94/0/0 \  
 -s 8,hda,play=/dev/dsp,rec=/dev/dsp \  
 -s 29,fbuf,tcp=0.0.0.0:5900,w=1920,h=1200,wait \  
 -s 30,xhci,tablet \  
 -s 31,lpc \  
 -l com1,stdio \  
 -l bootrom,/usr/local/share/uefi-firmware/BHYVE_UEFI.fd \  
 ws2022_1
 
  • Thanks
Reactions: dnb
Well, no. if I switch from virtio-blk to nvme on a working Windows setup, boot will crash on Windows Boot Manager (quite normal, we're not supposed in any way to change the disk controller after setup).
Strange thing is it does the same on a clean install with all partitions wyped ; I even generated a
Code:
Assertion failed: (cq->qbase != NULL)
:D

But I don't really care, I also try to get best possible performance and I don't know if I'll get some gain using nvme. My VM is only used to run Anydesk for customers - I didn't want to run Anydesk on my FreeBSD nor in a jail, so the most important for me will be to find optimized graphics drivers.
 
  • Thanks
Reactions: dnb
Back
Top