Received: by 2002:a19:c345:0:0:0:0:0 with SMTP id t66csp53248lff; Thu, 12 Dec 2019 15:25:51 -0800 (PST) X-Google-Smtp-Source: APXvYqxeGKFmcZidAGfLhqLBbese/B2QHxzrsMd2prbKlmz7IZiS5GyWmELM2y64IhAshzkAGt7N X-Received: by 2002:a17:906:c791:: with SMTP id cw17mr12695764ejb.69.1576193151087; Thu, 12 Dec 2019 15:25:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1576193151; cv=none; d=google.com; s=arc-20160816; b=Ius2fe6eVxcYfY7Wr7z/zvbSkwSWGlP+gtUaUWNmkn22tq0iB/ojEnI0Xeln3GzWNs cpYWSvZQqFB9O4hvnmsqoI27dilw/Lt/n2Nubmk5yMqop9H4XGOdiIpUNWGgf/2MRTrR u0PL9XgrIApzeFzK1EBxah7h2JI0yy7+WOiVZ/qbihVkl0HV5x/vFoFguwUwvVZgiwc3 46uqJppUaR0ESUaCT0VyOGgUFuaofrwh/CMT0JuxHxGDmSZQObXAyrB2I3UO/Be2aISg HTRbxkhjK0h7CoiWNudluXK5FFIu1T2pcc7brQCNZ4Zzh6N/Yi00g80YZkEUAvVK8Jwd 4EDw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:content-language:in-reply-to:mime-version :user-agent:date:message-id:from:references:cc:to:subject :dkim-signature; bh=9bm5i+WqIWVShCZh3myFNfdKln7wDmsnYzUCxNSPbsg=; b=CD5K+YWbM1aTUoerZbARN13tg5t1pVEwa6zwVqP5YmRWwYe877wskCylZoM3HibzOD CyyzQjvp8EJfTJK9gBjd1pUn4fED/ssRu+i0JphyV4/e3M4lzQ2Y3PgYFdxihH2MsxTE RyMstF7yQ+ZLhEiBGROyO/IG6mTCoobFkPfuDX+Aa4wwcvHaJLH8t5UWs6tASfg8drPm MNdAjVSSL8ociQZMi8ttqtsMOjlAiFzGqpQ33aWu31h3Hq/Qc91MNZ+nqG1Ol0Q9iLo7 MJA3Elb5cBV0dM3ar2LLEoFBEr7A22BEnOK9EwAqL2nwPbCoXCtpLtiZXAIE0Xx0ClWa D1gw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=iraOjb6h; spf=pass (google.com: domain of philmd@redhat.com designates 207.211.31.81 as permitted sender) smtp.mailfrom=philmd@redhat.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from us-smtp-delivery-1.mimecast.com (us-smtp-2.mimecast.com. [207.211.31.81]) by mx.google.com with ESMTPS id i6si5185305ejv.240.2019.12.12.15.25.50 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 12 Dec 2019 15:25:51 -0800 (PST) Received-SPF: pass (google.com: domain of philmd@redhat.com designates 207.211.31.81 as permitted sender) client-ip=207.211.31.81; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=iraOjb6h; spf=pass (google.com: domain of philmd@redhat.com designates 207.211.31.81 as permitted sender) smtp.mailfrom=philmd@redhat.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1576193149; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=9bm5i+WqIWVShCZh3myFNfdKln7wDmsnYzUCxNSPbsg=; b=iraOjb6hMzbzkpFwD4raiNSq3G38NIRfuizanN7unbKKT346mS7GqyHtQM18+iuFCPjkxO TCTnwmyEkDdBgFY8qbfhwRtJwcivzRWu0ZvqMJzstWoozUGUtHzXxKHd/fsIe3yiqy6WB1 IlK1STev7gnufcgCeCtAFZpSdas5zcI= Received: from mail-wr1-f72.google.com (mail-wr1-f72.google.com [209.85.221.72]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-139-n9gZ8Y8bPDeUgGqYctPsuA-1; Thu, 12 Dec 2019 18:25:48 -0500 Received: by mail-wr1-f72.google.com with SMTP id z10so1594962wrt.21 for ; Thu, 12 Dec 2019 15:25:48 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=DzKIlFG2oRJSszzlv3np93HXTN09dZqGbswUkVllOdc=; b=GYX9drouimvJuTvjROQAcQeCy5ycHTFDmTGQ07KVXH0ukVTL1+0fDjqS5m9a9H3+Pg EvIHKX3IoQUnQE4Xw8YH1FPRQTPig6WfJuF+lBlnerzqyF+BP/P1wudMoRUMD58bjTh4 Ge2gTYsaZzIusE0aShVr8TYL00ed3U66c0UGcOmQdLC3KsjdrP0Fw5o4tmKlCMvEHfGY /q+8HjluSFqXWPSwL3pe35+1ISsrRiVOMimFB/hb0e22b01oY2h0ohI/3n+h1SSXdPEW LVFS/RjoJfkKpXU0aNOTYcioHwDj96qA6ekhTS81QX2abu7subZ/Dk6vk3afjA/v+CJc TvAA== X-Gm-Message-State: APjAAAVjqPgrhBrdkLNWzZBTEN+Bvh1+AxMuR4U/4Y8P2SKnh+JwW5V0 K9zVi6cw/TXSuCAF9eH7ec6d6UpwmwUtDbpk0BPOj/wkcLg9g3Kanl0o2BybmlxoNOxjQBjdE/4 ZhOoGxxkmJHu/7ro2 X-Received: by 2002:a5d:5592:: with SMTP id i18mr8592374wrv.55.1576193146831; Thu, 12 Dec 2019 15:25:46 -0800 (PST) X-Received: by 2002:a5d:5592:: with SMTP id i18mr8592342wrv.55.1576193146424; Thu, 12 Dec 2019 15:25:46 -0800 (PST) Return-Path: Received: from [192.168.1.35] (34.red-83-42-66.dynamicip.rima-tde.net. [83.42.66.34]) by smtp.gmail.com with ESMTPSA id v188sm7985013wma.10.2019.12.12.15.25.45 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 12 Dec 2019 15:25:45 -0800 (PST) Subject: Re: [PATCH 00/10] Add Allwinner H3 SoC and Orange Pi PC Machine To: Niek Linnenbank , =?UTF-8?Q?Alex_Benn=c3=a9e?= Cc: QEMU Developers , Beniamino Galvani , Peter Maydell , qemu-arm , Richard Henderson References: <20191202210947.3603-1-nieklinnenbank@gmail.com> <74df65db-1f84-62ba-6d01-edf765fd1dc2@redhat.com> From: =?UTF-8?Q?Philippe_Mathieu-Daud=c3=a9?= Message-ID: <7ed70514-e67e-9403-63b3-5a81c59fe952@redhat.com> Date: Fri, 13 Dec 2019 00:25:44 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.2.2 MIME-Version: 1.0 In-Reply-To: Content-Language: en-US X-MC-Unique: n9gZ8Y8bPDeUgGqYctPsuA-1 X-Mimecast-Spam-Score: 0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: quoted-printable X-TUID: A9RaBRUFSPDn Cc'ing Alex. On 12/13/19 12:07 AM, Niek Linnenbank wrote: > Hi Philippe, >=20 > I have discovered that the hflags assertion error you reported is not=20 > caused by the Allwinner H3 > patches but actually an existing problem. What I did is to use the=20 > latest master (v4.2.0 tag) without any patches applied. > and tried to boot the raspi2 machine with and without debugging enabled.= =20 > Without debuggin, the raspi2 > machine runs fine and can boot the 5.4.2 linux kernel. With debugging=20 > enabled, the same hflags error shows. This might be the same bug I hit last week... Alex suggested a patch: https://www.mail-archive.com/qemu-devel@nongnu.org/msg664500.html Do you mind to try it? If it still fails, you might also add this one on top: https://www.mail-archive.com/qemu-devel@nongnu.org/msg663843.html and report the error. >=20 > To reproduce it, build Linux 5.4.2 with the bmc2835_defconfig: >=20 > $ ARCH=3Darm CROSS_COMPILE=3Darm-linux-gnueabi- make mrproper > $ ARCH=3Darm CROSS_COMPILE=3Darm-linux-gnueabi- make bcm2835_defconfig > $ ARCH=3Darm CROSS_COMPILE=3Darm-linux-gnueabi- make -j5 > ... >=20 > First build QEMU without debugging and try to boot linux: > $ ./configure --target-list=3Darm-softmmu; make clean; make -j5 > $ ./arm-softmmu/qemu-system-arm -M raspi2 \ > -kernel $HOME/linux-5.4.2/arch/arm/boot/zImage \ > -append 'console=3DttyAMA0,115200 earlyprintk debug' \ > -dtb $HOME/linux-5.4.2/arch/arm/boot/dts/bcm2836-rpi-2-b.dtb \ > -m 1024 -nographic -s > [ 0.000000] Booting Linux on physical CPU 0x0 > [ 0.000000] Linux version 5.4.2 (me@host) (gcc version 7.4.0 (Ubuntu/L= inaro 7.4.0-1ubuntu1~18.04.1)) #1 Thu Dec 12 22:49:14 CET 2019 > [ 0.000000] CPU: ARMv7 Processor [410fc075] revision 5 (ARMv7), cr=3D1= 0c53c7d > ... >=20 > Then rebuild QEMU with debugging enabled and again try to boot linux: > $ ./configure --target-list=3Darm-softmmu --enable-debug --extra-cflags= =3D-ggdb; make clean; make -j5 > $ ./arm-softmmu/qemu-system-arm -M raspi2 \ > -kernel $HOME/linux-5.4.2/arch/arm/boot/zImage \ > -append 'console=3DttyAMA0,115200 earlyprintk debug' \ > -dtb $HOME/linux-5.4.2/arch/arm/boot/dts/bcm2836-rpi-2-b.dtb \ > -m 1024 -nographic -s > qemu-system-arm: /home/me/qemu/target/arm/helper.c:11359: cpu_get_tb_cpu_= state: Assertion `flags =3D=3D rebuild_hflags_internal(env)' failed. > qemu-system-arm: /home/me/qemu/target/arm/helper.c:11359: cpu_get_tb_cpu_= state: Assertion `flags =3D=3D rebuild_hflags_internal(env)' failed. > qemu-system-arm: /home/me/qemu/target/arm/helper.c:11359: cpu_get_tb_cpu_= state: Assertion `flags =3D=3D rebuild_hflags_internal(env)' failed. > Aborted (core dumped) >=20 > $ git describe > v4.2.0 >=20 >=20 > What should be the next step? Should this be reported as a bug? In this case we might already have the fix, but if Alex patch doesn't=20 help, you are always welcome to open a bug report: https://bugs.launchpad.net/qemu/+filebug This help to have notes/progress gathered. > On Tue, Dec 10, 2019 at 9:12 PM Niek Linnenbank=20 > > wrote: >=20 > Hi Philippe, >=20 > On Tue, Dec 10, 2019 at 9:26 AM Philippe Mathieu-Daud=C3=A9 > > wrote: >=20 > On 12/9/19 10:37 PM, Niek Linnenbank wrote: > > Hi Philippe, > > > > On Tue, Dec 3, 2019 at 9:47 AM Philippe Mathieu-Daud=C3=A9 > > > >> wrote: > > > >=C2=A0 =C2=A0 =C2=A0On 12/2/19 10:09 PM, Niek Linnenbank wrote: > >=C2=A0 =C2=A0 =C2=A0 > Dear QEMU developers, > >=C2=A0 =C2=A0 =C2=A0 > > >=C2=A0 =C2=A0 =C2=A0 > Hereby I would like to contribute the fo= llowing set of > patches to > >=C2=A0 =C2=A0 =C2=A0QEMU > >=C2=A0 =C2=A0 =C2=A0 > which add support for the Allwinner H3 S= ystem on Chip > and the > >=C2=A0 =C2=A0 =C2=A0 > Orange Pi PC machine. The following feat= ures and > devices are > >=C2=A0 =C2=A0 =C2=A0supported: > >=C2=A0 =C2=A0 =C2=A0 > > >=C2=A0 =C2=A0 =C2=A0 >=C2=A0 =C2=A0* SMP (Quad Core Cortex A7) > >=C2=A0 =C2=A0 =C2=A0 >=C2=A0 =C2=A0* Generic Interrupt Controll= er configuration > >=C2=A0 =C2=A0 =C2=A0 >=C2=A0 =C2=A0* SRAM mappings > >=C2=A0 =C2=A0 =C2=A0 >=C2=A0 =C2=A0* Timer device (re-used from= Allwinner A10) > >=C2=A0 =C2=A0 =C2=A0 >=C2=A0 =C2=A0* UART > >=C2=A0 =C2=A0 =C2=A0 >=C2=A0 =C2=A0* SD/MMC storage controller > >=C2=A0 =C2=A0 =C2=A0 >=C2=A0 =C2=A0* EMAC ethernet connectivity > >=C2=A0 =C2=A0 =C2=A0 >=C2=A0 =C2=A0* USB 2.0 interfaces > >=C2=A0 =C2=A0 =C2=A0 >=C2=A0 =C2=A0* Clock Control Unit > >=C2=A0 =C2=A0 =C2=A0 >=C2=A0 =C2=A0* System Control module > >=C2=A0 =C2=A0 =C2=A0 >=C2=A0 =C2=A0* Security Identifier device > > > >=C2=A0 =C2=A0 =C2=A0Awesome! > > > >=C2=A0 =C2=A0 =C2=A0 > Functionality related to graphical outpu= t such as > HDMI, GPU, > >=C2=A0 =C2=A0 =C2=A0 > Display Engine and audio are not include= d. Recently > released > >=C2=A0 =C2=A0 =C2=A0 > mainline Linux kernels (4.19 up to lates= t master) and > mainline U-Boot > >=C2=A0 =C2=A0 =C2=A0 > are known to work. The SD/MMC code is te= sted using > bonnie++ and > >=C2=A0 =C2=A0 =C2=A0 > various tools such as fsck, dd and fdisk= . The EMAC is > verified > >=C2=A0 =C2=A0 =C2=A0with iperf3 > >=C2=A0 =C2=A0 =C2=A0 > using -netdev socket. > >=C2=A0 =C2=A0 =C2=A0 > > >=C2=A0 =C2=A0 =C2=A0 > To build a Linux mainline kernel that ca= n be booted by > the Orange > >=C2=A0 =C2=A0 =C2=A0Pi PC > >=C2=A0 =C2=A0 =C2=A0 > machine, simply configure the kernel usi= ng the > sunxi_defconfig > >=C2=A0 =C2=A0 =C2=A0configuration: > >=C2=A0 =C2=A0 =C2=A0 >=C2=A0 =C2=A0$ ARCH=3Darm CROSS_COMPILE= =3Darm-linux-gnueabi- make > mrproper > >=C2=A0 =C2=A0 =C2=A0 >=C2=A0 =C2=A0$ ARCH=3Darm CROSS_COMPILE= =3Darm-linux-gnueabi- make > sunxi_defconfig > >=C2=A0 =C2=A0 =C2=A0 > > >=C2=A0 =C2=A0 =C2=A0 > To be able to use USB storage, you need = to manually > enable the > >=C2=A0 =C2=A0 =C2=A0corresponding > >=C2=A0 =C2=A0 =C2=A0 > configuration item. Start the kconfig co= nfiguration tool: > >=C2=A0 =C2=A0 =C2=A0 >=C2=A0 =C2=A0$ ARCH=3Darm CROSS_COMPILE= =3Darm-linux-gnueabi- make > menuconfig > >=C2=A0 =C2=A0 =C2=A0 > > >=C2=A0 =C2=A0 =C2=A0 > Navigate to the following item, enable i= t and save your > >=C2=A0 =C2=A0 =C2=A0configuration: > >=C2=A0 =C2=A0 =C2=A0 >=C2=A0 =C2=A0Device Drivers > USB support= > USB Mass Storage support > >=C2=A0 =C2=A0 =C2=A0 > > >=C2=A0 =C2=A0 =C2=A0 > Build the Linux kernel with: > >=C2=A0 =C2=A0 =C2=A0 >=C2=A0 =C2=A0$ ARCH=3Darm CROSS_COMPILE= =3Darm-linux-gnueabi- make -j5 > >=C2=A0 =C2=A0 =C2=A0 > > >=C2=A0 =C2=A0 =C2=A0 > To boot the newly build linux kernel in = QEMU with the > Orange Pi > >=C2=A0 =C2=A0 =C2=A0PC machine, use: > >=C2=A0 =C2=A0 =C2=A0 >=C2=A0 =C2=A0$ qemu-system-arm -M orangep= i -m 512 -nic user > -nographic \ > >=C2=A0 =C2=A0 =C2=A0 >=C2=A0 =C2=A0 =C2=A0 =C2=A0-kernel /path/= to/linux/arch/arm/boot/zImage \ > >=C2=A0 =C2=A0 =C2=A0 >=C2=A0 =C2=A0 =C2=A0 =C2=A0-append 'conso= le=3DttyS0,115200' \ > >=C2=A0 =C2=A0 =C2=A0 >=C2=A0 =C2=A0 =C2=A0 =C2=A0-dtb > /path/to/linux/arch/arm/boot/dts/sun8i-h3-orangepi-pc.dtb > >=C2=A0 =C2=A0 =C2=A0 > > >=C2=A0 =C2=A0 =C2=A0 > Note that this kernel does not have a ro= ot filesystem. > You may > >=C2=A0 =C2=A0 =C2=A0provide it > >=C2=A0 =C2=A0 =C2=A0 > with an official Orange Pi PC image [1] = either as an > SD card or as > >=C2=A0 =C2=A0 =C2=A0 > USB mass storage. To boot using the Oran= ge Pi PC > Debian image on > >=C2=A0 =C2=A0 =C2=A0SD card, > >=C2=A0 =C2=A0 =C2=A0 > simply add the -sd argument and provide = the proper > root=3D kernel > >=C2=A0 =C2=A0 =C2=A0parameter: > >=C2=A0 =C2=A0 =C2=A0 >=C2=A0 =C2=A0$ qemu-system-arm -M orangep= i -m 512 -nic user > -nographic \ > >=C2=A0 =C2=A0 =C2=A0 >=C2=A0 =C2=A0 =C2=A0 =C2=A0-kernel /path/= to/linux/arch/arm/boot/zImage \ > >=C2=A0 =C2=A0 =C2=A0 >=C2=A0 =C2=A0 =C2=A0 =C2=A0-append 'conso= le=3DttyS0,115200 root=3D/dev/mmcblk0p2' \ > >=C2=A0 =C2=A0 =C2=A0 >=C2=A0 =C2=A0 =C2=A0 =C2=A0-dtb > >=C2=A0 =C2=A0 =C2=A0/path/to/linux/arch/arm/boot/dts/sun8i-h3-o= rangepi-pc.dtb \ > >=C2=A0 =C2=A0 =C2=A0 >=C2=A0 =C2=A0 =C2=A0 =C2=A0-sd > OrangePi_pc_debian_stretch_server_linux5.3.5_v1.0.img > >=C2=A0 =C2=A0 =C2=A0 > > >=C2=A0 =C2=A0 =C2=A0 > Alternatively, you can also choose to bu= ild and boot a > recent > >=C2=A0 =C2=A0 =C2=A0buildroot [2] > >=C2=A0 =C2=A0 =C2=A0 > using the orangepi_pc_defconfig or Armbi= an image [3] > for Orange > >=C2=A0 =C2=A0 =C2=A0Pi PC. > > > >=C2=A0 =C2=A0 =C2=A0Richard, trying the Armbian image from > > https://apt.armbian.com/pool/main/l/linux-4.20.7-sunxi/ I get: > > > >=C2=A0 =C2=A0 =C2=A0$ arm-softmmu/qemu-system-arm -M orangepi -= m 512 -nic user \ > >=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0-append 'console=3DttyS0,1152= 00' \ > >=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0-kernel boot/vmlinuz-4.20.7-s= unxi \ > >=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0-dtb > usr/lib/linux-image-dev-sunxi/sun8i-h3-orangepi-pc.dtb \ > >=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0-serial stdio -d unimp > >=C2=A0 =C2=A0 =C2=A0Uncompressing Linux... done, booting the ke= rnel. > >=C2=A0 =C2=A0 =C2=A0rtc: unimplemented device write (size 4, va= lue > 0x16aa0001, offset 0x0) > >=C2=A0 =C2=A0 =C2=A0rtc: unimplemented device read (size 4, off= set 0x0) > >=C2=A0 =C2=A0 =C2=A0rtc: unimplemented device read (size 4, off= set 0x0) > >=C2=A0 =C2=A0 =C2=A0rtc: unimplemented device read (size 4, off= set 0x8) > >=C2=A0 =C2=A0 =C2=A0qemu-system-arm: target/arm/helper.c:11359: > cpu_get_tb_cpu_state: > >=C2=A0 =C2=A0 =C2=A0Assertion `flags =3D=3D rebuild_hflags_inte= rnal(env)' failed. > >=C2=A0 =C2=A0 =C2=A0Aborted (core dumped) > > > > > > I'm trying to reproduce the error you reported here with my > patch set on > > latest master, > > but so far without any result. The host OS I'm using is > Ubuntu 18.04.3 > > LTS on x86_64. > > I ran several times using the same 4.20.7-sunxi kernel and > same command > > line. > > > > Some questions that might help: > > 1) Are there any specific steps you did in order to produce > this error? >=20 > I build QEMU with: >=20 > ./configure --enable-trace-backends=3Dlog --extra-cflags=3D-ggdb > --enable-debug >=20 > > 2) Could this be a known / existing issue? > > 3) How many times did you see this error? >=20 > Always >=20 > > 4) Are you also using Ubuntu 18.04.3 LTS on x86_64, or a > different host OS? >=20 > Host is Fedora 30. >=20 >=20 > OK thanks, I will try again using the info above after I finished > reworking the other patch comments. >=20 > Niek