bhyve VM using BHYVE_UEFI.fd gets EPT violation

Yuri Pankov yuripv at yuripv.net
Fri Oct 12 14:22:26 UTC 2018


Matt Churchyard wrote:
>> Hi,
> 
>> I'm taking my first steps in using bhyve, and the first showstopper seems to be that using '-l bootrom,/usr/local/share/uefi-firmware/BHYVE_UEFI.fd' gets me immediate vm exit with >exit_reason being 48 (EPT violation).
> 
>> Relevant part of dmesg:
> 
> FreeBSD 12.0-ALPHA9 r339291 GENERIC amd64 FreeBSD clang version 6.0.1 (tags/RELEASE_601/final 335540) (based on LLVM 6.0.1)
> WARNING: WITNESS option enabled, expect reduced performance.
> VT(efifb): resolution 800x600
> CPU: Intel(R) Xeon(R) CPU E5-2660 v2 @ 2.20GHz (2200.04-MHz K8-class CPU)
>   Origin="GenuineIntel"  Id=0x306e4  Family=0x6  Model=0x3e  Stepping=4
> 
> Features=0xbfebfbff<FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CLFLUSH,DTS,ACPI,MMX,FXSR,SSE,SSE2,SS,HTT,TM,PBE>
> 
> Features2=0x7fbee3ff<SSE3,PCLMULQDQ,DTES64,MON,DS_CPL,VMX,SMX,EST,TM2,SSSE3,CX16,xTPR,PDCM,PCID,DCA,SSE4.1,SSE4.2,x2APIC,POPCNT,TSCDLT,AESNI,XSAVE,OSXSAVE,AVX,F16C,RDRAND>
>   AMD Features=0x2c100800<SYSCALL,NX,Page1GB,RDTSCP,LM>
>   AMD Features2=0x1<LAHF>
>   Structured Extended Features=0x281<FSGSBASE,SMEP,ERMS>
>   XSAVE Features=0x1<XSAVEOPT>
>   VT-x: PAT,HLT,MTF,PAUSE,EPT,UG,VPID,VID,PostIntr
>   TSC: P-state invariant, performance statistics real memory  = 274877906944 (262144 MB) avail memory = 267769249792 (255364 MB)
> 
> Simplified invocation line (I tried with a lot more options initially, but this seems to get the same):
> 
> # bhyve -c 2 -m 2G -l
> bootrom,/usr/local/share/uefi-firmware/BHYVE_UEFI.fd test vm exit[0]
>         reason          VMX
>         rip             0x000000000000fff0
>         inst_length     3
>         status          0
>         exit_reason     48 (EPT violation)
>         qualification   0x0000000000000184
>         inst_type               0
>         inst_error              0
> Abort trap
> 
> # bhyve -c 2 -m 2G -l
> bootrom,/usr/local/share/uefi-firmware/BHYVE_UEFI_CSM.fd test vm exit[0]
>         reason          VMX
>         rip             0x000000000000fff0
>         inst_length     3
>         status          0
>         exit_reason     48 (EPT violation)
>         qualification   0x0000000000000184
>         inst_type               0
>         inst_error              0
> Abort trap
> 
>> Any hints?
> 
> The commands you're running aren't really very useful as you haven't provided a console device, or any disk/network/etc.

Yes, I was just trimming down the initial command to produce a small
test case, but...

> However the main issue appears to be a lack of an lpc device. I get the exact same error on a fully working system if I remove that device.

Thank you!  Indeed, adding '-s 31,lpc' solves this for me (it wasn't
there initially when I had console, disk, network, etc. if the command
line), somehow I missed its importance.

> Note there is /usr/share/examples/bhyve/vmrun.sh, and tools in ports to handle running bhyve commands for you. (Unless you are intentionally trying to learn the raw bhyve command syntax of course)

I'm just checking if I can replace ESXi instance with bhyve, the reason
being that I hope I'll be actually able to automate VM creation I need
for testing purposes without learning ESXi tools (PowerShell?).

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: OpenPGP digital signature
URL: <http://lists.freebsd.org/pipermail/freebsd-virtualization/attachments/20181012/0e2b5405/attachment.sig>


More information about the freebsd-virtualization mailing list