All of lore.kernel.org
 help / color / mirror / Atom feed
From: Roman Shaposhnik <roman@zededa.com>
To: Julien Grall <julien@xen.org>
Cc: xen-devel@lists.xenproject.org,
	Stefano Stabellini <sstabellini@kernel.org>,
	Stefano Stabellini <stefano.stabellini@xilinx.com>
Subject: Re: [Xen-devel] REGRESSION: Xen 4.13 RC5 fails to bootstrap Dom0 on ARM
Date: Wed, 18 Dec 2019 09:09:51 -0800	[thread overview]
Message-ID: <CAMmSBy_O5LwSxoyTYAehJtEiB57wkKd8DPxqt2aXpkCz63PKQw@mail.gmail.com> (raw)
In-Reply-To: <8645aa8e-bccd-b4df-46be-7730e0e6dd8b@xen.org>

Hi,

On Wed, Dec 18, 2019 at 4:56 AM Julien Grall <julien@xen.org> wrote:
> > So that is, in fact, my first question -- why is Xen not showing
> > available memory in xl info?
>
> I am not entirely sure what exact information you want.
>
> The output you dumped above contain the available memory for the memory
> (see "free_memory").
>
> Are you looking from something different?

Just to be clear: I was giving 2G via devicetrees (the same device
trees that would
make Linux detect 2G of RAM) hence I was expecting xl info to show that. Instead
I only got 1120M shown by xl info.

> On 18/12/2019 00:04, Roman Shaposhnik wrote:
> >          memory {
> >                  device_type = "memory";
> >                  reg = <0x0 0x0 0x0 0x5e00000 0x0 0x5f00000 0x0 0x1000
> > 0x0 0x5f02000 0x0 0xefd000 0x0 0x6e00000 0x0 0x60f000 0x0 0x7410000
> > 0x0 0x1aaf0000 0x0 0x21f00000 0x0 0x100000 0x0 0x22000000 0x0
> > 0x1c000000>;
> >          };
> >
> >          reserved-memory {
> >                  ranges;
> >                  #size-cells = <0x2>;
> >                  #address-cells = <0x2>;
> >
> >                  ramoops@21f00000 {
> >                          ftrace-size = <0x20000>;
> >                          console-size = <0x20000>;
> >                          reg = <0x0 0x21f00000 0x0 0x100000>;
> >                          record-size = <0x20000>;
> >                          compatible = "ramoops";
> >                  };
> >
> >                  linux,cma {
> >                          linux,cma-default;
> >                          reusable;
> >                          size = <0x0 0x8000000>;
> >                          compatible = "shared-dma-pool";
> >                  };
> >          };
> >
> > If you look at the REG -- it does now add up to 2Gb, but booting Xen
> > with it has exactly the
> > same effect as booting it with: reg = <0x0 0x0 0x0 0x80000000>;\
>
> If you boot Xen using EFI, the memory information wil come from EFI and
> the DT node will be ignored. So unless UEFI is able to pick up the
> modification of the DT memory node, modifying the DT is not going to
> affect anything.

That's a good point, but given that I always go through GRUB, I was
expecting devicetree command to completely overshadow whatever
information UEFI may have. Am I wrong?

> > I am attaching a full log, and I see the following in the logs:
> >
> > (XEN) Allocating 1:1 mappings totalling 720MB for dom0:
> > (XEN) BANK[0] 0x00000008000000-0x0000001c000000 (320MB)
> > (XEN) BANK[1] 0x00000040000000-0x00000058000000 (384MB)
> > (XEN) BANK[2] 0x0000007b000000-0x0000007c000000 (16MB)
> >
> > Which sort of makes sense, I guess -- but I still don't understand
> > where all these ranges
> > are coming from and how come Xen doesn't see the full 2Gb even with various
> > devicetrees I tried.
>
> The range aboves describe the memory range given to Dom0. For all the
> memory given to Xen,m you want to look at the top of your log:
>
> (XEN) Checking for initrd in /chosen
> (XEN) RAM: 0000000000000000 - 0000000005dfffff
> (XEN) RAM: 0000000005f00000 - 0000000006dfefff
> (XEN) RAM: 0000000006e00000 - 000000000740efff
> (XEN) RAM: 0000000007410000 - 000000001db8dfff
> (XEN) RAM: 00000000350f0000 - 000000003dbd2fff
> (XEN) RAM: 000000003dbd3000 - 000000003dffffff
> (XEN) RAM: 0000000040000000 - 000000005a653fff
> (XEN) RAM: 000000007ada0000 - 000000007ada3fff
> (XEN) RAM: 000000007aea8000 - 000000007afa9fff
> (XEN) RAM: 000000007afaa000 - 000000007ec73fff
> (XEN) RAM: 000000007ec74000 - 000000007fdddfff
> (XEN) RAM: 000000007fdde000 - 000000007fea5fff
> (XEN) RAM: 000000007fea6000 - 000000007ff6dfff
> (XEN) RAM: 000000007ffff000 - 000000007fffffff
>
> Looking at the differences with the Linux logs, there is indeed some
> memory not detected by Xen.
>
> On Xen, we only consider usuable memory any EFI description with
> EfiConventionalMemory, EfiBootServicesCode and EfiBootServicesData.
>
> Linux include more type here, so this may explain why we see a difference.
>
> While Looking at it, I have also noticed that we don't seem to care
> about the memory attribute. I suspect this could be another latent issue
> in Xen if the attribute does not match.

