imx8qm kernel panic when booting xen hypervisor

Hello! i’m new in using toradex. i want to boot xen hypervisor in my yocto tdx-reference-minimal-image. but when i’m using imagebuilder and TFTP boot for boot the xen hypervisor, i got kernel panic on there (Unable to copy the kernel in the hwdom memory). what should i do to fix this issue? because when i’m just change memory for xen load, it’s not make any changes.

this is my full xen boot message

 Xen 4.18.3
(XEN) Xen version 4.18.3 (xxxxxxx@) (aarch64-tdx-linux-gcc (GCC) 13.3.0) debug=n Thu Sep 19 12:54:22 WIB 2024
(XEN) Latest ChangeSet: Wed Aug 14 17:49:51 2024 -0700 git:781c251261
(XEN) build-id: 095d17573dab5de30cb0f1fb3674dfe9ca0fb235
(XEN) Console output is synchronous.
(XEN) Processor: 00000000410fd034: "ARM Limited", variant: 0x0, part 0xd03,rev 0x4
(XEN) 64-bit Execution:
(XEN)   Processor Features: 0000000001002222 0000000000000000
(XEN)     Exception Levels: EL3:64+32 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: 0000000000001122 0000000000000000
(XEN)   ISA Features:  0000000000011120 0000000000000000
(XEN) 32-bit Execution:
(XEN)   Processor Features: 0000000000000131:0000000010011011
(XEN)     Instruction Sets: AArch32 A32 Thumb Thumb-2 Jazelle
(XEN)     Extensions: GenericTimer Security
(XEN)   Debug Features: 0000000003010066
(XEN)   Auxiliary Features: 0000000000000000
(XEN)   Memory Model Features: 0000000010201105 0000000040000000
(XEN)                          0000000001260000 0000000002102211
(XEN)   ISA Features: 0000000002101110 0000000013112111 0000000021232042
(XEN)                 0000000001112131 0000000000011142 0000000000011121
(XEN) Using SMC Calling Convention v1.4
(XEN) Using PSCI v1.1
(XEN) SMP: Allowing 6 CPUs
(XEN) Generic Timer IRQ: phys=30 hyp=26 virt=27 Freq: 8000 KHz
(XEN) GICv3 initialization:
(XEN)       gic_dist_addr=0x00000051a00000
(XEN)       gic_maintenance_irq=25
(XEN)       gic_rdist_stride=0
(XEN)       gic_rdist_regions=1
(XEN)       redistributor regions:
(XEN)         - region 0: 0x00000051b00000 - 0x00000051bc0000
(XEN) GICv3 compatible with GICv2 cbase 0x00000052000000 vbase 0x00000052020000
(XEN) GICv3: 544 lines, (IID 0001143b).
(XEN) GICv3: CPU0: Found redistributor in region 0 @000002004001c000
(XEN) XSM Framework v1.0.1 initialized
(XEN) Initialising XSM SILO mode
(XEN) Could not find scheduler: null
(XEN) Using 'SMP Credit Scheduler rev2' (credit2)
(XEN) Using scheduler: SMP Credit Scheduler rev2 (credit2)
(XEN) Initializing Credit2 scheduler
(XEN)  load_precision_shift: 18
(XEN)  load_window_shift: 30
(XEN)  underload_balance_tolerance: 0
(XEN)  overload_balance_tolerance: -3
(XEN)  runqueues arrangement: socket
(XEN)  cap enforcement granularity: 10ms
(XEN) load tracking window length 1073741824 ns
(XEN) Allocated console ring of 64 KiB.
(XEN) CPU0: Guest atomics will try 13 times before pausing the domain
(XEN) Bringing up CPU1
(XEN) GICv3: CPU1: Found redistributor in region 0 @000002004003c000
(XEN) CPU1: Guest atomics will try 14 times before pausing the domain
(XEN) CPU 1 booted.
(XEN) Bringing up CPU2
(XEN) GICv3: CPU2: Found redistributor in region 0 @000002004005c000
(XEN) CPU2: Guest atomics will try 14 times before pausing the domain
(XEN) CPU 2 booted.
(XEN) Bringing up CPU3
(XEN) GICv3: CPU3: Found redistributor in region 0 @000002004007c000
(XEN) CPU3: Guest atomics will try 15 times before pausing the domain
(XEN) CPU 3 booted.
(XEN) Bringing up CPU4
(XEN) CPU4 MIDR (0x00000000410fd082) does not match boot CPU MIDR (0x00000000410fd034),
(XEN) disable cpu (see big.LITTLE.txt under docs/).
(XEN) CPU4 never came online
(XEN) Failed to bring up CPU 4 (error -5)
(XEN) Bringing up CPU5
(XEN) CPU5 MIDR (0x00000000410fd082) does not match boot CPU MIDR (0x00000000410fd034),
(XEN) disable cpu (see big.LITTLE.txt under docs/).
(XEN) CPU5 never came online
(XEN) Failed to bring up CPU 5 (error -5)
(XEN) Brought up 4 CPUs
(XEN) smmu: /iommu@51400000: probing hardware configuration...
(XEN) smmu: /iommu@51400000: SMMUv2 with:
(XEN) smmu: /iommu@51400000: 	stage 2 translation
(XEN) smmu: /iommu@51400000: 	stream matching with 32 register groups, mask 0x7fbf<2>smmu: /iommu@51400000: 	32 context banks (0 stage-2 only)
(XEN) smmu: /iommu@51400000: 	Stage-2: 48-bit IPA -> 48-bit PA
(XEN) smmu: /iommu@51400000: registered 0 master devices
(XEN) I/O virtualisation enabled
(XEN)  - Dom0 mode: Relaxed
(XEN) P2M: 40-bit IPA with 40-bit PA and 8-bit VMID
(XEN) P2M: 3 levels with order-1 root, VTCR 0x0000000080023558
(XEN) Scheduling granularity: cpu, 1 CPU per sched-resource
(XEN) Initializing Credit2 scheduler
(XEN)  load_precision_shift: 18
(XEN)  load_window_shift: 30
(XEN)  underload_balance_tolerance: 0
(XEN)  overload_balance_tolerance: -3
(XEN)  runqueues arrangement: socket
(XEN)  cap enforcement granularity: 10ms
(XEN) load tracking window length 1073741824 ns
(XEN) Logical CPU 0 in Pool-0 (Scheduler id: -1).
(XEN) Adding cpu 0 to runqueue 0
(XEN)  First cpu on runqueue, activating
(XEN) Logical CPU 1 in Pool-0 (Scheduler id: -1).
(XEN) Adding cpu 1 to runqueue 0
(XEN) Logical CPU 2 in Pool-0 (Scheduler id: -1).
(XEN) Adding cpu 2 to runqueue 0
(XEN) Logical CPU 3 in Pool-0 (Scheduler id: -1).
(XEN) Adding cpu 3 to runqueue 0
(XEN) alternatives: Patching with alt table 00000200002cdad0 -> 00000200002cecb8
(XEN) *** LOADING DOMAIN 0 ***
(XEN) Loading d0 kernel from boot module @ 0000000880400000
(XEN) Loading ramdisk from boot module @ 0000000882000000
(XEN) Allocating 1:1 mappings totalling 2048MB for dom0:
(XEN) BANK[0] 0x00000098000000-0x00000100000000 (1664MB)
(XEN) BANK[1] 0x00000898000000-0x000008a0000000 (128MB)
(XEN) BANK[2] 0x000009e0000000-0x000009f0000000 (256MB)
(XEN) Grant table range: 0x0000088b600000-0x0000088b640000
(XEN) Allocating PPI 16 for event channel interrupt
(XEN) d0: extended region 0: 0x18000000->0x2be00000
(XEN) d0: extended region 1: 0x31a00000->0x3b200000
(XEN) d0: extended region 2: 0x3b800000->0x51200000
(XEN) d0: extended region 3: 0x100000000->0x87fe00000
(XEN) d0: extended region 4: 0xa00000000->0xffffe00000
(XEN) Loading zImage from 0000000880400000 to 0000000098000000-0000000099b20000
(XEN) 
(XEN) ****************************************
(XEN) Panic on CPU 0:
(XEN) Unable to copy the kernel in the hwdom memory
(XEN) ****************************************
(XEN) 
(XEN) Reboot in five seconds...

