Bug 219343

Summary: bhyve requires -w option to run FreeBSD guests on AMD A10 CPU
Product: Base System Reporter: Chris Gordon <freebsd-bugs>
Component: miscAssignee: freebsd-virtualization (Nobody) <virtualization>
Status: New ---    
Severity: Affects Some People CC: maciej, rgrimes
Priority: ---    
Version: 11.0-RELEASE   
Hardware: amd64   
OS: Any   

Description Chris Gordon 2017-05-17 01:03:40 UTC
I must pass the "-w" option to bhyve in order for it to run FreeBSD guests on my AMD 10-7860K CPU.  Since the man page indicates this option is intended for debugging purposes, I assume I probably shouldn't need this to run.

- Without "-w", the FreeBSD install image loads the boot loader but hangs after trying to boot the kernel.  CPU load goes to ~ 100%
- On the same machine, I've installed an OpenBSD 6.1 VM (grub2-bhyve) and did NOT need the "-w" option.
- Kernel:  FreeBSD XXXXXX 11.0-RELEASE-p9 FreeBSD 11.0-RELEASE-p9 #0: Tue Apr 11 08:48:40 UTC 2017     root@amd64-builder.daemonology.net:/usr/obj/usr/src/sys/GENERIC  amd64
- This happens with both 11.0-RELEASE images and 11.0-STABLE

To duplicate on a machine with an AMD A10 CPU (maybe other AMD CPU) Follow steps on https://wiki.freebsd.org/action/show/bhyve?action=show&redirect=BHyVe (Q: What is the easiest way to try bhyve?):

- Failure Condition
-- fetch ftp://ftp.freebsd.org/pub/FreeBSD/snapshots/VM-IMAGES/11.0-STABLE/amd64/Latest/FreeBSD-11.0-STABLE-amd64.raw.xz
-- unxz FreeBSD-11.0-STABLE-amd64.raw.xz
-- sudo sh /usr/share/examples/bhyve/vmrun.sh -d FreeBSD-11.0-STABLE-amd64.raw vm0
-- Observe hung systems
- "Fix"
-- Edit vmrun.sh to add "-w" to the bhyve options
-- sudo sh /usr/share/examples/bhyve/vmrun.sh -d FreeBSD-11.0-STABLE-amd64.raw vm0
-- Observe nice and happy FreeBSD system.

If you need dmesg output or anything else, I'm happy to provide.
Comment 1 Rodney W. Grimes freebsd_committer freebsd_triage 2017-05-20 20:51:51 UTC
Thought it is not a final fix, you no longer well need to edit vmrun.sh
to use your workaround, -w has been added to as an avaliable option on
your vmrun.sh command to pass it to the bhyve command.

I do believe some work is under way to fix some of the unimplemented
instructions that are causing this issue.
Comment 2 Chris Gordon 2017-05-21 13:41:30 UTC
Thanks.  My concern is more of the underlying issues requiring -w, not vmrun.sh itself.

If I can provide any help, please let me know.