All of lore.kernel.org
 help / color / mirror / Atom feed
From: Julien Grall <julien@xen.org>
To: Srinivas Bangalore <srini@yujala.com>,
	xen-devel@lists.xenproject.org,
	'Christopher Clark' <christopher.w.clark@gmail.com>,
	Stefano Stabellini <sstabellini@kernel.org>
Subject: Re: Porting Xen to Jetson Nano
Date: Fri, 24 Jul 2020 18:25:19 +0100	[thread overview]
Message-ID: <5f985a6a-1bd6-9e68-f35f-b0b665688cee@xen.org> (raw)
In-Reply-To: <000001d661cb$45cdaa10$d168fe30$@yujala.com>



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

Hello,

> 
> 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
> 0000000088080000-000000008a23c808
> (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) WARNING: CONSOLE OUTPUT IS SYNCHRONOUS
> (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)
> (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)
>>
>> (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
> pCPU0.
> 
>>
>> Boot args for Xen and Dom0 are here:
>> (XEN) Checking for initrd in /chosen
>>
>> (XEN) linux,initrd limits invalid: 0000000084100000 >=
>> 0000000084100000
>>
>> (XEN) RAM: 0000000080000000 - 00000000fedfffff
>>
>> (XEN) RAM: 0000000100000000 - 000000017f1fffff
>>
>> (XEN)
>>
>> (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)
>>
>> (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


  reply	other threads:[~2020-07-24 17:25 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-22 17:57 Porting Xen to Jetson Nano Srinivas Bangalore
2020-07-23  4:26 ` Christopher Clark
2020-07-23 15:42   ` Srinivas Bangalore
2020-07-23 17:04   ` Julien Grall
2020-07-23 17:19     ` Julien Grall
2020-07-23 18:04 ` Julien Grall
2020-07-24 15:01   ` Srinivas Bangalore
2020-07-24 17:25     ` Julien Grall [this message]
2020-07-27 22:09       ` Srinivas Bangalore
2020-07-28 16:56         ` Julien Grall
2020-07-28 17:18           ` Srinivas Bangalore
2020-07-28 18:01             ` Rich Persaud
2020-07-29 17:25       ` srini
2020-07-30  1:27         ` Stefano Stabellini
2020-07-30 18:58           ` srini
2020-07-31  1:16             ` Stefano Stabellini
  -- strict thread matches above, loose matches on Subject: below --
2020-07-20 10:50 Srinivas Bangalore

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5f985a6a-1bd6-9e68-f35f-b0b665688cee@xen.org \
    --to=julien@xen.org \
    --cc=christopher.w.clark@gmail.com \
    --cc=srini@yujala.com \
    --cc=sstabellini@kernel.org \
    --cc=xen-devel@lists.xenproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.