setting up Xen hypervisor for ARM emulated by QEMU(end Kernel panic - not syncing: Attempted to kill init! exitcode=0x0000000b)
by anks7 from LinuxQuestions.org on (#6QTF3)
I am trying to set up Xen hypervisor for ARM using QEMU, and I am following this tutorial:
https://medium.com/@denisobrezkov/xe...u-1654f24dea75
As the author has mentioned, I have generated and installed the images and binaries. Following is the list of files I have used for the same:
busybox-1.36.1
linux-5.15.10
xen-4.17.1
u-boot-2022.04
I have followed the mentioned tutorial and generated the required binaries, but in the last step when I am trying to boot up Xen, busybox, Linux on QEMU, using the following QEMU commands, I am getting kernel panic error:
qemu-system-aarch64 -machine virt,gic_version=3 -machine virtualization=true -cpu cortex-a57 -machine type=virt -m 4096 -smp 4 -bios u-boot.bin -device loader,file=xen,force-raw=on,addr=0x49000000 -device loader,file=Image.gz,addr=0x47000000 -device loader,file=virt-gicv3.dtb,addr=0x44000000 -device loader,file=rootfs.img.gz,addr=0x42000000 -nographic -no-reboot -chardev socket,id=qemu-monitor,host=localhost,port=7777,server,nowait,telnet -mon qemu-monitor,mode=readline
Following is the u-boot commands:
fdt addr 0x44000000
fdt resize
fdt set /chosen \#address-cells <1>
fdt set /chosen \#size-cells <1>
fdt mknod /chosen module@0
fdt set /chosen/module@0 compatible "xen,linux-zimage" "xen,multiboot-module"
fdt set /chosen/module@0 reg <0x47000000 0xb0738b>
fdt set /chosen/module@0 bootargs "rw root=/dev/ram rdinit=/sbin/init earlyprintk=serial,ttyAMA0 console=hvc0 earlycon=xenboot"
fdt mknod /chosen module@1
fdt set /chosen/module@1 compatible "xen,linux-initrd" "xen,multiboot-module"
fdt set /chosen/module@1 reg <0x42000000 0x11d2fc>
booti 0x49000000 - 0x44000000
Following is the boot message along with the error:
Quote:
Please help me identify the issue and resolve it? Also i would like to mention that that the size of Image.gz and rootfs.img.gz used in the u-boot messages were calculated as follows:
Quote:
Quote:
https://medium.com/@denisobrezkov/xe...u-1654f24dea75
As the author has mentioned, I have generated and installed the images and binaries. Following is the list of files I have used for the same:
busybox-1.36.1
linux-5.15.10
xen-4.17.1
u-boot-2022.04
I have followed the mentioned tutorial and generated the required binaries, but in the last step when I am trying to boot up Xen, busybox, Linux on QEMU, using the following QEMU commands, I am getting kernel panic error:
qemu-system-aarch64 -machine virt,gic_version=3 -machine virtualization=true -cpu cortex-a57 -machine type=virt -m 4096 -smp 4 -bios u-boot.bin -device loader,file=xen,force-raw=on,addr=0x49000000 -device loader,file=Image.gz,addr=0x47000000 -device loader,file=virt-gicv3.dtb,addr=0x44000000 -device loader,file=rootfs.img.gz,addr=0x42000000 -nographic -no-reboot -chardev socket,id=qemu-monitor,host=localhost,port=7777,server,nowait,telnet -mon qemu-monitor,mode=readline
Following is the u-boot commands:
fdt addr 0x44000000
fdt resize
fdt set /chosen \#address-cells <1>
fdt set /chosen \#size-cells <1>
fdt mknod /chosen module@0
fdt set /chosen/module@0 compatible "xen,linux-zimage" "xen,multiboot-module"
fdt set /chosen/module@0 reg <0x47000000 0xb0738b>
fdt set /chosen/module@0 bootargs "rw root=/dev/ram rdinit=/sbin/init earlyprintk=serial,ttyAMA0 console=hvc0 earlycon=xenboot"
fdt mknod /chosen module@1
fdt set /chosen/module@1 compatible "xen,linux-initrd" "xen,multiboot-module"
fdt set /chosen/module@1 reg <0x42000000 0x11d2fc>
booti 0x49000000 - 0x44000000
Following is the boot message along with the error:
Quote:
## Flattened Device Tree blob at 44000000 Booting using the fdt blob at 0x44000000 Loading Device Tree to 00000000ffff8000, end 00000000ffffefff ... OK Starting kernel ... Xen 4.17.1 (XEN) Xen version 4.17.1 (kpit@) (aarch64-linux-gnu-gcc (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0) debug=n Wed Sep 11 13:25:04 IST 2024 (XEN) Latest ChangeSet: (XEN) Processor: 00000000411fd070: "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: 0000000000000131:0000000010011001 (XEN) Instruction Sets: AArch32 A32 Thumb Thumb-2 Jazelle (XEN) Extensions: GenericTimer (XEN) Debug Features: 0000000003000006 (XEN) Auxiliary Features: 0000000000000000 (XEN) Memory Model Features: 0000000010101105 0000000040000000 (XEN) 0000000001260000 0000000002102211 (XEN) ISA Features: 0000000002101110 0000000013112111 0000000021232042 (XEN) 0000000001112131 0000000000011142 0000000000011121 (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: 288 lines, (IID 0000043b). (XEN) GICv3: CPU0: Found redistributor in region 0 @000000004001c000 (XEN) XSM Framework v1.0.1 initialized (XEN) Initialising XSM SILO mode (XEN) Using scheduler: SMP Credit Scheduler rev2 (credit2) (XEN) Initializing Credit2 scheduler (XEN) Allocated console ring of 16 KiB. (XEN) Bringing up CPU1 (XEN) GICv3: CPU1: Found redistributor in region 0 @000000004003c000 (XEN) Bringing up CPU2 (XEN) GICv3: CPU2: Found redistributor in region 0 @000000004005c000 (XEN) Bringing up CPU3 (XEN) GICv3: CPU3: Found redistributor in region 0 @000000004007c000 (XEN) Brought up 4 CPUs (XEN) I/O virtualisation disabled (XEN) P2M: 44-bit IPA with 44-bit PA and 8-bit VMID (XEN) P2M: 4 levels with order-0 root, VTCR 0x0000000080043594 (XEN) Scheduling granularity: cpu, 1 CPU per sched-resource (XEN) Initializing Credit2 scheduler (XEN) **** No support for ARM_SMCCC_ARCH_WORKAROUND_1. **** (XEN) **** Please update your firmware. **** (XEN) **** No support for ARM_SMCCC_ARCH_WORKAROUND_1. **** (XEN) **** Please update your firmware. **** (XEN) **** No support for ARM_SMCCC_ARCH_WORKAROUND_1. **** (XEN) **** Please update your firmware. **** (XEN) **** No support for ARM_SMCCC_ARCH_WORKAROUND_1. **** (XEN) **** Please update your firmware. **** (XEN) **** This CPU is affected by the errata 832075. **** (XEN) **** Guests without CPU erratum workarounds can deadlock the system! **** (XEN) **** Only trusted guests should be used. **** (XEN) *** LOADING DOMAIN 0 *** (XEN) Loading d0 kernel from boot module @ 0000000047000000 (XEN) Loading ramdisk from boot module @ 0000000042000000 (XEN) Allocating 1:1 mappings totalling 512MB for dom0: (XEN) BANK[0] 0x00000060000000-0x00000080000000 (512MB) (XEN) Grant table range: 0x00000049000000-0x00000049040000 (XEN) Allocating PPI 16 for event channel interrupt (XEN) d0: extended region 0: 0x40000000->0x49000000 (XEN) d0: extended region 1: 0x49200000->0x60000000 (XEN) d0: extended region 2: 0x80000000->0x140000000 (XEN) Loading zImage from 0000000138000000 to 0000000060000000-0000000061fbf200 (XEN) Loading d0 initrd from 0000000042000000 to 0x0000000068200000-0x000000006831d2fc (XEN) Loading d0 DTB to 0x0000000068000000-0x0000000068001dfb (XEN) Initial low memory virq threshold set at 0x4000 pages. (XEN) Scrubbing Free RAM in background (XEN) Std. Loglevel: Errors and warnings (XEN) Guest Loglevel: Nothing (Rate-limited: Errors and warnings) (XEN) *************************************************** (XEN) PLEASE SPECIFY dom0_mem PARAMETER - USING 512M FOR NOW (XEN) *************************************************** (XEN) 3... 2... 1... (XEN) *** Serial input to DOM0 (type 'CTRL-a' three times to switch input) (XEN) Freed 360kB init memory. [ 0.000000] Booting Linux on physical CPU 0x0000000000 [0x411fd070] [ 0.000000] Linux version 5.15.10 (kpit@D-12498) (aarch64-linux-gnu-gcc (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0, GNU ld (GNU Binutils for Ubuntu) 2.34) #2 SMP PREEMPT Thu Sep 12 17:19:40 IST 2024 [ 0.000000] Machine model: linux,dummy-virt [ 0.000000] earlycon: xenboot0 at I/O port 0x0 (options '') [ 0.000000] printk: bootconsole [xenboot0] enabled [ 0.000000] Xen 4.17 support found [ 0.000000] efi: UEFI not found. [ 0.000000] NUMA: No NUMA configuration found [ 0.000000] NUMA: Faking a node at [mem 0x0000000060000000-0x000000007fffffff] [ 0.000000] NUMA: NODE_DATA [mem 0x7fef3c00-0x7fef5fff] [ 0.000000] Zone ranges: [ 0.000000] DMA [mem 0x0000000060000000-0x000000007fffffff] [ 0.000000] DMA32 empty [ 0.000000] Normal empty [ 0.000000] Movable zone start for each node [ 0.000000] Early memory node ranges [ 0.000000] node 0: [mem 0x0000000060000000-0x000000007fffffff] [ 0.000000] Initmem setup node 0 [mem 0x0000000060000000-0x000000007fffffff] [ 0.000000] cma: Reserved 32 MiB at 0x000000007d400000 [ 0.000000] psci: probing for conduit method from DT. [ 0.000000] psci: PSCIv1.1 detected in firmware. [ 0.000000] psci: Using standard PSCI v0.2 function IDs [ 0.000000] psci: Trusted OS migration not required [ 0.000000] psci: SMC Calling Convention v1.1 [ 0.000000] percpu: Embedded 20 pages/cpu s41112 r8192 d32616 u81920 [ 0.000000] Detected PIPT I-cache on CPU0 [ 0.000000] CPU features: detected: GIC system register CPU interface [ 0.000000] CPU features: detected: Spectre-v2 [ 0.000000] CPU features: detected: Spectre-v3a [ 0.000000] CPU features: detected: Spectre-v4 [ 0.000000] CPU features: kernel page table isolation forced ON by KASLR [ 0.000000] CPU features: detected: Kernel page table isolation (KPTI) [ 0.000000] CPU features: detected: ARM erratum 834220 [ 0.000000] CPU features: detected: ARM erratum 832075 [ 0.000000] CPU features: detected: ARM errata 1165522, 1319367, or 1530923 [ 0.000000] Built 1 zonelists, mobility grouping on. Total pages: 129024 [ 0.000000] Policy zone: DMA [ 0.000000] Kernel command line: rw root=/dev/ram rdinit=/sbin/init earlyprintk=serial,ttyAMA0 console=hvc0 earlycon=xenboot [ 0.000000] Unknown kernel command line parameters "earlyprintk=serial,ttyAMA0", will be passed to user space. [ 0.000000] Dentry cache hash table entries: 65536 (order: 7, 524288 bytes, linear) [ 0.000000] Inode-cache hash table entries: 32768 (order: 6, 262144 bytes, linear) [ 0.000000] mem auto-init: stack:off, heap alloc:off, heap free:off [ 0.000000] Memory: 446932K/524288K available (14848K kernel code, 3068K rwdata, 8244K rodata, 6208K init, 496K bss, 44588K reserved, 32768K cma-reserved) [ 0.000000] SLUB: HWalign=64, Order=0-3, MinObjects=0, CPUs=4, Nodes=1 [ 0.000000] rcu: Preemptible hierarchical RCU implementation. [ 0.000000] rcu: RCU event tracing is enabled. [ 0.000000] rcu: RCU restricting CPUs from NR_CPUS=256 to nr_cpu_ids=4. [ 0.000000] Trampoline variant of Tasks RCU enabled. [ 0.000000] rcu: RCU calculated value of scheduler-enlistment delay is 25 jiffies. [ 0.000000] rcu: Adjusting geometry for rcu_fanout_leaf=16, nr_cpu_ids=4 [ 0.000000] NR_IRQS: 64, nr_irqs: 64, preallocated irqs: 0 [ 0.000000] GICv3: 256 SPIs implemented [ 0.000000] GICv3: 0 Extended SPIs implemented [ 0.000000] GICv3: Distributor has no Range Selector support [ 0.000000] Root IRQ handler: gic_handle_irq [ 0.000000] GICv3: 16 PPIs implemented (XEN) d0v0: vGICD: unhandled word write 0x000000ffffffff to ICACTIVER4 (XEN) d0v0: vGICD: unhandled word write 0x000000ffffffff to ICACTIVER8 (XEN) d0v0: vGICD: unhandled word write 0x000000ffffffff to ICACTIVER12 (XEN) d0v0: vGICD: unhandled word write 0x000000ffffffff to ICACTIVER16 (XEN) d0v0: vGICD: unhandled word write 0x000000ffffffff to ICACTIVER20 (XEN) d0v0: vGICD: unhandled word write 0x000000ffffffff to ICACTIVER24 (XEN) d0v0: vGICD: unhandled word write 0x000000ffffffff to ICACTIVER28 (XEN) d0v0: vGICD: unhandled word write 0x000000ffffffff to ICACTIVER32 [ 0.000000] GICv3: CPU0: found redistributor 0 region 0:0x00000000080a0000 (XEN) d0v0: vGICR: SGI: unhandled word write 0x000000ffffffff to ICACTIVER0 [ 0.000000] random: get_random_bytes called from start_kernel+0x478/0x660 with crng_init=0 [ 0.000000] arch_timer: cp15 timer(s) running at 62.50MHz (virt). [ 0.000000] clocksource: arch_sys_counter: mask: 0xffffffffffffff max_cycles: 0x1cd42e208c, max_idle_ns: 881590405314 ns [ 0.000084] sched_clock: 56 bits at 62MHz, resolution 16ns, wraps every 4398046511096ns [ 0.012894] Console: colour dummy device 80x25 [ 0.013840] printk: console [hvc0] enabled [ 0.013840] printk: console [hvc0] enabled [ 0.014905] printk: bootconsole [xenboot0] disabled [ 0.014905] printk: bootconsole [xenboot0] disabled [ 0.018631] Calibrating delay loop (skipped), value calculated using timer frequency.. 125.00 BogoMIPS (lpj=250000) [ 0.019570] pid_max: default: 32768 minimum: 301 [ 0.021571] LSM: Security Framework initializing [ 0.023666] Mount-cache hash table entries: 1024 (order: 1, 8192 bytes, linear) [ 0.024735] Mountpoint-cache hash table entries: 1024 (order: 1, 8192 bytes, linear) [ 0.077847] xen:grant_table: Grant tables using version 1 layout [ 0.079540] Grant table initialized [ 0.114560] xen:events: Using FIFO-based ABI [ 0.115839] Xen: initializing cpu0 [ 0.118360] rcu: Hierarchical SRCU implementation. [ 0.124948] EFI services will not be available. [ 0.128540] smp: Bringing up secondary CPUs ... (XEN) d0v1: vGICR: SGI: unhandled word write 0x000000ffffffff to ICACTIVER0 [ 0.224868] Detected PIPT I-cache on CPU1 [ 0.225536] GICv3: CPU1: found redistributor 1 region 0:0x00000000080c0000 [ 0.226294] Xen: initializing cpu1 [ 0.226617] CPU1: Booted secondary processor 0x0000000001 [0x411fd070] [ 0.306946] Detected PIPT I-cache on CPU2 [ 0.307085] GICv3: CPU2: found redistributor 2 region 0:0x00000000080e0000 [ 0.307648] Xen: initializing cpu2 [ 0.307851] CPU2: Booted secondary processor 0x0000000002 [0x411fd070] [ 0.331736] Detected PIPT I-cache on CPU3 [ 0.331917] GICv3: CPU3: found redistributor 3 region 0:0x0000000008100000 [ 0.332175] Xen: initializing cpu3 [ 0.332377] CPU3: Booted secondary processor 0x0000000003 [0x411fd070] [ 0.333447] smp: Brought up 1 node, 4 CPUs [ 0.337539] SMP: Total of 4 processors activated. [ 0.337871] CPU features: detected: 32-bit EL0 Support [ 0.338209] CPU features: detected: 32-bit EL1 Support [ 0.338567] CPU features: detected: CRC32 instructions [ 0.597514] CPU: All CPU(s) started at EL1 [ 0.599406] alternatives: patching kernel code [ 0.636474] devtmpfs: initialized [ 0.653150] KASLR enabled [ 0.654918] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 7645041785100000 ns [ 0.656732] futex hash table entries: 1024 (order: 4, 65536 bytes, linear) [ 0.663202] pinctrl core: initialized pinctrl subsystem [ 0.677035] DMI not present or invalid. [ 0.690858] NET: Registered PF_NETLINK/PF_ROUTE protocol family [ 0.706188] DMA: preallocated 128 KiB GFP_KERNEL pool for atomic allocations [ 0.707913] DMA: preallocated 128 KiB GFP_KERNEL|GFP_DMA pool for atomic allocations [ 0.709705] DMA: preallocated 128 KiB GFP_KERNEL|GFP_DMA32 pool for atomic allocations [ 0.710661] audit: initializing netlink subsys (disabled) [ 0.714410] audit: type=2000 audit(0.560:1): state=initialized audit_enabled=0 res=1 [ 0.739031] thermal_sys: Registered thermal governor 'step_wise' [ 0.739168] thermal_sys: Registered thermal governor 'power_allocator' [ 0.741188] hw-breakpoint: found 6 breakpoint and 4 watchpoint registers. [ 0.763998] ASID allocator initialised with 32768 entries [ 0.764966] xen:swiotlb_xen: Warning: only able to allocate 4 MB for software IO TLB [ 0.775279] software IO TLB: mapped [mem 0x0000000062c00000-0x0000000063000000] (4MB) [ 0.780668] Serial: AMBA PL011 UART driver [ 0.810618] Internal error: synchronous external abort: 96000010 [#1] PREEMPT SMP [ 0.811196] Modules linked in: [ 0.811663] CPU: 0 PID: 1 Comm: swapper/0 Not tainted 5.15.10 #2 [ 0.812099] Hardware name: linux,dummy-virt (DT) [ 0.812569] pstate: 00000005 (nzcv daif -PAN -UAO -TCO -DIT -SSBS BTYPE=--) [ 0.812974] pc : amba_device_try_add+0xe0/0x338 [ 0.813279] lr : amba_device_try_add+0xd4/0x338 [ 0.813789] sp : ffff80001003bc00 [ 0.814177] x29: ffff80001003bc00 x28: 0000000000000000 x27: ffffcb8becd4b8d0 [ 0.814663] x26: 0000000000000001 x25: 0000000000000000 x24: ffff800010031000 [ 0.815072] x23: 0000000000000000 x22: ffff5a03a26072f8 x21: 0000000000001000 [ 0.815475] x20: ffff5a03a2607000 x19: 0000000000000000 x18: 0000000000000001 [ 0.815878] x17: 0000000000007fff x16: 0000000000000012 x15: ffff5a03a2480458 [ 0.816280] x14: ffffffffffffffff x13: 0000000000000020 x12: 0101010101010101 [ 0.816681] x11: 0000000000000003 x10: 0101010101010101 x9 : 0000000000000000 [ 0.817115] x8 : 7f7f7f7f7f7f7f7f x7 : fefefeff646c606d x6 : 1c041e00f4f38080 [ 0.817518] x5 : 00007374001e041c x4 : 8080808000000000 x3 : 932b9b2ba3980000 [ 0.817920] x2 : ffff800010031fe0 x1 : 0000000000000000 x0 : 0000000000000000 [ 0.818469] Call trace: [ 0.818830] amba_device_try_add+0xe0/0x338 [ 0.819083] amba_device_add+0x1c/0xd8 [ 0.819284] of_platform_bus_create+0x308/0x3b0 [ 0.819526] of_platform_populate+0x58/0xe8 [ 0.819731] of_platform_default_populate_init+0xb4/0xd4 [ 0.820011] do_one_initcall+0x54/0x1b8 [ 0.820231] kernel_init_freeable+0x210/0x294 [ 0.820488] kernel_init+0x24/0x128 [ 0.820699] ret_from_fork+0x10/0x20 [ 0.821161] Code: 9403e024 d10082a2 52800000 8b020302 (88dffc41) [ 0.821989] ---[ end trace 754aa25074fbbacd ]--- [ 0.832886] Kernel panic - not syncing: Attempted to kill init! exitcode=0x0000000b [ 0.833423] SMP: stopping secondary CPUs [ 0.834190] ---[ end Kernel panic - not syncing: Attempted to kill init! exitcode=0x0000000b ]--- qemu-system-aarch64: terminating on signal 2 |
Please help me identify the issue and resolve it? Also i would like to mention that that the size of Image.gz and rootfs.img.gz used in the u-boot messages were calculated as follows:
Quote:
printf "0x%x\n" $(stat -c %s Image.gz) 0xb0738b |
printf "0x%x\n" $(stat -c %s rootfs.img.gz) 0x11d2fc |