[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Porting Xen to Jetson Nano

On 24/07/2020 16:01, Srinivas Bangalore wrote:
Hi Julien,


Thanks for the tips. Comments inline...

I struggled to find your comment inline as your e-mail client doesn't quote my answer. Please configure your e-mail client to use some form of quoting (the usual is '>').

Here's the output, truncated since it goes into an infinite loop printing
the same info:
(XEN) Allocating 1:1 mappings totalling 128MB for dom0:
(XEN) BANK[0] 0x00000088000000-0x00000090000000 (128MB)
(XEN) Grant table range: 0x000000fec00000-0x000000fec68000
(XEN) Loading zImage from 00000000e1000000 to
(XEN) Allocating PPI 16 for event channel interrupt
(XEN) Loading dom0 DTB to 0x000000008fe00000-0x000000008fe34444
(XEN) Scrubbing Free RAM on 1 nodes using 4 CPUs
(XEN) ........done.
(XEN) Initial low memory virq threshold set at 0x4000 pages.
(XEN) Std. Loglevel: All
(XEN) Guest Loglevel: All
(XEN) ***************************************************
(XEN) This option is intended to aid debugging of Xen by ensuring
(XEN) that all output is synchronously delivered on the serial line.
(XEN) However it can introduce SIGNIFICANT latencies and affect
(XEN) timekeeping. It is NOT recommended for production use!
(XEN) ***************************************************
(XEN) 3... 2... 1...
(XEN) *** Serial input -> DOM0 (type 'CTRL-a' three times to switch input to
(XEN) Freed 296kB init memory.
(XEN) dom0 IPA 0x0000000088080000
(XEN) P2M @ 0000000803fc3d40 mfn:0x17f0f5
(XEN) 0TH[0x0] = 0x004000017f0f377f
(XEN) 1ST[0x2] = 0x02c00000800006fd
(XEN) Mem access check
(XEN) dom0 IPA 0x0000000088080000
(XEN) P2M @ 0000000803fc3d40 mfn:0x17f0f5
(XEN) 0TH[0x0] = 0x004000017f0f377f
(XEN) 1ST[0x2] = 0x02c00000800006fd
(XEN) Mem access check

The instruction abort issue looks normal as the mapping is marked as non-executable.

Looking at the rest of bits, bits 55:58 indicates the type of mapping used. The value suggest the mapping has been considered to be used p2m_mmio_direct_c (RW cacheable MMIO). This looks wrong to me because RAM should be mapped using p2m_ram_rw.

Looking at your DT, it looks like the region is marked as reserved. On Xen 4.8, reserved-memory region are not correctly handled (IIRC this was only fixed in Xen 4.13). This should be possible to confirm by enable CONFIG_DEVICE_TREE_DEBUG in your .config.

The option will debug more information about the mapping to dom0 on your console.

However, given you are using an old release, you are at risk at keep finding bugs that have been resolved in more recent releases. It would probably better if you switch to Xen 4.14 and report any bug you can find there.


I added the printk for 'Mem access check' inside the 'case FSC_FLT_PERM' of
the switch (fsc) code following the lookup. That's what you see in the
output above.
So it does seem like there's a memory access fault somehow.

(XEN)  HPFAR_EL2: 0000000000000000

(XEN)    FAR_EL2: 00000000a0080000


(XEN) Guest stack trace from sp=0:

(XEN)   Failed to convert stack to physical address


It seems the DOM0 kernel did not get added to the task list….

  From a look at the dump, dom0 vCPU0 has been scheduled and running on

Boot args for Xen and Dom0 are here:
(XEN) Checking for initrd in /chosen

(XEN) linux,initrd limits invalid: 0000000084100000 >=

(XEN) RAM: 0000000080000000 - 00000000fedfffff

(XEN) RAM: 0000000100000000 - 000000017f1fffff


(XEN) MODULE[0]: 00000000fc7f8000 - 00000000fc82d000 Device Tree

(XEN) MODULE[1]: 00000000e1000000 - 00000000e31bc808 Kernel
console=hvc0 earlyprintk=xen earlycon=xen rootfstype=ext4 rw rootwait
root=/dev/mmcblk0p1 rdinit=/sbin/init

You want to use earlycon=xenboot here.

(XEN)  RESVD[0]: 0000000080000000 - 0000000080020000

(XEN)  RESVD[1]: 00000000e3500000 - 00000000e3535000

(XEN)  RESVD[2]: 00000000fc7f8000 - 00000000fc82d000


(XEN) Command line: console=dtuart earlyprintk=xen
earlycon=uart8250,mmio32,0x70006000 sync_console dom0_mem=512M
log_lvl=all guest_loglvl=all console_to_ring

FWIW, earlyprintk and earlycon are not understood by Xen. They are only
useful for Dom0.

BTW, to Christopher's point, the dtb did have some issues. I had to hack the
'interrupt-controller' node to get the GICv2 working.
I have attached the .dts file that I'm using.

Best regards,

Julien Grall



Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.