All of lore.kernel.org
 help / color / mirror / Atom feed
From: Julien Grall <Julien.Grall@arm.com>
To: Andrii Anisov <andrii.anisov@gmail.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Cc: Matthew Daley <mattd@bugfuzz.com>,
	"sstabellini@kernel.org" <sstabellini@kernel.org>
Subject: Re: [PATCH for-4.12 v2 2/2] xen/arm: Stop relocating Xen
Date: Fri, 14 Dec 2018 16:26:39 +0000	[thread overview]
Message-ID: <d0e0d122-b389-8fa0-df24-80cb1fe926c7@arm.com> (raw)
In-Reply-To: <90f45fb8-3ff7-492e-3773-c8d3bd2906bc@gmail.com>



On 12/14/18 3:52 PM, Andrii Anisov wrote:
> Hello Julien,

Hi,

>
> Let me speculate a bit about the topic.
>
> On 14.12.18 13:44, Julien Grall wrote:
>> At the moment, Xen is relocated towards the end of the memory.
> This statement is not really true. Some time ago, XEN was relocated
> toward the end of
> the low memory (under 4 GB).
Are you using arm64 or arm32? Arm64 does not have the 4GB limit while Arm32 has.
I could make the difference in the commit message but this would add more
confusion below.

> Currently, on my board I see some kind of
> mess:
>
>      (XEN) RAM: 0000000048000000 - 00000000bfffffff
>      (XEN) RAM: 0000000500000000 - 000000057fffffff
>      (XEN) RAM: 0000000600000000 - 000000067fffffff
>      (XEN) RAM: 0000000700000000 - 000000077fffffff
>      (XEN)
>      (XEN) MODULE[0]: 0000000048000000 - 0000000048013000 Device Tree
>      (XEN) MODULE[1]: 000000007a000000 - 000000007c000000 Kernel
>      (XEN) MODULE[2]: 000000007c000000 - 000000007c010000 XSM
>      (XEN)  RESVD[0]: 0000000048000000 - 0000000048013000
>      (XEN)
>      (XEN)
>      (XEN) Command line: dom0_mem=3G console=dtuart dtuart=serial0
> dom0_max_vcpus=2 bootscrub=0 loglvl=all cpufreq=none tbuf_size=8192
> loglvl=all/none guest_loglvl=all/none
>      (XEN) parameter "cpufreq" unknown!
>      (XEN) Placing Xen at 0x000000077fe00000-0x0000000780000000
>      (XEN) Update BOOTMOD_XEN from 0000000078080000-0000000078188d81 =>
> 000000077fe00000-000000077ff08d81
>
> As you can see XEN is moved towards the end of the first GB of the low
> memory instead of the end of under 4GB RAM.

I don't understand what you mean. Looking at your log, Xen is relocated at the
end of the last bank. This is the expected behavior in unstable.
>> While
>> this has the advantage to free space in low memory, the code is not
>> compliant with the break-before-make because it requires to switch
>> between two sets of page-table. This is not entirely trivial to fix as
>> it would require us to go through an identity mapping and disabling MMU.
> I understand this motivation though.
>
>> Furthermore, it looks like that some platform (such as the Hikey960)
>> may not be able to bring-up secondary CPUs if the entry is too
>> high.Just a reminder that long time ago we implemented a move of XEN
>> toward the real end of the memory, over 4GB.

This not the first time part of answer is mangled with my e-mail. This is making
really difficult to follow the conversion. Can you please configure your e-mail
client to do proper quote/reply?

> As long as CPUs were not able to start to the code placed over 4 GB, we
> set secondary CPUs to be brought up to a XEN instance under 4GB, then
> jump to a copy over 4GB, following CPU0.

How were you switching between the page-tables? A proper solution would require
to switch between page-tables using an identify mappings. This is far more
complicate than what is worth here.

>
>> I don't believe the low memory is an issue because Xen is quite tiny
>> (< 2MB).
> It is really tiny, but the problem is that Dom0 low memory (lower than 4
> GB) RAM banks
> start and end are aligned by 128MB. So existing of a single 1MB XEN cuts
> out 128MB from low memory for Dom0.

I don't understand how you came up with the conclusion that 128MB will be
removed from Dom0. We only have the requirement that the first bank is at least
128MB. So can you expand it?

> On my current setup I have two 128MB chunks stolen: one by relocated
> XEN, kernel module an XSM module, other another by device tree.

Xen is free to allocate anything below 4GB. This is nothing new. But you should
not have two 128MB chunks stolen because of modules here. If that's the case
then there is a bug in Xen that should be fixed.

Cheers,

--
Julien Grall
IMPORTANT NOTICE: The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium. Thank you.
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

  parent reply	other threads:[~2018-12-14 16:26 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-12-14 11:44 [PATCH for-4.12 v2 0/2] xen/arm: mm: Boot fixes Julien Grall
2018-12-14 11:44 ` [PATCH for-4.12 v2 1/2] xen/arm: mm: Use pte_xen_addr when creating xen entries Julien Grall
2018-12-14 21:44   ` Stefano Stabellini
2018-12-14 11:44 ` [PATCH for-4.12 v2 2/2] xen/arm: Stop relocating Xen Julien Grall
2018-12-14 15:52   ` Andrii Anisov
2018-12-14 16:09     ` Andrii Anisov
2018-12-14 16:26     ` Julien Grall [this message]
2018-12-14 17:24       ` Andrii Anisov
2018-12-14 17:48         ` Julien Grall
2018-12-17 11:11           ` Julien Grall
2018-12-17 16:02             ` Andrii Anisov
2018-12-17 16:56               ` Julien Grall
2018-12-17 17:57             ` Stefano Stabellini
2018-12-17 18:03               ` Julien Grall
2018-12-17 13:14           ` Andrii Anisov
2018-12-17 13:38             ` Julien Grall
2018-12-17 15:55               ` Andrii Anisov
2018-12-17 17:02                 ` Julien Grall
2018-12-17 17:34                   ` Andrii Anisov
2018-12-18 12:09                     ` Andrii Anisov
2018-12-18 13:13                       ` Julien Grall
2018-12-14 17:46       ` Andrii Anisov
2018-12-14 18:04         ` Julien Grall
2018-12-17 15:54           ` Andrii Anisov
2018-12-17 17:03             ` Julien Grall
2018-12-14 16:13   ` Andrii Anisov

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=d0e0d122-b389-8fa0-df24-80cb1fe926c7@arm.com \
    --to=julien.grall@arm.com \
    --cc=andrii.anisov@gmail.com \
    --cc=mattd@bugfuzz.com \
    --cc=sstabellini@kernel.org \
    --cc=xen-devel@lists.xen.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.