From owner-freebsd-virtualization@freebsd.org Fri Oct 12 14:22:26 2018 Return-Path: Delivered-To: freebsd-virtualization@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5F36A10BFD61 for ; Fri, 12 Oct 2018 14:22:26 +0000 (UTC) (envelope-from yuripv@yuripv.net) Received: from out3-smtp.messagingengine.com (out3-smtp.messagingengine.com [66.111.4.27]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EFC5884B9B for ; Fri, 12 Oct 2018 14:22:25 +0000 (UTC) (envelope-from yuripv@yuripv.net) Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.nyi.internal (Postfix) with ESMTP id 69608213FC; Fri, 12 Oct 2018 10:22:25 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute5.internal (MEProxy); Fri, 12 Oct 2018 10:22:25 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yuripv.net; h= subject:to:references:from:message-id:date:mime-version :in-reply-to:content-type; s=fm3; bh=4ZLQvvg87+hqDpiqC1xWBL5opgW ujKcykjx0LvOqLRg=; b=yuqyIt//17h3JI8IeK0wVvVYAG2NUeTMzVNGGjiKgeJ xW3/eK5wIEgx79H8d+U3EYo3SgJrnaziKFfyQLm0Sc4P85dsBYk9V4cKsbaMbcpI EXybvEGSCBMJg+wqQHTRDRekyzrTxMSGar/ML6kHjv8YQ+dhJQ63zPscA5u4/9Fk cQPNc+y3yr7g5RWzkFPLlJ0eszPGR6digmh+SwUdn22hsS3YNhxTECS8zRBSvWFM lONg7l4txqRCS4LURf5gUlsXwcdAQSOkqzrFPKi+AGYO4vx+mPlPDiVzd7T0ZNPM 9ldD71P1qS7HLWwxy63xHuVVYTojUwBc48Mv6D+BMFQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm1; bh=4ZLQvv g87+hqDpiqC1xWBL5opgWujKcykjx0LvOqLRg=; b=WnJwj5kVvHnR53GXcTkkM9 ph7LSYfGWSY91OA7PRrUCkx2OlQmxddStN4y9H8XtHHHy7nf0txjBE8VhQMOK/KH 4U3IKk3qfqDhb9uan4ViVOLClB7UJ+Ic2lmKfN01tzq8Jc3mJV1Zr1Rbhdir45I5 n7o4J/XoUwbNpHAzH5CKIBmexwIUSJPQevRSiOHysUySkmyAI0u1wQD6K4XRdmsN Rl8GlT0otHB3DdJqT1I6AV18V8c6p8zjiSBjbHPzulCAhe2GHkOVTKET4k03Q98Z hFnsRVyjz+dsINIf1F03YkKZc1jkBCVrNdgFaDeT5sIyjAh90A1a79vWWXvzU75g == X-ME-Sender: X-ME-Proxy: Received: from [192.168.1.2] (unknown [94.233.225.150]) by mail.messagingengine.com (Postfix) with ESMTPA id 46BE5102EA; Fri, 12 Oct 2018 10:22:23 -0400 (EDT) Subject: Re: bhyve VM using BHYVE_UEFI.fd gets EPT violation To: Matt Churchyard , freebsd-virtualization References: <733a71ba-fc28-1aed-a0be-16e676e18159@yuripv.net> From: Yuri Pankov Openpgp: preference=signencrypt Autocrypt: addr=yuripv@yuripv.net; keydata= xsBNBFu8u6IBCADB11gP0QwnorrHjqAtKLHKHNHskhy0s7jqJKfx0YqXgVBKGLJ9/mjLAz0F CBNvemHSDDTs0mEZ9cBKKi6cmsav6+UQgr//yai6hvXLBJqKchSFO4MhmdvBtsGFq1yKz5Zi uhjmimKyIpgBgvMdbgGbGq6cnSB2uEPmZuJr419SVRODOkXukU+F5WHgaHzDdHAIu1asCt2B +6msxqIqlFWcXyZyTGicTGGvC/PFIsVRUtD1dIJANTC876g7DTb7LZXWiWwJpSJ4GKMXMHVX Ct9BoQ4i3nhKbOxb6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D3kh2i29BrxWQWa9WNue9ozxeYkbkfXubQYXexVolRsnh64OdGsE8KvorBFBB3zdK/GRt2Jy +jsnTfUWuQllbzMP0MfhCDMk1Mo8WvDH2/cOEP/yLKf20a+cd6nLs7bidjmGXo9pyuBKAtV6 Kv+VRu54AL+A/UBYu/eB3Dtvzcnut+1Zq6KaP++kUwPwINLIk04OBDwN0zRNTiqMAFYYyz2v ZHBB6E1th/l//ZC5b9Dk0ZpFI1bYdL9ymnrZe1MqbGPnDCToQxu00T/pZCm6Z92YrZQYuNwl Message-ID: <17e01512-4f67-b2ae-8f15-6ad393fe010f@yuripv.net> Date: Fri, 12 Oct 2018 17:22:12 +0300 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.2.1 MIME-Version: 1.0 In-Reply-To: Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="fdUCZmJbDZing43H0npF24tUQpPCgmvmW" X-BeenThere: freebsd-virtualization@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "Discussion of various virtualization techniques FreeBSD supports." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 12 Oct 2018 14:22:26 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --fdUCZmJbDZing43H0npF24tUQpPCgmvmW Content-Type: multipart/mixed; boundary="iO9DyWmJ5IckzKFcdRkB7hmWPGGUvaSKC"; protected-headers="v1" From: Yuri Pankov To: Matt Churchyard , freebsd-virtualization 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> In-Reply-To: --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 >=20 > Features2=3D0x7fbee3ff > AMD Features=3D0x2c100800 > AMD Features2=3D0x1 > Structured Extended Features=3D0x281 > XSAVE Features=3D0x1 > 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--