Page MenuHomeFreeBSD

FreeBSD enablement for ARM64 in Hyper-V
ClosedPublic

Authored by schakrabarti_microsoft.com on Sep 27 2022, 12:21 PM.

Details

Summary

These are the common files and make file changes to enable FreeBSD for ARM64 in Hyper-V.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

sys/arm64/conf/std.dev
112

I think this probably does not belong in std.dev, since it would then be included in SOC-specific kernels which do not run in Hyper-V. std.virt perhaps?

There are a few places you check for !aarch64. I think these would be better if you check for amd64 || i386 to document which architectures the code is for.

sys/arm64/conf/std.dev
112

It should be in std.hyperv. See D36776 for an example of a std.* file being added. In that case AWS.

sys/dev/hyperv/vmbus/vmbus_var.h
160

This should be checking for amd64 or i386

sys/modules/hyperv/vmbus/Makefile
21

This should be checking for amd64 or i386

Can you rebase this on a recent main? I'm getting conflicts while trying to apply it.

This revision was not accepted when it landed; it landed in state Needs Review.Oct 27 2022, 1:54 PM
This revision was automatically updated to reflect the committed changes.

after bisecting it seems this commit causes RPI4b (early model) to hang on (pxe-)boot short before starting CPUs :

FreeBSD 14.0-CURRENT #19 main-n258880-41b51c5030b: Fri Oct 28 18:33:50 CEST 2022
    root@fbsdr5pro:/usr/obj/usr/src/arm64.aarch64/sys/GENERIC-MMCCAM arm64
FreeBSD clang version 14.0.5 (https://github.com/llvm/llvm-project.git llvmorg-14.0.5-0-gc12386ae247c)
WARNING: WITNESS option enabled, expect reduced performance.
VT(efifb): resolution 1824x984
--hang here--

a git hard reset to previous commit 9349fc283b581a52396b6027bfa792e61dfd8035 brought the machine back to boot.

Regards
K.

mmel added inline comments.
sys/arm64/conf/std.dev
112

You seem to have forgotten to delete this line from the committed version.

after bisecting it seems this commit causes RPI4b (early model) to hang on (pxe-)boot short before starting CPUs :

I've hopefully disabled building hyperv support in the kernel until the boot issue on non-hyperv is fixed.

after bisecting it seems this commit causes RPI4b (early model) to hang on (pxe-)boot short before starting CPUs :

I've hopefully disabled building hyperv support in the kernel until the boot issue on non-hyperv is fixed.

thank you,
since, as you said before, this commit D36744 has many git conflicts
I'll try to rebase to current including your last commit and then recompile.

I've hopefully disabled building hyperv support in the kernel until the boot issue on non-hyperv is fixed.

yep, machine is alive and in sync with current again :

--------------------------------------------------------------
>>> Installing kernel GENERIC-MMCCAM completed on Fri Oct 28 23:46:35 CEST 2022
--------------------------------------------------------------
root@fbsdr5pro:/usr/src # git rev-parse --short HEAD                            aba921bd9e1
.... pxe-boot:--
root@:~ # uname -a
FreeBSD  14.0-CURRENT FreeBSD 14.0-CURRENT #22 main-n258900-aba921bd9e1: Fri Oct 28 23:44:04 CEST 2022     root@fbsdr5pro:/usr/obj/usr/src/arm64.aarch64/sys/GENERIC-MMCCAM arm64
}

thank you!