Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 26 Dec 2019 07:56:05 +0900
From:      KIRIYAMA Kazuhiko <kiri@truefc.org>
To:        freebsd-arm@freebsd.org
Subject:   Re: Can't boot arm64 image by qemu-system-aarch64
Message-ID:  <201912252256.xBPMu5Kc090034@kx.truefc.org>
In-Reply-To: <201912040121.xB41LpIp062796@kx.truefc.org>
References:  <201912032300.xB3N0FGC061069@kx.truefc.org> <CANCZdfrnEd3Y7r3LzqqUP7f2PjMgbeNpwpgek_FDO_X1c_p5mA@mail.gmail.com> <201912040121.xB41LpIp062796@kx.truefc.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Wed, 04 Dec 2019 10:21:51 +0900,
KIRIYAMA Kazuhiko wrote:
>=20
> Hi, Warner
>=20
> On Wed, 04 Dec 2019 09:55:30 +0900,
> Warner Losh wrote:
> >=20
> > [1  <text/plain; UTF-8 (7bit)>]
> >=20
> > [2  <text/html; UTF-8 (quoted-printable)>]
> >=20
> >=20
> >=20
> >=20
> > On Tue, Dec 3, 2019, 4:00 PM KIRIYAMA Kazuhiko <kiri@truefc.org> wrote:
> >=20
> >=20
> >           Hi, all
> >     =20
> >      # I've posted freebsd-virtualization,but any responces.
> >      # Sorry for same posting.
> >     =20
> >      I've installed successfully by qemu-system-aarch64 below:
> >     =20
> >      root@vm:/vm/test # truncate -s 16g test.img
> >      root@vm:/vm/test # qemu-system-aarch64 -machine virt -m 4096M -cpu=
 cortex-a57 -name test
> >      -bios QEMU_EFI.fd -nographic -hda test.img -hdc
> >      FreeBSD-13.0-CURRENT-arm64-aarch64-20191127-r355121-memstick.img
> >     =20
> >      and rebooted successfully and login with root:
> >     =20
> >      root@test:~ # uname -a
> >      FreeBSD test.tfc 13.0-CURRENT FreeBSD 13.0-CURRENT #0 r355121: Wed=
 Nov 27 03:49:21 UTC 2019=A0
> >      =A0 =A0root@releng1.nyi.freebsd.org:/usr/obj/usr/src/arm64.aarch64=
/sys/GENERIC=A0 arm64
> >      root@test:~ # df -h
> >      Filesystem=A0 =A0 =A0 Size=A0 =A0 Used=A0 =A0Avail Capacity=A0 Mou=
nted on
> >      /dev/vtbd0p2=A0 =A0 =A014G=A0 =A0 1.3G=A0 =A0 =A012G=A0 =A0 10%=A0=
 =A0 /
> >      devfs=A0 =A0 =A0 =A0 =A0 =A01.0K=A0 =A0 1.0K=A0 =A0 =A0 0B=A0 =A01=
00%=A0 =A0 /dev
> >      root@test:~ # ifconfig
> >      vtnet0: flags=3D8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metri=
c 0 mtu 1500
> >      =A0 =A0 =A0 =A0 options=3D80028<VLAN_MTU,JUMBO_MTU,LINKSTATE>
> >      =A0 =A0 =A0 =A0 ether 52:54:00:12:34:56
> >      =A0 =A0 =A0 =A0 inet 192.168.1.196 netmask 0xffffff00 broadcast 19=
2.168.1.255
> >      =A0 =A0 =A0 =A0 media: Ethernet 10Gbase-T <full-duplex>
> >      =A0 =A0 =A0 =A0 status: active
> >      =A0 =A0 =A0 =A0 nd6 options=3D29<PERFORMNUD,IFDISABLED,AUTO_LINKLO=
CAL>
> >      lo0: flags=3D8049<UP,LOOPBACK,RUNNING,MULTICAST> metric 0 mtu 16384
> >      =A0 =A0 =A0 =A0 options=3D680003<RXCSUM,TXCSUM,LINKSTATE,RXCSUM_IP=
V6,TXCSUM_IPV6>
> >      =A0 =A0 =A0 =A0 inet6 ::1 prefixlen 128
> >      =A0 =A0 =A0 =A0 inet6 fe80::1%lo0 prefixlen 64 scopeid 0x2
> >      =A0 =A0 =A0 =A0 inet 127.0.0.1 netmask 0xff000000
> >      =A0 =A0 =A0 =A0 groups: lo
> >      =A0 =A0 =A0 =A0 nd6 options=3D21<PERFORMNUD,AUTO_LINKLOCAL>
> >      root@test:~ #
> >     =20
> >      So, I shutdowned and run by qemu-system-aarch64:
> >     =20
> >      root@vm:/vm/test # qemu-system-aarch64 -machine virt -m 4096M -cpu=
 cortex-a57 -name test