then this is my hardware information.
Software summary

Bootloader: U-Boot
Kernel version: 5.15.148-rt74-7.0.0-devel+git.284966e8d6ee #1 SMP Wed Jun 26 17:51:19 UTC 2024
Kernel command line: root=PARTUUID=06d0100f-02 ro rootwait console=tty1 console=ttyLP1,115200
Distro name: NAME=“TDX Wayland with XWayland RT”
Distro version: VERSION_ID=7.0.0-devel-20240831094003-build.0
Hostname: apalis-imx8-14904109

Hardware info

HW model: Toradex Apalis iMX8QM V1.1 on Apalis Evaluation Board
Toradex version: 0067 V1.1A
Serial number: 14904109
Processor arch: aarch64

Hi, I’m the Toradex AI Assistant. The Toradex Support team will follow up with you shortly!

Did you like my answer?

:+1: :-1:


It looks like you’re encountering a kernel panic when trying to boot the Xen hypervisor on your Apalis iMX8QM module. The error message “Unable to copy the kernel in the hwdom memory” suggests that there might be an issue with the memory configuration for the Xen hypervisor.

Here are a few steps you can take to troubleshoot and potentially resolve this issue:

  1. Memory Configuration:

    • Ensure that the memory regions allocated for Xen and Dom0 are correctly configured. You might need to adjust the memory settings in your Xen configuration file.
    • Verify that the memory regions do not overlap and that there is enough memory allocated for both the hypervisor and the Dom0 kernel.
  2. Kernel and Device Tree:

    • Make sure that the kernel and device tree you are using are compatible with Xen. Sometimes, specific patches or configurations are required for the kernel to work correctly with Xen.
    • Check if there are any specific configurations or patches needed for the Apalis iMX8QM when running Xen.
  3. Bootloader Configuration:

    • Ensure that U-Boot is correctly configured to load the Xen hypervisor and the Dom0 kernel. Double-check the boot commands and memory addresses used in U-Boot.
    • You might need to adjust the boot arguments passed to the Xen hypervisor to ensure it can correctly locate and load the Dom0 kernel.
  4. Xen Configuration:

    • Review the Xen configuration files to ensure that all settings are correct for your hardware. Pay special attention to the memory settings and any hardware-specific configurations.
    • Check the Xen documentation for any additional settings or parameters that might be required for the i.MX8QM platform.
  5. Debugging:

    • Enable additional debugging in Xen to get more detailed logs. This might help pinpoint the exact cause of the memory allocation failure.
    • You can also try running Xen in a more verbose mode to get more information about what is happening during the boot process.
  6. Consult Documentation and Support:

    • Review the Toradex and Xen documentation for any known issues or additional configuration steps required for the i.MX8QM platform.
    • If the issue persists, consider reaching out to Toradex support or the Xen community for further assistance.

Given the complexity of running a hypervisor like Xen, it might take some trial and error to get everything configured correctly. If you continue to face issues, providing detailed logs and configuration files to support channels can help in diagnosing the problem more effectively.

Please, also check if these links can help you solve your problem:

https://docs.u-boot.org/en/v2020.10/board/index.html

Xen port to Colibri IMX8X - NXP Community.

iI think there is a need for memory configuration for xen. But until now I have not been able to find where the memory configuration is located. whether it’s in the device tree or during the xen binary build itself.

Hi @Azkaaa
i am also trying xen on imx8qm board but i am unable to launch xen, could you please provide steps how to launch xen on imx8qm.
I have built linux kernel of kirkstone-6.x.y of yocto bsp not torizon OS from toradex git index page.
In above mentioned build we are able to generate xen.efi but it is not launching xen during boot.

Hi @yeswant,
I have also previously tried with kirkstone and dunfell. but for some reason both versions could not boot xen after I tried. Therefore I immediately tried the scarthgap-7.0.0 version and xen could boot but was stuck in the kernel panic.

best regard,
Azka