Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 12 Oct 2018 13:53:56 +0000
From:      Matt Churchyard <matt.churchyard@userve.net>
To:        Yuri Pankov <yuripv@yuripv.net>, freebsd-virtualization <freebsd-virtualization@freebsd.org>
Subject:   RE: bhyve VM using BHYVE_UEFI.fd gets EPT violation
Message-ID:  <b41d17573c8646caa0afe71f477e01e3@SERVER.ad.usd-group.com>
In-Reply-To: <733a71ba-fc28-1aed-a0be-16e676e18159@yuripv.net>

index | next in thread | previous in thread | raw e-mail

>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.
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.

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)

Matt


home | help

Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?b41d17573c8646caa0afe71f477e01e3>