> >      -bios QEMU_EFI.fd -nographic -drive if=3Dnone,format=3Draw,file=3D=
test.img,id=3Dhd0 -device
> >      virtio-blk-device,drive=3Dhd0 -device virtio-net-device,netdev=3Dn=
et0 -netdev
> >      tap,id=3Dnet0,ifname=3Dtap2
> >     =20
> >      But failed to boot:
> >     =20
> >      BdsDxe: failed to load Boot0001 "UEFI Misc Device" from
> >      VenHw(93E34C7E-B50E-11DF-9223-2443DFD72085,00): Not Found
> >      BdsDxe: failed to load Boot0002 "UEFI Misc Device 2" from
> >      VenHw(837DCA9E-E874-4D82-B29A-23FE0E23D1E2,003E000A00000000): Not =
Found
> >     =20
> >      >>Start PXE over IPv4.
> >     =20
> >     =20
> >      where, tap2 is ready to use:
> >     =20
> >      root@vm:/vm/test # ifconfig tap2
> >      tap2: flags=3D8902<BROADCAST,PROMISC,SIMPLEX,MULTICAST> metric 0 m=
tu 1500
> >      =A0 =A0 =A0 =A0 description: vmnet-test-0-local
> >      =A0 =A0 =A0 =A0 options=3D80000<LINKSTATE>
> >      =A0 =A0 =A0 =A0 ether 58:9c:fc:10:ec:02
> >      =A0 =A0 =A0 =A0 groups: tap qemu-port
> >      =A0 =A0 =A0 =A0 media: Ethernet autoselect
> >      =A0 =A0 =A0 =A0 status: no carrier
> >      =A0 =A0 =A0 =A0 nd6 options=3D21<PERFORMNUD,AUTO_LINKLOCAL>
> >      root@vm:/vm/test #
> >     =20
> >      What's wrong ?
> >     =20
> >=20
> >=20
> >=20
> >=20
> > Where did the efi firmware come from?
>=20
> I've got from [1].
>=20
> [1] http://snapshots.linaro.org/components/kernel/leg-virt-tianocore-edk2=
-upstream/latest/QEMU-AARCH64/RELEASE_CLANG35/QEMU_EFI.fd

After I've installed by bsdinstall, I copied boot partition
from original FreeBSD boot image [1]:

root@vm:/vm/test # mdconfig -a -t vnode -f FreeBSD-13.0-CURRENT-arm64-aarch=
64-20191212-r355634-memstick.img
md0
root@vm:/vm/test # mdconfig -a -t vnode -f test.img                        =
                         md1
root@vm:/vm/test # gpart show md0
=3D>      3  2042648  md0  GPT  (997M)
        3    66584    1  efi  (33M)
    66587  1976064    2  freebsd  (965M)

root@vm:/vm/test # gpart show md1
=3D>      40  33554352  md1  GPT  (16G)
        40    532480    1  efi  (260M)
    532520  24633344    2  freebsd-ufs  (12G)
  25165864   8388528    3  freebsd-swap  (4.0G)

