Bug 264338 - sysutils/edk2: vm_run error -1, errno 14
Summary: sysutils/edk2: vm_run error -1, errno 14
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Some People
Assignee: freebsd-uboot (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-05-30 00:32 UTC by Ivan Rozhuk
Modified: 2022-06-05 16:58 UTC (History)
15 users (show)

See Also:
bugzilla: maintainer-feedback? (uboot)


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ivan Rozhuk 2022-05-30 00:32:02 UTC
edk2-bhyve-g202202 failed: vm_run error -1, errno 14
same config work with uefi-edk2-bhyve-g20210226_1,2

FreeBSD 13.1@amd64, build from latest commit.
Guest: openwrt
Comment 1 arkadyi 2022-05-30 16:18:05 UTC
I have the same mistake. All virtual machines that use UEFI do not work.
FreeBSD 13.1-RELEASE
edk2-bhyve-g202202
Guests: Win7 & Linux Mint
Error: vm_run error -1, errno 14
Comment 2 Emmanuel Vadot freebsd_committer freebsd_triage 2022-05-30 16:21:24 UTC
Yes I got hit by this today too.
Comment 3 Ivan Rozhuk 2022-05-30 19:13:19 UTC
As workaround I copy old uefi bootrom and use it.
Comment 4 Axey Gabriel Muller Endres 2022-05-30 21:28:00 UTC
same here
Comment 5 nerozero 2022-05-31 16:39:54 UTC
And here is my voice too.
where can I get "old uefi bootrom"
Comment 6 Ivan Rozhuk 2022-05-31 17:05:52 UTC
(In reply to nerozero from comment #5)

http://www.netlab.linkpc.net/download/tmp/BHYVE_UEFI.fd
mine copy
Comment 7 nerozero 2022-05-31 17:06:58 UTC
(In reply to Ivan Rozhuk from comment #6)

Ivan, Thank you so much for quick reply !
Comment 8 nerozero 2022-05-31 17:21:09 UTC
I can confirm, old firmware working. 
Ivan, thanks!
Comment 9 D. Sun 2022-05-31 19:30:42 UTC
Have the same issue as well, using the old firmware files from uefi-edk2-bhyve-g20210226 resolved the issue.  It can be downloaded from https://pkg.freebsd.org/FreeBSD:13:amd64/release_1/All/uefi-edk2-bhyve-g20210226,2.pkg

Host is FreeBSD 13.1.  Guest VMs are Windows 11 and Ubuntu 22.04.
Comment 10 Tobias Henöckl 2022-06-02 11:31:41 UTC
(In reply to D. Sun from comment #9)
Reinstalling the old firmware fixed it for me, thanks!
[FreeBSD 13.1-RELEASE / edk2-bhyve-g202202]
Comment 11 Andrey Fesenko 2022-06-02 20:38:50 UTC
if use BHYVE_UEFI_CODE.fd vm start success
Comment 12 Dries Michiels freebsd_committer freebsd_triage 2022-06-02 22:19:06 UTC
if use BHYVE_UEFI_CODE.fd vm start success => Indeed!

It seems that vm-bhyve script only uses this when setting loader="uefi-devel" but than it also appends -devel to the firmware name so it wont work out of the box. Right now I'm using "loader"="uefi-custom", and created a symlink in vmdir/.config/ as such "BHYVE_UEFI.fd -> /usr/local/share/edk2-bhyve/BHYVE_UEFI_CODE.fd".

This makes me wonder, maybe the edk2 port has caught up to the "devel version intended in vm-bhyve script" back in the time, so now we should actually use BHYVE_UEFI_CODE.fd.

https://github.com/churchers/vm-bhyve/blob/ec0e12e97465822d65ab32e791049d69791d49cb/lib/vm-run#L277

I have been thinking for a while to create a vm-bhyve-devel port, to actually tracks commits of vm-bhyve upstream. Unfortunately the owner of the repo hasn't been so good in creating releases.
Comment 13 D. Sun 2022-06-02 23:01:29 UTC
Same, using BHYVE_UEFI_CODE.fd instead of BHYVE_UEFI.fd worked.
Comment 14 commit-hook freebsd_committer freebsd_triage 2022-06-03 08:28:59 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=3023881d2e9b0f07aeca701e99caed5039206e06

commit 3023881d2e9b0f07aeca701e99caed5039206e06
Author:     Emmanuel Vadot <manu@FreeBSD.org>
AuthorDate: 2022-06-03 08:23:41 +0000
Commit:     Emmanuel Vadot <manu@FreeBSD.org>
CommitDate: 2022-06-03 08:23:41 +0000

    sysutils/edk2@bhyve: Fix main firmware

    EDK2 produce multiple files for the bhyve flavor, _CODE and _DATA
    The PLAT_RESULT is just a concat of both.
    But bhyve doesn't support having only one file.
    When it was its own port we just install the _CODE file as the main file
    instead of using the concat one generated during edk2 build.
    For this port we need to use the main PLAT_RESULT files for all flavors
    except bhyve so add a quirks in the install phase that just replace the main
    file with the _CODE one.
    Thanks to Corvin Köhne <CorvinK@beckhoff.com> for helping me understanding
    the issue.

    Fixes:          2e6a6ccd15 ("sysutils/edk2: Add bhyve as a new FLAVOR of edk2")
    Sponsored by:   Beckhoff Automation GmbH & Co. KG
    PR:             264338

 sysutils/edk2/Makefile | 2 ++
 1 file changed, 2 insertions(+)
Comment 15 Rebecca Cran freebsd_committer freebsd_triage 2022-06-05 16:58:22 UTC
Thank you for fixing this.
I'm sorry I couldn't work on this last week, my brain wasn't cooperating.