Stefano Stabellini stefano.stabellini@xilinx.com writes:
On Fri, 2 Oct 2020, Alex Bennée wrote:
Alex Bennée alex.bennee@linaro.org writes:
(forgot to CC Andre)
Hi,
As it's Friday I thought I'd better summarise where I've gotten to with booting Xen. TLDR, got something working with GICv2, GICv3 seems broken.
Platform:
QEMU with: -cpu cortex-a57 -machine type=virt,virtualization=on,gic-version=3 \ -device virtio-net-pci,netdev=unet,id=virt-net,disable-legacy=on \ -device virtio-scsi-pci,id=virt-scsi,disable-legacy=on \ -blockdev driver=raw,node-name=hd,discard=unmap,file.driver=host_device,file.filename=/dev/zen-disk/debian-buster-arm64 \ -device scsi-hd,drive=hd,id=virt-scsi-hd \ -drive if=pflash,file=/usr/share/AAVMF/AAVMF_CODE.fd,format=raw,readonly \ -drive if=pflash,file=/home/alex/models/qemu-arm64-efivars,format=raw
<snip>
Excellent!
For your information, I could boot Xen on QEMU with GICv3 in the past, with something like:
-machine virt,gic_version=3 \ -machine virtualization=true \ -cpu cortex-a57 -machine type=virt \
However it was a long time ago: QEMU 2.11.
So with my recent direct boot hack:
https://patchew.org/QEMU/20201009170742.23695-1-alex.bennee@linaro.org/
which avoids going through both EDK2 and Grub I can confirm I can boot Xen with GICv3:
./aarch64-softmmu/qemu-system-aarch64 -cpu cortex-a57 -machine type=virt,virtualization=on,gic-version=3 -display none -serial mon:stdio -netdev user,id=unet,hostfwd=tcp::22 22-:22 -device virtio-net-pci,netdev=unet,id=virt-net,disable-legacy=on -device virtio-scsi-pci,id=virt-scsi,disable-legacy=on -blockdev driver=raw,node-name=hd,discard=unma p,file.driver=host_device,file.filename=/dev/zen-disk/debian-buster-arm64 -device scsi-hd,drive=hd,id=virt-scsi-hd -smp 4 -m 4096 -kernel ~/lsrc/xen.git/xen/xen -append "dom 0_mem=1G,max:1G loglvl=all guest_loglvl=all" -device loader,addr=0x47000000,file=$HOME/lsrc/linux.git/builds/arm64/arch/arm64/boot/Image,len-fdt-compat=2,fdt-compat[0]='mult iboot,,module',fdt-compat[1]='multiboot,,kernel',fdt-bootargs="root=/dev/sda2 ro console=hvc0 earlyprintk=xen" - UART enabled - - Boot CPU booting - - Current EL 00000008 - - Initialize CPU - - Turning on paging - - Zero BSS - - Ready - (XEN) Checking for initrd in /chosen (XEN) RAM: 0000000040000000 - 000000013fffffff (XEN) (XEN) MODULE[0]: 0000000040200000 - 000000004034b0c8 Xen (XEN) MODULE[1]: 0000000048000000 - 0000000048100000 Device Tree (XEN) MODULE[2]: 0000000047000000 - 0000000047dc6200 Kernel (XEN) (XEN) CMDLINE[0000000047000000]:chosen root=/dev/sda2 ro console=hvc0 earlyprintk=xen (XEN) (XEN) Command line: dom0_mem=1G,max:1G loglvl=all guest_loglvl=all (XEN) parameter "dom0_mem" has invalid value "1G,max:1G", rc=-22! (XEN) Domain heap initialised (XEN) Booting using Device Tree (XEN) Platform: Generic System (XEN) Taking dtuart configuration from /chosen/stdout-path (XEN) Looking for dtuart at "/pl011@9000000", options "" Xen 4.15-unstable (XEN) Xen version 4.15-unstable (alex@) (gcc (Debian 8.3.0-6) 8.3.0) debug=y Wed Sep 30 12:58:57 BST 2020 (XEN) Latest ChangeSet: Wed Sep 30 10:26:05 2020 +0100 git:f66afeb018-dirty (XEN) build-id: e2e95cc5d131b7659a57b8d10212647c3c514e7e (XEN) Processor: 411fd070: "ARM Limited", variant: 0x1, part 0xd07, rev 0x0 (XEN) 64-bit Execution: (XEN) Processor Features: 0000000001000222 0000000000000000 (XEN) Exception Levels: EL3:No EL2:64+32 EL1:64+32 EL0:64+32 (XEN) Extensions: FloatingPoint AdvancedSIMD GICv3-SysReg (XEN) Debug Features: 0000000010305106 0000000000000000 (XEN) Auxiliary Features: 0000000000000000 0000000000000000 (XEN) Memory Model Features: 0000000000001124 0000000000000000 (XEN) ISA Features: 0000000000011120 0000000000000000 (XEN) 32-bit Execution: (XEN) Processor Features: 00000131:10011001 (XEN) Instruction Sets: AArch32 A32 Thumb Thumb-2 Jazelle (XEN) Extensions: GenericTimer (XEN) Debug Features: 03010066 (XEN) Auxiliary Features: 00000000 (XEN) Memory Model Features: 10101105 40000000 01260000 02102211 (XEN) ISA Features: 02101110 13112111 21232042 01112131 00011142 00011121 (XEN) Using SMC Calling Convention v1.0 (XEN) Using PSCI v0.2 (XEN) SMP: Allowing 4 CPUs (XEN) enabled workaround for: ARM erratum 832075 (XEN) enabled workaround for: ARM erratum 834220 (XEN) enabled workaround for: ARM erratum 1319367 (XEN) Generic Timer IRQ: phys=30 hyp=26 virt=27 Freq: 62500 KHz (XEN) GICv3 initialization: (XEN) gic_dist_addr=0x00000008000000 (XEN) gic_maintenance_irq=25 (XEN) gic_rdist_stride=0 (XEN) gic_rdist_regions=1 (XEN) redistributor regions: (XEN) - region 0: 0x000000080a0000 - 0x00000009000000 (XEN) GICv3: 256 lines, (IID 0000043b). (XEN) GICv3: CPU0: Found redistributor in region 0 @000000004001c000