root@vm:/vm/test # file -s /dev/md0s1
/dev/md0s1: cannot open `/dev/md0s1' (No such file or directory)
root@vm:/vm/test # file -s /dev/md0p1=20
/dev/md0p1: DOS/MBR boot sector, code offset 0x58+2, OEM-ID "BSD4.4  ", sec=
tors/track 63, heads 255, sectors 66584 (volumes > 32 MB), FAT (32 bit), se=
ctors/FAT 512, serial number 0xeb6f0ff0, label: "EFISYS     "
root@vm:/vm/test # file -s /dev/md1p1
/dev/md1p1: DOS/MBR boot sector, code offset 0x58+2, OEM-ID "BSD4.4  ", sec=
tors/track 63, heads 16, sectors 532480 (volumes > 32 MB), FAT (32 bit), se=
ctors/FAT 4096, serial number 0x1bbb0f19, label: "EFISYS     "
root@vm:/vm/test # dd if=3D/dev/md0p1 of=3D/dev/md1p1 bs=3D10240 conv=3Dsync
3330+0 records in
3330+0 records out
34099200 bytes transferred in 4.216594 secs (8086906 bytes/sec)
root@vm:/vm/test #=20

And then try to boot by qemu-system-aarch64:

root@vm:/vm/test # qemu-system-aarch64 -machine virt -m 4096M -cpu cortex-a=
57 -name test -bios QEMU_EFI.fd -nographic -drive if=3Dnone,format=3Draw,fi=
le=3Dtest.img,id=3Dhd0 -device virtio-blk-device,drive=3Dhd0 -device virtio=
-net-device,netdev=3Dnet0 -netdev tap,id=3Dnet0,ifname=3Dtap1 -monitor none
  :
(snip)
  :
KDB: debugger backends: ddb
KDB: current backend: ddb
Copyright (c) 1992-2019 The FreeBSD Project.
Copyright (c) 1979, 1980, 1983, 1986, 1988, 1989, 1991, 1992, 1993, 1994
        The Regents of the University of California. All rights reserved.
FreeBSD is a registered trademark of The FreeBSD Foundation.
FreeBSD 13.0-CURRENT #0 r355634: Thu Dec 12 03:50:52 UTC 2019
    root@releng1.nyi.freebsd.org:/usr/obj/usr/src/arm64.aarch64/sys/GENERIC=
 arm64
FreeBSD clang version 9.0.0 (tags/RELEASE_900/final 372316) (based on LLVM =
9.0.0)
WARNING: WITNESS option enabled, expect reduced performance.
VT: init without driver.
module firmware already present!
FreeBSD/SMP: Multiprocessor System Detected: 1 CPUs
random: unblocking device.
random: entropy device external interface
MAP 13bd80000 mode 2 pages 80
MAP 13bdd0000 mode 2 pages 80
MAP 13be20000 mode 2 pages 80
MAP 13be70000 mode 2 pages 80
MAP 13bec0000 mode 2 pages 80
MAP 13bf10000 mode 2 pages 80
MAP 13bf60000 mode 2 pages 80
MAP 13bfb0000 mode 2 pages 80
MAP 13c020000 mode 2 pages 192
MAP 13c0e0000 mode 2 pages 80
MAP 13c130000 mode 2 pages 80
MAP 13c180000 mode 2 pages 80
MAP 13f4b0000 mode 2 pages 144
MAP 13f550000 mode 2 pages 288
MAP 4000000 mode 0 pages 16384
MAP 9010000 mode 0 pages 1
WARNING: Device "kbd" is Giant locked and may be deleted before FreeBSD 13.=
0.
kbd0 at kbdmux0
WARNING: Device "openfirm" is Giant locked and may be deleted before FreeBS=
D 13.0.
ofwbus0: <Open Firmware Device Tree>
simplebus0: <Flattened device tree simple bus> on ofwbus0
clk_fixed0: <Fixed clock> on ofwbus0
psci0: <ARM Power State Co-ordination Interface Driver> on ofwbus0
gic0: <ARM Generic Interrupt Controller> mem 0x8000000-0x800ffff,0x8010000-=
0x801ffff on ofwbus0
gic0: pn 0x0, arch 0x0, rev 0x0, implementer 0x0 irqs 288
gicv2m0: <ARM Generic Interrupt Controller MSI/MSIX> mem 0x8020000-0x8020ff=
f on gic0
generic_timer0: <ARMv8 Generic Timer> irq 36,37,38,39 on ofwbus0
Timecounter "ARM MPCore Timecounter" frequency 62500000 Hz quality 1000
Event timer "ARM MPCore Eventtimer" frequency 62500000 Hz quality 1000
efirtc0: <EFI Realtime Clock>
efirtc0: registered as a time-of-day clock, resolution 1.000000s
virtio_mmio0: <VirtIO MMIO adapter> mem 0xa000000-0xa0001ff irq 0 on ofwbus0
virtio_mmio1: <VirtIO MMIO adapter> mem 0xa000200-0xa0003ff irq 1 on ofwbus0
virtio_mmio2: <VirtIO MMIO adapter> mem 0xa000400-0xa0005ff irq 2 on ofwbus0
virtio_mmio3: <VirtIO MMIO adapter> mem 0xa000600-0xa0007ff irq 3 on ofwbus0
virtio_mmio4: <VirtIO MMIO adapter> mem 0xa000800-0xa0009ff irq 4 on ofwbus0
virtio_mmio5: <VirtIO MMIO adapter> mem 0xa000a00-0xa000bff irq 5 on ofwbus0
virtio_mmio6: <VirtIO MMIO adapter> mem 0xa000c00-0xa000dff irq 6 on ofwbus0
virtio_mmio7: <VirtIO MMIO adapter> mem 0xa000e00-0xa000fff irq 7 on ofwbus0
virtio_mmio8: <VirtIO MMIO adapter> mem 0xa001000-0xa0011ff irq 8 on ofwbus0
virtio_mmio9: <VirtIO MMIO adapter> mem 0xa001200-0xa0013ff irq 9 on ofwbus0
virtio_mmio10: <VirtIO MMIO adapter> mem 0xa001400-0xa0015ff irq 10 on ofwb=
us0
virtio_mmio11: <VirtIO MMIO adapter> mem 0xa001600-0xa0017ff irq 11 on ofwb=
us0
virtio_mmio12: <VirtIO MMIO adapter> mem 0xa001800-0xa0019ff irq 12 on ofwb=
us0
virtio_mmio13: <VirtIO MMIO adapter> mem 0xa001a00-0xa001bff irq 13 on ofwb=
us0
virtio_mmio14: <VirtIO MMIO adapter> mem 0xa001c00-0xa001dff irq 14 on ofwb=
us0
virtio_mmio15: <VirtIO MMIO adapter> mem 0xa001e00-0xa001fff irq 15 on ofwb=
us0
virtio_mmio16: <VirtIO MMIO adapter> mem 0xa002000-0xa0021ff irq 16 on ofwb=
us0
virtio_mmio17: <VirtIO MMIO adapter> mem 0xa002200-0xa0023ff irq 17 on ofwb=
us0
virtio_mmio18: <VirtIO MMIO adapter> mem 0xa002400-0xa0025ff irq 18 on ofwb=
us0
virtio_mmio19: <VirtIO MMIO adapter> mem 0xa002600-0xa0027ff irq 19 on ofwb=
us0
virtio_mmio20: <VirtIO MMIO adapter> mem 0xa002800-0xa0029ff irq 20 on ofwb=
us0
virtio_mmio21: <VirtIO MMIO adapter> mem 0xa002a00-0xa002bff irq 21 on ofwb=
us0
virtio_mmio22: <VirtIO MMIO adapter> mem 0xa002c00-0xa002dff irq 22 on ofwb=
us0
virtio_mmio23: <VirtIO MMIO adapter> mem 0xa002e00-0xa002fff irq 23 on ofwb=
us0
virtio_mmio24: <VirtIO MMIO adapter> mem 0xa003000-0xa0031ff irq 24 on ofwb=
us0
virtio_mmio25: <VirtIO MMIO adapter> mem 0xa003200-0xa0033ff irq 25 on ofwb=
us0
virtio_mmio26: <VirtIO MMIO adapter> mem 0xa003400-0xa0035ff irq 26 on ofwb=
us0
virtio_mmio27: <VirtIO MMIO adapter> mem 0xa003600-0xa0037ff irq 27 on ofwb=
us0
virtio_mmio28: <VirtIO MMIO adapter> mem 0xa003800-0xa0039ff irq 28 on ofwb=
us0
virtio_mmio29: <VirtIO MMIO adapter> mem 0xa003a00-0xa003bff irq 29 on ofwb=
us0
virtio_mmio30: <VirtIO MMIO adapter> mem 0xa003c00-0xa003dff irq 30 on ofwb=
us0
vtnet0: <VirtIO Networking Adapter> on virtio_mmio30
vtnet0: Ethernet address: 52:54:00:12:34:56
virtio_mmio31: <VirtIO MMIO adapter> mem 0xa003e00-0xa003fff irq 31 on ofwb=
us0
vtblk0: <VirtIO Block Adapter> on virtio_mmio31
vtblk0: 16384MB (33554432 512 byte sectors)
pcib0: <Generic PCI host controller> mem 0x4010000000-0x401fffffff on ofwbu=
s0
pci0: <PCI bus> on pcib0
uart0: <PrimeCell UART (PL011)> mem 0x9000000-0x9000fff irq 34 on ofwbus0
uart0: console (9600,n,8,1)
pmu0: <Performance Monitoring Unit> irq 35 on ofwbus0
cpulist0: <Open Firmware CPU Group> on ofwbus0
cpu0: <Open Firmware CPU> on cpulist0
cryptosoft0: <software crypto>
Timecounters tick every 1.000 msec
usb_needs_explore_all: no devclass
Trying to mount root from ufs:/dev/vtbd0p2 [rw]...
CPU  0: ARM Cortex-A57 r1p0 affinity:  0
 Instruction Set Attributes 0 =3D <CRC32,SHA2,SHA1,AES+PMULL>
 Instruction Set Attributes 1 =3D <>
         Processor Features 0 =3D <AdvSIMD,FP,EL1 32,EL0 32>
         Processor Features 1 =3D <>
      Memory Model Features 0 =3D <TGran4,TGran64,SNSMem,BigEnd,16bit ASID,=
16TB PA>
      Memory Model Features 1 =3D <8bit VMID>
      Memory Model Features 2 =3D <32bit CCIDX,48bit VA>
             Debug Features 0 =3D <2 CTX BKPTs,4 Watchpoints,6 Breakpoints,=
PMUv3,Debugv8>
             Debug Features 1 =3D <>
         Auxiliary Features 0 =3D <>
         Auxiliary Features 1 =3D <>
WARNING: WITNESS option enabled, expect reduced performance.
Setting hostuuid: 7a897831-26ec-11ea-9a61-01c2a1d8c2f1.
Setting hostid: 0xcac3642f.
Starting file system checks:
/dev/vtbd0p2: FILE SYSTEM CLEAN; SKIPPING CHECKS
/dev/vtbd0p2: clean, 2678333 free (557 frags, 334722 blocks, 0.0% fragmenta=
tion)
Mounting local filesystems:.
ELF ldconfig path: /lib /usr/lib /usr/lib/compat
Setting hostname: tbedfcaa.
Setting up harvesting: [UMA],[FS_ATIME],SWI,INTERRUPT,NET_NG,[NET_ETHER],NE=
T_TUN,MOUSE,KEYBOARD,ATTACH,CACHED
Feeding entropy: .
lo0: link state changed to UP
vtnet0: link state changed to UP
Starting Network: lo0 vtnet0.
lo0: flags=3D8049<UP,LOOPBACK,RUNNING,MULTICAST> metric 0 mtu 16384
        options=3D680003<RXCSUM,TXCSUM,LINKSTATE,RXCSUM_IPV6,TXCSUM_IPV6>
        inet6 ::1 prefixlen 128
        inet6 fe80::1%lo0 prefixlen 64 scopeid 0x2
        inet 127.0.0.1 netmask 0xff000000
        groups: lo
        nd6 options=3D21<PERFORMNUD,AUTO_LINKLOCAL>
vtnet0: flags=3D8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1=
500
        options=3D80028<VLAN_MTU,JUMBO_MTU,LINKSTATE>
        ether 52:54:00:12:34:56
        inet 192.168.1.196 netmask 0xffffff00 broadcast 192.168.1.255
        media: Ethernet 10Gbase-T <full-duplex>
        status: active
        nd6 options=3D29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL>
Starting devd.
add host 127.0.0.1: gateway lo0 fib 0: route already in table
add net default: gateway 192.168.1.254
add host ::1: gateway lo0 fib 0: route already in table
add net fe80::: gateway ::1
add net ff02::: gateway ::1
add net ::ffff:0.0.0.0: gateway ::1
add net ::0.0.0.0: gateway ::1
Creating and/or trimming log files.
Starting syslogd.
No core dumps found.
Clearing /tmp (X related).
Updating motd:.
Mounting late filesystems:.
Security policy loaded: MAC/ntpd (mac_ntpd)
Starting ntpd.
Updating /var/run/os-release done.
Starting powerd.
powerd: no cpufreq(4) support -- aborting: No such file or directory
/etc/rc: WARNING: failed to start powerd
Performing sanity check on sshd configuration.
Starting sshd.
Starting sendmail_submit.
Starting sendmail_msp_queue.
Starting cron.
Starting default mousedmoused: unable to open /dev/psm0: No such file or di=
rectory
=2E
eval: cannot open /dev/ttyv*: No such file or directory
Starting background file system checks in 60 seconds.

Thu Dec 26 07:37:23 JST 2019

FreeBSD/arm64 (tbedfcaa) (ttyu0)

login: root
Password:
Dec 26 07:37:30 tbedfcaa login[811]: ROOT LOGIN (root) ON ttyu0
Last login: Thu Dec 26 07:34:01 on ttyu0
FreeBSD 13.0-CURRENT (GENERIC) #0 r355634: Thu Dec 12 03:50:52 UTC 2019

Welcome to FreeBSD!

Release Notes, Errata: https://www.FreeBSD.org/releases/
Security Advisories:   https://www.FreeBSD.org/security/
FreeBSD Handbook:      https://www.FreeBSD.org/handbook/
FreeBSD FAQ:           https://www.FreeBSD.org/faq/
Questions List: https://lists.FreeBSD.org/mailman/listinfo/freebsd-question=
s/
FreeBSD Forums:        https://forums.FreeBSD.org/

Documents installed with the system are in the /usr/local/share/doc/freebsd/
directory, or can be installed later with:  pkg install en-freebsd-doc
For other languages, replace "en" with a language code like de or fr.

Show the version of FreeBSD installed:  freebsd-version ; uname -a
Please include that output and any error messages when posting questions.
Introduction to manual pages:  man man
FreeBSD directory layout:      man hier

Edit /etc/motd.template to change this login announcement.
root@tbedfcaa:~ # uname -a
FreeBSD tbedfcaa 13.0-CURRENT FreeBSD 13.0-CURRENT #0 r355634: Thu Dec 12 0=
3:50:52 UTC 2019     root@releng1.nyi.freebsd.org:/usr/obj/usr/src/arm64.aa=
rch64/sys/GENERIC  arm64
root@tbedfcaa:~ # df -h
Filesystem      Size    Used   Avail Capacity  Mounted on
/dev/vtbd0p2     11G    1.1G    9.3G    11%    /
devfs           1.0K    1.0K      0B   100%    /dev
root@tbedfcaa:~ #=20

Wow! Booted perfectly!!! I think it seems bsdinstall take
place someting strange at install boot partition process or
/boot/boot1.efi in /usr/freebsd-dist/base.txz collapsed ?

[1] FreeBSD-13.0-CURRENT-arm64-aarch64-20191212-r355634-memstick.img

>=20
> >=20
> >=20
> >=20
> > Warner
> >=20
> >=20
> >=20
> >=20
> >=20
> >                Best regards.
> >      ---
> >      Kiriyama Kazuhiko <kiri@truefc.org>
> >     =20
> >      _______________________________________________
> >      freebsd-arm@freebsd.org mailing list
> >      https://lists.freebsd.org/mailman/listinfo/freebsd-arm
> >      To unsubscribe, send any mail to "freebsd-arm-unsubscribe@freebsd.=
org"
> >     =20
> >=20
> >=20
> ---
> Kiriyama Kazuhiko <kiri@truefc.org>
>=20



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201912252256.xBPMu5Kc090034>