Re: qemu-system-aarch64 windows binary run Arm64 defconfig kernel not working

2020-04-03 Thread yoma sophian
hi Peter:
> unfortunately, 32-bit Windows qemu binary still fail on booting
> upstream arm64 defconfig kernel.

Is there any debug info of qemu could I provide?

Appreciate ur kind help,



Re: qemu-system-aarch64 windows binary run Arm64 defconfig kernel not working

2020-03-26 Thread yoma sophian
hi Peter:
> Are you using a 32-bit Windows qemu binary or a 64-bit one?
> (I'm wondering if this is a 32-bit vs 64-bit bug.)

unfortunately, 32-bit Windows qemu binary still fail on booting
upstream arm64 defconfig kernel.
in below log, I 1st purposely type wrong option, such that you can
tell where the binary located.
Then as you can see "synchronous external abort" still happens.

thanks for ur kind help,

$ qemu-system-aarch64 -v
C:\Program Files (x86)\qemu\qemu-system-aarch64.exe: -v: invalid option

$ qemu-system-aarch64 --version
QEMU emulator version 4.2.0 (v4.2.0-11797-g2890edc853-dirty)
Copyright (c) 2003-2019 Fabrice Bellard and the QEMU Project developers

$ ./run_script/run.sh
[ 0.00] Booting Linux on physical CPU 0x00 [0x411fd070]
[ 0.00] Linux version 5.5.0-rc7-00017-gb87a2ead99b2
(guest@ubuntu14_04) (gcc version 6.1.1 20160711 (Linaro GCC
6.1-2016.08)) #1 SMP PREEMPT Mon Mar 23 15:05:29 CST 2020
[ 0.00] Machine model: linux,dummy-virt
[ 0.00] efi: Getting EFI parameters from FDT:
[ 0.00] efi: UEFI not found.
[ 0.00] cma: Reserved 32 MiB at 0x7e00
[ 0.00] NUMA: No NUMA configuration found
[ 0.00] NUMA: Faking a node at [mem 0x4000-0x7fff]
[ 0.00] NUMA: NODE_DATA [mem 0x7ddf3100-0x7ddf4fff]
[ 0.00] Zone ranges:
[ 0.00] DMA [mem 0x4000-0x7fff]
[ 0.00] DMA32 empty
[ 0.00] Normal empty
[ 0.00] Movable zone start for each node
[ 0.00] Early memory node ranges
[ 0.00] node 0: [mem 0x4000-0x7fff]
[ 0.00] Initmem setup node 0 [mem 0x4000-0x7fff]
[ 0.00] psci: probing for conduit method from DT.
[ 0.00] psci: PSCIv0.2 detected in firmware.
[ 0.00] psci: Using standard PSCI v0.2 function IDs
[ 0.00] psci: Trusted OS migration not required
[ 0.00] percpu: Embedded 22 pages/cpu s53016 r8192 d28904 u90112
[ 0.00] Detected PIPT I-cache on CPU0
[ 0.00] CPU features: detected: ARM erratum 832075
[ 0.00] CPU features: detected: ARM erratum 834220
[ 0.00] CPU features: detected: EL2 vector hardening
[ 0.00] ARM_SMCCC_ARCH_WORKAROUND_1 missing from firmware
[ 0.00] CPU features: detected: ARM erratum 1319367
[ 0.00] Built 1 zonelists, mobility grouping on. Total pages: 258048
[ 0.00] Policy zone: DMA
[ 0.00] Kernel command line: console=ttyAMA0 root=/dev/vda
[ 0.00] Dentry cache hash table entries: 131072 (order: 8, 1048576
bytes, linear)
[ 0.00] Inode-cache hash table entries: 65536 (order: 7, 524288
bytes, linear)
[ 0.00] mem auto-init: stack:off, heap alloc:off, heap free:off
[ 0.00] Memory: 968848K/1048576K available (12284K kernel code,
1922K rwdata, 6776K rodata, 5184K init, 458K bss, 46960K reserved,
32768K cma-reserved)
[ 0.00] SLUB: HWalign=64, Order=0-3, MinObjects=0, CPUs=2, Nodes=1
[ 0.00] rcu: Preemptible hierarchical RCU implementation.
[ 0.00] rcu: RCU restricting CPUs from NR_CPUS=256 to nr_cpu_ids=2.
[ 0.00] Tasks RCU enabled.
[ 0.00] rcu: RCU calculated value of scheduler-enlistment delay is
25 jiffies.
[ 0.00] rcu: Adjusting geometry for rcu_fanout_leaf=16, nr_cpu_ids=2
[ 0.00] NR_IRQS: 64, nr_irqs: 64, preallocated irqs: 0
[ 0.00] GICv2m: range[mem 0x0802-0x08020fff], SPI[80:143]
[ 0.00] random: get_random_bytes called from
start_kernel+0x2b8/0x454 with crng_init=0
[ 0.00] arch_timer: cp15 timer(s) running at 62.50MHz (virt).
[ 0.00] clocksource: arch_sys_counter: mask: 0xff
max_cycles: 0x1cd42e208c, max_idle_ns: 881590405314 ns
[ 0.000313] sched_clock: 56 bits at 62MHz, resolution 16ns, wraps
every 4398046511096ns
[ 0.012734] Console: colour dummy device 80x25
[ 0.016333] Calibrating delay loop (skipped), value calculated using
timer frequency.. 125.00 BogoMIPS (lpj=25)
[ 0.016608] pid_max: default: 32768 minimum: 301
[ 0.018603] LSM: Security Framework initializing
[ 0.020522] Mount-cache hash table entries: 2048 (order: 2, 16384 bytes, linear)
[ 0.020596] Mountpoint-cache hash table entries: 2048 (order: 2, 16384
bytes, linear)
[ 0.109764] ASID allocator initialised with 32768 entries
[ 0.118473] rcu: Hierarchical SRCU implementation.
[ 0.132871] EFI services will not be available.
[ 0.134747] smp: Bringing up secondary CPUs ...
[ 0.178926] Detected PIPT I-cache on CPU1
[ 0.180097] CPU1: Booted secondary processor 0x01 [0x411fd070]
[ 0.185193] smp: Brought up 1 node, 2 CPUs
[ 0.185252] SMP: Total of 2 processors activated.
[ 0.185318] CPU features: detected: 32-bit EL0 Support
[ 0.185433] CPU features: detected: CRC32 instructions
[ 0.215643] CPU: All CPU(s) started at EL1
[ 0.216146] alternatives: patching kernel code
[ 0.248177] devtmpfs: initialized
[ 0.268462] KASLR disabled due to lack of seed
[ 0.274809] clocksource: jiffies: mask: 0x max_cycles:
0x, max_idle_ns: 764504178510 ns
[ 0.275044] futex hash table entries: 512 (order: 3, 32768 

Re: qemu-system-aarch64 windows binary run Arm64 defconfig kernel not working

2020-03-24 Thread Peter Maydell
On Tue, 24 Mar 2020 at 16:29, yoma sophian  wrote:
>
> hi Peter:
>
> > Hi; I can't reproduce this (Linux host) either with QEMU
> > head-of-git (commit 29e0855c5af62bbb0b) or with QEMU 4.2.0.
> > I used kernel commit 16fbf79b0f83bc7 (which is 5.6-rc7).
>
> In my experiments, the booting fail ONLY happens on Windows qemu binary.

Thanks for checking that.

Are you using a 32-bit Windows qemu binary or a 64-bit one?
(I'm wondering if this is a 32-bit vs 64-bit bug.)

thanks
-- PMM



Re: qemu-system-aarch64 windows binary run Arm64 defconfig kernel not working

2020-03-24 Thread yoma sophian
hi Peter:

> Hi; I can't reproduce this (Linux host) either with QEMU
> head-of-git (commit 29e0855c5af62bbb0b) or with QEMU 4.2.0.
> I used kernel commit 16fbf79b0f83bc7 (which is 5.6-rc7).

In my experiments, the booting fail ONLY happens on Windows qemu binary.

>
> Your repro instructions said to use the upstream (torvalds)
> kernel, but your log file says you were running:
>
> [0.00] Linux version 4.14.128-00888-g15ac2b5e934a-dirty
> (mtk20533@mtkslt1006) (Android (5220042 based on r346389c) clang
> version 8.0.7 (https://android.googlesource.com/toolchain/clang
> b55f2d4ebfd35bf643d27dbca1bb228957008617)
> (https://android.googlesource.com/toolchain/llvm
> 3c393fe7a7e13b0fba4ac75a01aa683d7a5b11cd) (based on LLVM 8.0.7svn)) #8
> SMP PREEMPT Thu Feb 20 17:45:16 CST 2020
>

That is my bad.
I originally use kernel 4.4 then tried on kernel 5.5, but both of them
are all booting fail
with windows qemu binary.

Below is upstream kernel 5.5 booting fail log.
BTW, is there any QEMU debug info I can deliver when running its windows binary?
thanks for ur kind help,

[ 0.00] Booting Linux on physical CPU 0x00 [0x411fd070]
[ 0.00] Linux version 5.5.0-rc7-00017-gb87a2ead99b2
(guest@ubuntu14_04) (gcc version 6.1.1 20160711 (Linaro GCC
6.1-2016.08)) #1 SMP PREEMPT Mon Mar 23 15:05:29 CST 2020
[ 0.00] Machine model: linux,dummy-virt
[ 0.00] efi: Getting EFI parameters from FDT:
[ 0.00] efi: UEFI not found.
[ 0.00] cma: Reserved 32 MiB at 0x7e00
[ 0.00] NUMA: No NUMA configuration found
[ 0.00] NUMA: Faking a node at [mem 0x4000-0x7fff]
[ 0.00] NUMA: NODE_DATA [mem 0x7ddf3100-0x7ddf4fff]
[ 0.00] Zone ranges:
[ 0.00] DMA [mem 0x4000-0x7fff]
[ 0.00] DMA32 empty
[ 0.00] Normal empty
[ 0.00] Movable zone start for each node
[ 0.00] Early memory node ranges
[ 0.00] node 0: [mem 0x4000-0x7fff]
[ 0.00] Initmem setup node 0 [mem 0x4000-0x7fff]
[ 0.00] psci: probing for conduit method from DT.
[ 0.00] psci: PSCIv0.2 detected in firmware.
[ 0.00] psci: Using standard PSCI v0.2 function IDs
[ 0.00] psci: Trusted OS migration not required
[ 0.00] percpu: Embedded 22 pages/cpu s53016 r8192 d28904 u90112
[ 0.00] Detected PIPT I-cache on CPU0
[ 0.00] CPU features: detected: ARM erratum 832075
[ 0.00] CPU features: detected: ARM erratum 834220
[ 0.00] CPU features: detected: EL2 vector hardening
[ 0.00] ARM_SMCCC_ARCH_WORKAROUND_1 missing from firmware
[ 0.00] CPU features: detected: ARM erratum 1319367
[ 0.00] Built 1 zonelists, mobility grouping on. Total pages: 258048
[ 0.00] Policy zone: DMA
[ 0.00] Kernel command line: console=ttyAMA0 root=/dev/vda
[ 0.00] Dentry cache hash table entries: 131072 (order: 8, 1048576
bytes, linear)
[ 0.00] Inode-cache hash table entries: 65536 (order: 7, 524288
bytes, linear)
[ 0.00] mem auto-init: stack:off, heap alloc:off, heap free:off
[ 0.00] Memory: 968848K/1048576K available (12284K kernel code,
1922K rwdata, 6776K rodata, 5184K init, 458K bss, 46960K reserved,
32768K cma-reserved)
[ 0.00] SLUB: HWalign=64, Order=0-3, MinObjects=0, CPUs=2, Nodes=1
[ 0.00] rcu: Preemptible hierarchical RCU implementation.
[ 0.00] rcu: RCU restricting CPUs from NR_CPUS=256 to nr_cpu_ids=2.
[ 0.00] Tasks RCU enabled.
[ 0.00] rcu: RCU calculated value of scheduler-enlistment delay is
25 jiffies.
[ 0.00] rcu: Adjusting geometry for rcu_fanout_leaf=16, nr_cpu_ids=2
[ 0.00] NR_IRQS: 64, nr_irqs: 64, preallocated irqs: 0
[ 0.00] GICv2m: range[mem 0x0802-0x08020fff], SPI[80:143]
[ 0.00] random: get_random_bytes called from
start_kernel+0x2b8/0x454 with crng_init=0
[ 0.00] arch_timer: cp15 timer(s) running at 62.50MHz (virt).
[ 0.00] clocksource: arch_sys_counter: mask: 0xff
max_cycles: 0x1cd42e208c, max_idle_ns: 881590405314 ns
[ 0.000231] sched_clock: 56 bits at 62MHz, resolution 16ns, wraps
every 4398046511096ns
[ 0.009220] Console: colour dummy device 80x25
[ 0.011796] Calibrating delay loop (skipped), value calculated using
timer frequency.. 125.00 BogoMIPS (lpj=25)
[ 0.011986] pid_max: default: 32768 minimum: 301
[ 0.013212] LSM: Security Framework initializing
[ 0.014729] Mount-cache hash table entries: 2048 (order: 2, 16384 bytes, linear)
[ 0.014779] Mountpoint-cache hash table entries: 2048 (order: 2, 16384
bytes, linear)
[ 0.085147] ASID allocator initialised with 32768 entries
[ 0.094222] rcu: Hierarchical SRCU implementation.
[ 0.107838] EFI services will not be available.
[ 0.109558] smp: Bringing up secondary CPUs ...
[ 0.136498] Detected PIPT I-cache on CPU1
[ 0.137332] CPU1: Booted secondary processor 0x01 [0x411fd070]
[ 0.140722] smp: Brought up 1 node, 2 CPUs
[ 0.140771] SMP: Total of 2 processors activated.
[ 0.140829] CPU features: detected: 32-bit EL0 Support
[ 

Re: qemu-system-aarch64 windows binary run Arm64 defconfig kernel not working

2020-03-23 Thread Peter Maydell
On Mon, 23 Mar 2020 at 16:16, yoma sophian  wrote:
>
> hi Peter:
> > Is it possible for you to try with a newer version of QEMU? That one
> > is a release candidate snapshot from before a release that we made
> > a year ago.
> With below qemu version, 4.2.0, the latest on the qemu windows download page,
> Synchronous External Abort still happen with the problem still hape

Hi; I can't reproduce this (Linux host) either with QEMU
head-of-git (commit 29e0855c5af62bbb0b) or with QEMU 4.2.0.
I used kernel commit 16fbf79b0f83bc7 (which is 5.6-rc7).

[...]
[1.875186] io scheduler kyber registered
[1.980486] pl061_gpio 903.pl061: PL061 GPIO chip registered
[2.004922] pci-host-generic 401000.pcie: host bridge
/pcie@1000 ranges:
[2.007411] pci-host-generic 401000.pcie:   IO
0x003eff..0x003eff -> 0x00
[2.009533] pci-host-generic 401000.pcie:  MEM
0x001000..0x003efe -> 0x001000
[2.010493] pci-host-generic 401000.pcie:  MEM
0x80..0xff -> 0x80
[2.013505] pci-host-generic 401000.pcie: ECAM at [mem
0x401000-0x401fff] for [bus 00-ff]
[2.017734] pci-host-generic 401000.pcie: PCI host bridge to bus :00
[2.018963] pci_bus :00: root bus resource [bus 00-ff]
[2.019655] pci_bus :00: root bus resource [io  0x-0x]
[2.020104] pci_bus :00: root bus resource [mem 0x1000-0x3efe]
[2.020578] pci_bus :00: root bus resource [mem
0x80-0xff]
[2.024698] pci :00:00.0: [1b36:0008] type 00 class 0x06
[2.038319] pci :00:01.0: [1af4:1000] type 00 class 0x02
[2.039848] pci :00:01.0: reg 0x10: [io  0x-0x001f]
[2.040365] pci :00:01.0: reg 0x14: [mem 0x-0x0fff]
[2.041106] pci :00:01.0: reg 0x20: [mem 0x-0x3fff
64bit pref]
[2.041631] pci :00:01.0: reg 0x30: [mem 0x-0x0003 pref]
[2.056259] pci :00:01.0: BAR 6: assigned [mem
0x1000-0x1003 pref]
[2.057782] pci :00:01.0: BAR 4: assigned [mem
0x80-0x803fff 64bit pref]
[2.058828] pci :00:01.0: BAR 1: assigned [mem 0x1004-0x10040fff]
[2.059381] pci :00:01.0: BAR 0: assigned [io  0x1000-0x101f]
[2.096264] EINJ: ACPI disabled.
[2.217421] virtio-pci :00:01.0: enabling device ( -> 0003)
[2.307843] Serial: 8250/16550 driver, 4 ports, IRQ sharing enabled
[2.338768] SuperH (H)SCI(F) driver initialized
[2.346260] msm_serial: driver initialized
[...]

Your repro instructions said to use the upstream (torvalds)
kernel, but your log file says you were running:

[0.00] Linux version 4.14.128-00888-g15ac2b5e934a-dirty
(mtk20533@mtkslt1006) (Android (5220042 based on r346389c) clang
version 8.0.7 (https://android.googlesource.com/toolchain/clang
b55f2d4ebfd35bf643d27dbca1bb228957008617)
(https://android.googlesource.com/toolchain/llvm
3c393fe7a7e13b0fba4ac75a01aa683d7a5b11cd) (based on LLVM 8.0.7svn)) #8
SMP PREEMPT Thu Feb 20 17:45:16 CST 2020

which definitely isn't a recent upstream kernel.
Can you reproduce with an upstream kernel?

thanks
-- PMM



Re: qemu-system-aarch64 windows binary run Arm64 defconfig kernel not working

2020-03-23 Thread yoma sophian
hi Peter:
> Is it possible for you to try with a newer version of QEMU? That one
> is a release candidate snapshot from before a release that we made
> a year ago.
With below qemu version, 4.2.0, the latest on the qemu windows download page,
Synchronous External Abort still happen with the problem still hape

Below is download page I tried and version number.
thanks for ur kind suggestion.

https://qemu.weilnetz.de/w64/2020/qemu-w64-setup-20200201.exe
$ qemu-system-aarch64 --version
QEMU emulator version 4.2.0 (v4.2.0-11797-g2890edc853-dirty)
Copyright (c) 2003-2019 Fabrice Bellard and the QEMU Project developers



Re: qemu-system-aarch64 windows binary run Arm64 defconfig kernel not working

2020-03-23 Thread Peter Maydell
On Mon, 23 Mar 2020 at 13:34, yoma sophian  wrote:
> My environment are:
> 1. the versionof qemu-system-aarch64 windows binary is 4.0.92

Is it possible for you to try with a newer version of QEMU? That one
is a release candidate snapshot from before a release that we made
a year ago.

thanks
-- PMM



qemu-system-aarch64 windows binary run Arm64 defconfig kernel not working

2020-03-23 Thread yoma sophian
hi all:
I try to use qemu-system-aarch64 windows binary for running arm64
defconfig kernel image but get Synchronous External Abort while
booting PCI devices.
The same Image that run on qemu-system-aarch64 linux binary is fine.
Is there any pci related kernel config need to be removed while using
qemu windows binary?

Appreciate ur help in advance.
=
My environment are:
1. the versionof qemu-system-aarch64 windows binary is 4.0.92
2.  kernel image:
 a. check out latest kernel from
 git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
 b. make ARCH=arm64 defconfig
 c. make ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- -j32
3. run qemu with attach "qemu_run.sh"

Boot up fail log is attached
"qemu_win10_binary_bootup_aarch64_defconfig_fail.log.tar.bz2"

below is excerpt from log, where Synchronous External Abort happens.

[2.453924] pci-host-generic 3f00.pcie: ECAM at [mem
0x3f00-0x3fff] for [bus 00-0f]
[2.461280] pci-host-generic 3f00.pcie: PCI host bridge to bus :00
[2.461855] pci_bus :00: root bus resource [bus 00-0f]
[2.462188] pci_bus :00: root bus resource [io  0x-0x]
[2.462423] pci_bus :00: root bus resource [mem 0x1000-0x3efe]
[2.462677] pci_bus :00: root bus resource [mem
0x80-0xff]
[2.463565] Synchronous External Abort: synchronous external abort
(0x9610) at 0x0c00
[2.464656] Internal error: : 9610 [#1] PREEMPT SMP
[2.465093] Modules linked in:
[2.465411] Process swapper/0 (pid: 1, stack limit = 0x(ptrval))
[2.465810] CPU: 1 PID: 1 Comm: swapper/0 Not tainted
4.14.128-00888-g15ac2b5e934a-dirty #8
[2.466077] Hardware name: linux,dummy-virt (DT)
[2.466315] task: (ptrval) task.stack: (ptrval)
[2.466556] PC is at pci_generic_config_read+0xa8/0xd8
[2.466748] LR is at pci_generic_config_read+0x44/0xd8
[2.466925] pc : [] lr : []
pstate: 21c5
[2.467169] sp : 0804b8c0
[2.467304] x29: 0804b8f0 x28: 0804bac0
[2.467565] x27: 0001 x26: 80003d354e80
[2.467892] x25: 0804bac0 x24: 0140
[2.468110] x23: 80003c5a x22: 
[2.468347] x21:  x20: 0004


qemu_win10_binary_bootup_aarch64_defconfig_fail.log.tar.bz2
Description: application/bzip


qemu_run.sh.tar.bz2
Description: application/bzip