Re: Problem running FreeBSD/RISC-V in QEMU

From: Mitchell Horne <mhorne_at_FreeBSD.org>
Date: Fri, 20 May 2022 20:44:29 UTC
On 2022-05-20 8:36 a.m., lars.sonchocky-helldorf@hamburg.de wrote:
> Hi everybody,
> 
> 
> I am trying to run FreeBSD/RISC-V in QEMU.
> 
> For that purpose I have installed FreeBSD/amd64 inside Virtual Box on a macOS machine:
> 
> FreeBSD FreeBSD14 14.0-CURRENT FreeBSD 14.0-CURRENT #0 main-n255696-716fd348e01: Thu May 19 08:29:12 UTC 2022     root@releng1.nyi.freebsd.org:/usr/obj/usr/src/amd64.amd64/sys/GENERIC amd64
> 
> and then followed those instructions:
> 
> https://wiki.freebsd.org/riscv#Quick_Start
> 
> 
> 
> The boot process is initialized but then however I get repeatedly:
> 
> failed to allocate staging area: 9
> 
> here is the part where it fails, truncated, since the above message is repeated endlessly:
> 
> Loading kernel...
> /boot/kernel/kernel text=0x5a5e88 text=0x172c34 data=0xf8350 data=0x1eac+0x273b9c 0x8+0x1efc360+0x8+0xf28d3
> Loading configured modules...
> can't find '/etc/hostid'
> can't find '/boot/entropy'
> Using DTB provided by EFI at 0x87efb000.
> Kernel entry at 0xf660002e...
> Kernel args: (null)
> failed to allocate staging area: 9
> failed to allocate staging area: 9
> 
> 
> What is going wrong here?
> 

Seems to be a bug made visible by the recent upgrade of LLVM/clang. It 
was reported here:

https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=264021

If you grab the snapshot from 2 weeks ago, it might not exhibit this 
problem. Otherwise, it looks like a fix is in progress.

https://download.freebsd.org/snapshots/VM-IMAGES/14.0-CURRENT/riscv64/20220505/

Cheers,
Mitchell

> 
> Thanks in advance and if you need more information please let me know!
> 
> Kind regards,
> 
> 	Lars