Anything I can do to help debug this? I can run any kind of debug builds, etc.
if needed.

I mean -- at this point it would be really great to get HiKey back to the status
of Xen-on-ARM developer board.

> > Any ideas here would be greatly apprecaited!
> >
> > Thanks,
> > Roman.
> >
> > P.S. Any guess at what these mean?
> >
> > (XEN) traps.c:1973:d0v0 HSR=0x93880006 pc=0x00ffff87355558
> > gva=0xffff872f2000 gpa=0x000000000f0000
> > (XEN) traps.c:1973:d0v0 HSR=0x93880006 pc=0x00ffffb734e558
> > gva=0xffffb72eb000 gpa=0x000000000f0000
> > (XEN) traps.c:1973:d0v0 HSR=0x93880006 pc=0x00ffff8f9d2558
> > gva=0xffff8f96f000 gpa=0x000000000f0000
>
> It means that Linux has tried to access something that has not been
> mapped in stage-2. As Dom0 is mapped 1:1, the GPA also give you the host
> physical address. In this case, it is trying to access 0xf0000.
>
> This seems to belong to the RAM, but this part has not been allocated to
> Dom0.

Got it! Thank you! Am I correct in guessing that this can only come from
a driver of some sorts trying to tickle the hardware? IOW, I should be
looking for some abnormalities in my linux kernel messages to try and
see what this could be.

> You may get more information from Dom0 if you add earlycon=xenboot on
> your linux command line. This will give you some output using the
> earlyconsole before the console subsytem is actually initialize.

Will do!

Thanks,
Roman.

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

  reply	other threads:[~2019-12-18 17:10 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-12-16 20:12 [Xen-devel] REGRESSION: Xen 4.13 RC5 fails to bootstrap Dom0 on ARM Roman Shaposhnik
2019-12-16 22:43 ` Stefano Stabellini
2019-12-17  2:55 ` Stefano Stabellini
2019-12-17  4:39   ` Roman Shaposhnik
2019-12-17 11:30     ` Julien Grall
2019-12-17 18:30       ` Stefano Stabellini
2019-12-17 18:33         ` Roman Shaposhnik
2019-12-17 19:25           ` Stefano Stabellini
2019-12-18  0:04             ` Roman Shaposhnik
2019-12-18  1:51               ` Stefano Stabellini
2019-12-18  2:56                 ` Roman Shaposhnik
2019-12-18  7:36                   ` Roman Shaposhnik
2019-12-18 11:50                     ` Julien Grall
2019-12-18 17:03                       ` Roman Shaposhnik
2019-12-18 22:17                         ` Julien Grall
2019-12-19  0:28                           ` Roman Shaposhnik
2019-12-19  7:58                             ` Julien Grall
2019-12-20  0:01                               ` Stefano Stabellini
2019-12-20  8:21                                 ` Julien Grall
2019-12-21  1:37                                 ` Roman Shaposhnik
2019-12-29 18:01                                   ` Julien Grall
2019-12-31  5:14                                     ` Roman Shaposhnik
2019-12-31 22:48                                       ` Roman Shaposhnik
2020-01-01 13:26                                         ` Julien Grall
2020-01-06 18:13                                           ` Stefano Stabellini
2019-12-18 13:02                   ` Julien Grall
2019-12-18 12:56               ` Julien Grall
2019-12-18 17:09                 ` Roman Shaposhnik [this message]
2019-12-18 22:40                   ` Julien Grall
2019-12-17 18:31       ` Roman Shaposhnik

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=CAMmSBy_O5LwSxoyTYAehJtEiB57wkKd8DPxqt2aXpkCz63PKQw@mail.gmail.com \
    --to=roman@zededa.com \
    --cc=julien@xen.org \
    --cc=sstabellini@kernel.org \
    --cc=stefano.stabellini@xilinx.com \
    --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.