From owner-freebsd-arm@freebsd.org Wed Dec 25 22:56:13 2019 Return-Path: Delivered-To: freebsd-arm@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 43EBB1E784A for ; Wed, 25 Dec 2019 22:56:13 +0000 (UTC) (envelope-from kiri@truefc.org) Received: from kx.truefc.org (flets-sg1026.kamome.or.jp [202.216.24.26]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp", Issuer "smtp" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 47jpNW1Q0Lz4LTm for ; Wed, 25 Dec 2019 22:56:10 +0000 (UTC) (envelope-from kiri@truefc.org) Received: from kx.truefc.org (kx.truefc.org [202.216.24.26]) by kx.truefc.org (8.15.2/8.15.2) with ESMTP id xBPMu5Kc090034; Thu, 26 Dec 2019 07:56:05 +0900 (JST) (envelope-from kiri@kx.truefc.org) Message-Id: <201912252256.xBPMu5Kc090034@kx.truefc.org> Date: Thu, 26 Dec 2019 07:56:05 +0900 From: KIRIYAMA Kazuhiko To: freebsd-arm@freebsd.org Subject: Re: Can't boot arm64 image by qemu-system-aarch64 In-Reply-To: <201912040121.xB41LpIp062796@kx.truefc.org> References: <201912032300.xB3N0FGC061069@kx.truefc.org> <201912040121.xB41LpIp062796@kx.truefc.org> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI/1.14.6 (Maruoka) FLIM/1.14.9 (=?ISO-8859-4?Q?Goj=F2?=) APEL/10.8 MULE XEmacs/21.4 (patch 24) (Standard C) (amd64--freebsd) MIME-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Rspamd-Queue-Id: 47jpNW1Q0Lz4LTm X-Spamd-Bar: / Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=none (mx1.freebsd.org: domain of kiri@truefc.org has no SPF policy when checking 202.216.24.26) smtp.mailfrom=kiri@truefc.org X-Spamd-Result: default: False [-0.24 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-0.80)[-0.795,0]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; TO_DN_SOME(0.00)[]; NEURAL_HAM_LONG(-0.59)[-0.586,0]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[truefc.org]; AUTH_NA(1.00)[]; TO_MATCH_ENVRCPT_SOME(0.00)[]; R_SPF_NA(0.00)[]; RCVD_COUNT_ONE(0.00)[1]; RCVD_NO_TLS_LAST(0.10)[]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:4704, ipnet:202.216.0.0/19, country:JP]; IP_SCORE(0.04)[asn: 4704(0.16), country: JP(0.03)]; ONCE_RECEIVED(0.10)[] X-BeenThere: freebsd-arm@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Porting FreeBSD to ARM processors." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Dec 2019 22:56:13 -0000 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 ] > >=20 > > [2 ] > >=20 > >=20 > >=20 > >=20 > > On Tue, Dec 3, 2019, 4:00 PM KIRIYAMA Kazuhiko 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 metri= c 0 mtu 1500 > > =A0 =A0 =A0 =A0 options=3D80028 > > =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 > > =A0 =A0 =A0 =A0 status: active > > =A0 =A0 =A0 =A0 nd6 options=3D29 > > lo0: flags=3D8049 metric 0 mtu 16384 > > =A0 =A0 =A0 =A0 options=3D680003 > > =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 > > 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 metric 0 m= tu 1500 > > =A0 =A0 =A0 =A0 description: vmnet-test-0-local > > =A0 =A0 =A0 =A0 options=3D80000 > > =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 > > 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: simplebus0: on ofwbus0 clk_fixed0: on ofwbus0 psci0: on ofwbus0 gic0: mem 0x8000000-0x800ffff,0x8010000-= 0x801ffff on ofwbus0 gic0: pn 0x0, arch 0x0, rev 0x0, implementer 0x0 irqs 288 gicv2m0: mem 0x8020000-0x8020ff= f on gic0 generic_timer0: 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: efirtc0: registered as a time-of-day clock, resolution 1.000000s virtio_mmio0: mem 0xa000000-0xa0001ff irq 0 on ofwbus0 virtio_mmio1: mem 0xa000200-0xa0003ff irq 1 on ofwbus0 virtio_mmio2: mem 0xa000400-0xa0005ff irq 2 on ofwbus0 virtio_mmio3: mem 0xa000600-0xa0007ff irq 3 on ofwbus0 virtio_mmio4: mem 0xa000800-0xa0009ff irq 4 on ofwbus0 virtio_mmio5: mem 0xa000a00-0xa000bff irq 5 on ofwbus0 virtio_mmio6: mem 0xa000c00-0xa000dff irq 6 on ofwbus0 virtio_mmio7: mem 0xa000e00-0xa000fff irq 7 on ofwbus0 virtio_mmio8: mem 0xa001000-0xa0011ff irq 8 on ofwbus0 virtio_mmio9: mem 0xa001200-0xa0013ff irq 9 on ofwbus0 virtio_mmio10: mem 0xa001400-0xa0015ff irq 10 on ofwb= us0 virtio_mmio11: mem 0xa001600-0xa0017ff irq 11 on ofwb= us0 virtio_mmio12: mem 0xa001800-0xa0019ff irq 12 on ofwb= us0 virtio_mmio13: mem 0xa001a00-0xa001bff irq 13 on ofwb= us0 virtio_mmio14: mem 0xa001c00-0xa001dff irq 14 on ofwb= us0 virtio_mmio15: mem 0xa001e00-0xa001fff irq 15 on ofwb= us0 virtio_mmio16: mem 0xa002000-0xa0021ff irq 16 on ofwb= us0 virtio_mmio17: mem 0xa002200-0xa0023ff irq 17 on ofwb= us0 virtio_mmio18: mem 0xa002400-0xa0025ff irq 18 on ofwb= us0 virtio_mmio19: mem 0xa002600-0xa0027ff irq 19 on ofwb= us0 virtio_mmio20: mem 0xa002800-0xa0029ff irq 20 on ofwb= us0 virtio_mmio21: mem 0xa002a00-0xa002bff irq 21 on ofwb= us0 virtio_mmio22: mem 0xa002c00-0xa002dff irq 22 on ofwb= us0 virtio_mmio23: mem 0xa002e00-0xa002fff irq 23 on ofwb= us0 virtio_mmio24: mem 0xa003000-0xa0031ff irq 24 on ofwb= us0 virtio_mmio25: mem 0xa003200-0xa0033ff irq 25 on ofwb= us0 virtio_mmio26: mem 0xa003400-0xa0035ff irq 26 on ofwb= us0 virtio_mmio27: mem 0xa003600-0xa0037ff irq 27 on ofwb= us0 virtio_mmio28: mem 0xa003800-0xa0039ff irq 28 on ofwb= us0 virtio_mmio29: mem 0xa003a00-0xa003bff irq 29 on ofwb= us0 virtio_mmio30: mem 0xa003c00-0xa003dff irq 30 on ofwb= us0 vtnet0: on virtio_mmio30 vtnet0: Ethernet address: 52:54:00:12:34:56 virtio_mmio31: mem 0xa003e00-0xa003fff irq 31 on ofwb= us0 vtblk0: on virtio_mmio31 vtblk0: 16384MB (33554432 512 byte sectors) pcib0: mem 0x4010000000-0x401fffffff on ofwbu= s0 pci0: on pcib0 uart0: mem 0x9000000-0x9000fff irq 34 on ofwbus0 uart0: console (9600,n,8,1) pmu0: irq 35 on ofwbus0 cpulist0: on ofwbus0 cpu0: on cpulist0 cryptosoft0: 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 Instruction Set Attributes 1 =3D <> Processor Features 0 =3D Processor Features 1 =3D <> Memory Model Features 0 =3D 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 metric 0 mtu 16384 options=3D680003 inet6 ::1 prefixlen 128 inet6 fe80::1%lo0 prefixlen 64 scopeid 0x2 inet 127.0.0.1 netmask 0xff000000 groups: lo nd6 options=3D21 vtnet0: flags=3D8843 metric 0 mtu 1= 500 options=3D80028 ether 52:54:00:12:34:56 inet 192.168.1.196 netmask 0xffffff00 broadcast 192.168.1.255 media: Ethernet 10Gbase-T status: active nd6 options=3D29 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 > > =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 >=20