Skip to content

Commit

Permalink
qemu-v8: Use cpu as cortex-a57 for XEN_BOOT
Browse files Browse the repository at this point in the history
XEN fails to boot linux when cpu is selected as max with following
kernel crash. Hence revert to using cortex-a57 when XEN_BOOT is
selected.

[    0.000000] ------------[ cut here ]------------
[    0.000000] kernel BUG at arch/arm64/kernel/traps.c:498!
[    0.000000] Internal error: Oops - BUG: 0 [#1] PREEMPT SMP
[    0.000000] Modules linked in:
[    0.000000] CPU: 0 PID: 0 Comm: swapper/0 Not tainted 5.16.0-gdbeb6ea978fc #1
[    0.000000] Hardware name: linux,dummy-virt (DT)
[    0.000000] pstate: 000000c5 (nzcv daIF -PAN -UAO -TCO -DIT -SSBS BTYPE=--)
[    0.000000] pc : do_undefinstr+0x2bc/0x2e0
[    0.000000] lr : do_undefinstr+0x2c8/0x2e0
[    0.000000] sp : ffffd399cddc3c60
[    0.000000] x29: ffffd399cddc3c60 x28: ffffd399cddd34c0 x27: 0000000000000000
[    0.000000] x26: 0000000000000000 x25: 0000000000000000 x24: ffffd399cd830008
[    0.000000] x23: 00000000000000c5 x22: ffffd399cd7810bc x21: ffffd399cddc3e30
[    0.000000] x20: 00000000d5182101 x19: ffffd399cddc3ce0 x18: 0000000000000014
[    0.000000] x17: 0000000049426f60 x16: 0000000056a84232 x15: 0000000099ac15ae
[    0.000000] x14: 00000000ab810c49 x13: 501bac190a4c3eb1 x12: 89c8a6a0aab2e7c5
[    0.000000] x11: 00000000c16d9c19 x10: 00000000e4fb46a5 x9 : 00000000d78a73db
[    0.000000] x8 : 0000000000000014 x7 : 501bac190a4c3eb1 x6 : 89c8a6a0aab2e7c5
[    0.000000] x5 : ffffd399cddd5910 x4 : 0000000000000000 x3 : ffffd399ce0e70f8
[    0.000000] x2 : 0000000000000000 x1 : ffffd399cddd34c0 x0 : 00000000000000c5
[    0.000000] Call trace:
[    0.000000]  do_undefinstr+0x2bc/0x2e0
[    0.000000]  el1_undef+0x2c/0x4c
[    0.000000]  el1h_64_sync_handler+0x84/0xd0
[    0.000000]  el1h_64_sync+0x78/0x7c
[    0.000000]  start_kernel+0x4c4/0x664
[    0.000000]  __primary_switched+0xc0/0xc8
[    0.000000] Code: 17ffff8d a9425bf5 17ffffb1 a9025bf5 (d4210000)
[    0.000000] ---[ end trace 32823fcd1957a64b ]---
[    0.000000] Kernel panic - not syncing: Attempted to kill the idle task!
[    0.000000] ---[ end Kernel panic - not syncing: Attempted to kill the idle task! ]---

Signed-off-by: Ruchika Gupta <[email protected]>
Reviewed-by: Jerome Forissier <[email protected]>
  • Loading branch information
ruchi393 authored and jforissier committed Jan 25, 2022
1 parent 56d18a0 commit 6a868e3
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
4 changes: 2 additions & 2 deletions qemu-check.exp
Original file line number Diff line number Diff line change
Expand Up @@ -98,9 +98,9 @@ spawn -open [open "|tail -f serial1.log"]
set teecore $spawn_id
if {[string first "aarch64" $::env(QEMU)] != -1} {
if {$::env(XEN_BOOT) == "y"} {
spawn $::env(QEMU) -nographic -serial mon:stdio -serial file:serial1.log -smp $::env(QEMU_SMP) -machine virt,secure=on,gic-version=$::env(QEMU_GIC),virtualization=true -cpu cortex-a57 -d unimp -semihosting-config enable=on,target=native -m $::env(QEMU_MEM) -bios bl1.bin -initrd rootfs.cpio.gz -kernel Image -no-acpi -append "console=ttyAMA0,38400 keep_bootcon root=/dev/vda2" -drive if=none,file=xen.ext4,format=raw,id=hd1 -device virtio-blk-device,drive=hd1 -fsdev local,id=fsdev0,path=../..,security_model=none -device virtio-9p-device,fsdev=fsdev0,mount_tag=host
spawn $::env(QEMU) -nographic -serial mon:stdio -serial file:serial1.log -smp $::env(QEMU_SMP) -machine virt,secure=on,gic-version=$::env(QEMU_GIC),virtualization=true -cpu $::env(QEMU_CPU) -d unimp -semihosting-config enable=on,target=native -m $::env(QEMU_MEM) -bios bl1.bin -initrd rootfs.cpio.gz -kernel Image -no-acpi -append "console=ttyAMA0,38400 keep_bootcon root=/dev/vda2" -drive if=none,file=xen.ext4,format=raw,id=hd1 -device virtio-blk-device,drive=hd1 -fsdev local,id=fsdev0,path=../..,security_model=none -device virtio-9p-device,fsdev=fsdev0,mount_tag=host
} else {
spawn $::env(QEMU) -nographic -serial mon:stdio -serial file:serial1.log -smp $::env(QEMU_SMP) -machine virt,secure=on,gic-version=$::env(QEMU_GIC) -cpu cortex-a57 -d unimp -semihosting-config enable=on,target=native -m $::env(QEMU_MEM) -bios bl1.bin -initrd rootfs.cpio.gz -kernel Image -no-acpi -append "console=ttyAMA0,38400 keep_bootcon root=/dev/vda2"
spawn $::env(QEMU) -nographic -serial mon:stdio -serial file:serial1.log -smp $::env(QEMU_SMP) -machine virt,secure=on,gic-version=$::env(QEMU_GIC) -cpu $::env(QEMU_CPU) -d unimp -semihosting-config enable=on,target=native -m $::env(QEMU_MEM) -bios bl1.bin -initrd rootfs.cpio.gz -kernel Image -no-acpi -append "console=ttyAMA0,38400 keep_bootcon root=/dev/vda2"
}
} else {
spawn $::env(QEMU) -nographic -monitor none -machine virt -machine secure=on -cpu cortex-a15 -smp $::env(QEMU_SMP) -d unimp -semihosting-config enable=on,target=native -m 1057 -serial stdio -serial file:serial1.log -bios $bios
Expand Down
5 changes: 4 additions & 1 deletion qemu_v8.mk
Original file line number Diff line number Diff line change
Expand Up @@ -387,12 +387,14 @@ run: all


ifeq ($(XEN_BOOT),y)
QEMU_CPU ?= cortex-a57
QEMU_MEM ?= 2048
QEMU_SMP ?= 4
QEMU_VIRT = true
QEMU_XEN ?= -drive if=none,file=$(XEN_EXT4),format=raw,id=hd1 \
-device virtio-blk-device,drive=hd1
else
QEMU_CPU ?= max,sve=off
QEMU_SMP ?= 2
QEMU_MEM ?= 1057
QEMU_VIRT = false
Expand All @@ -411,7 +413,7 @@ run-only:
-serial tcp:localhost:54320 -serial tcp:localhost:54321 \
-smp $(QEMU_SMP) \
-s -S -machine virt,secure=on,gic-version=$(QEMU_GIC_VERSION),virtualization=$(QEMU_VIRT) \
-cpu max,sve=off \
-cpu $(QEMU_CPU) \
-d unimp -semihosting-config enable=on,target=native \
-m $(QEMU_MEM) \
-bios bl1.bin \
Expand Down Expand Up @@ -439,6 +441,7 @@ check: $(CHECK_DEPS)
export QEMU_SMP=$(QEMU_SMP) && \
export QEMU_GIC=$(QEMU_GIC_VERSION) && \
export QEMU_MEM=$(QEMU_MEM) && \
export QEMU_CPU=$(QEMU_CPU) && \
export XEN_BOOT=$(XEN_BOOT) && \
expect $(ROOT)/build/qemu-check.exp -- $(check-args) || \
(if [ "$(DUMP_LOGS_ON_ERROR)" ]; then \
Expand Down

0 comments on commit 6a868e3

Please sign in to comment.