Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 12 Oct 2018 17:22:12 +0300
From:      Yuri Pankov <yuripv@yuripv.net>
To:        Matt Churchyard <matt.churchyard@userve.net>, freebsd-virtualization <freebsd-virtualization@freebsd.org>
Subject:   Re: bhyve VM using BHYVE_UEFI.fd gets EPT violation
Message-ID:  <17e01512-4f67-b2ae-8f15-6ad393fe010f@yuripv.net>
In-Reply-To: <b41d17573c8646caa0afe71f477e01e3@SERVER.ad.usd-group.com>
References:  <733a71ba-fc28-1aed-a0be-16e676e18159@yuripv.net> <b41d17573c8646caa0afe71f477e01e3@SERVER.ad.usd-group.com>

next in thread | previous in thread | raw e-mail | index | archive | help
This is an OpenPGP/MIME signed message (RFC 4880 and 3156)
--fdUCZmJbDZing43H0npF24tUQpPCgmvmW
Content-Type: multipart/mixed; boundary="iO9DyWmJ5IckzKFcdRkB7hmWPGGUvaSKC";
 protected-headers="v1"
From: Yuri Pankov <yuripv@yuripv.net>
To: Matt Churchyard <matt.churchyard@userve.net>,
 freebsd-virtualization <freebsd-virtualization@freebsd.org>
Message-ID: <17e01512-4f67-b2ae-8f15-6ad393fe010f@yuripv.net>
Subject: Re: bhyve VM using BHYVE_UEFI.fd gets EPT violation
References: <733a71ba-fc28-1aed-a0be-16e676e18159@yuripv.net>
 <b41d17573c8646caa0afe71f477e01e3@SERVER.ad.usd-group.com>
In-Reply-To: <b41d17573c8646caa0afe71f477e01e3@SERVER.ad.usd-group.com>

--iO9DyWmJ5IckzKFcdRkB7hmWPGGUvaSKC
Content-Type: text/plain; charset=utf-8
Content-Language: en-US
Content-Transfer-Encoding: quoted-printable

Matt Churchyard wrote:
>> Hi,
>=20
>> I'm taking my first steps in using bhyve, and the first showstopper se=
ems to be that using '-l bootrom,/usr/local/share/uefi-firmware/BHYVE_UEF=
I.fd' gets me immediate vm exit with >exit_reason being 48 (EPT violation=
).
>=20
>> Relevant part of dmesg:
>=20
> 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 CP=
U)
>   Origin=3D"GenuineIntel"  Id=3D0x306e4  Family=3D0x6  Model=3D0x3e  St=
epping=3D4
>=20
> Features=3D0xbfebfbff<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>
>=20
> Features2=3D0x7fbee3ff<SSE3,PCLMULQDQ,DTES64,MON,DS_CPL,VMX,SMX,EST,TM2=
,SSSE3,CX16,xTPR,PDCM,PCID,DCA,SSE4.1,SSE4.2,x2APIC,POPCNT,TSCDLT,AESNI,X=
SAVE,OSXSAVE,AVX,F16C,RDRAND>
>   AMD Features=3D0x2c100800<SYSCALL,NX,Page1GB,RDTSCP,LM>
>   AMD Features2=3D0x1<LAHF>
>   Structured Extended Features=3D0x281<FSGSBASE,SMEP,ERMS>
>   XSAVE Features=3D0x1<XSAVEOPT>
>   VT-x: PAT,HLT,MTF,PAUSE,EPT,UG,VPID,VID,PostIntr
>   TSC: P-state invariant, performance statistics real memory  =3D 27487=
7906944 (262144 MB) avail memory =3D 267769249792 (255364 MB)
>=20
> Simplified invocation line (I tried with a lot more options initially, =
but this seems to get the same):
>=20
> # 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
>=20
> # 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
>=20
>> Any hints?
>=20
> The commands you're running aren't really very useful as you haven't pr=
ovided 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 try=
ing 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?).


--iO9DyWmJ5IckzKFcdRkB7hmWPGGUvaSKC--

--fdUCZmJbDZing43H0npF24tUQpPCgmvmW
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: OpenPGP digital signature
Content-Disposition: attachment; filename="signature.asc"

-----BEGIN PGP SIGNATURE-----

iQEzBAEBCAAdFiEE+Gq3PsPeLT4tL/9wk4vgf7Eq4WwFAlvArhQACgkQk4vgf7Eq
4Wyjxwf/T2Cujy5U4oGnQwRHw7h9MBO/EJt+PDcmhjnZ8gct0ndofVnZL7kvRw6W
gyeDVmQZMXYHDwkraUN114/veDObeoS2abXN2Fjj7S7DgRwUjfueoOHw/1VKju3r
TP2wF1EopXeFmWj8+lBUxKiw9LGiMiglPKb0yJb9sR2kWBuyfp9ZhGuQxI6fjAOn
YiMZtsFzHCzcb8T2cLLcOzzulWrmN54dkym9NeveJwDK4ubiNnnNc4mf47SPCoWt
StCP6Wy+QFnmSfTZbqkmndabGlTPR6W6AT74RsI+VFmZzzaO12xNXL6DulHQ2Bx5
vi/rj6BlPQc4S5O3L7ZFcgxgoW95gw==
=s4sm
-----END PGP SIGNATURE-----

--fdUCZmJbDZing43H0npF24tUQpPCgmvmW--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?17e01512-4f67-b2ae-8f15-6ad393fe010f>