From: Michal Simek <monstr@monstr.eu>
To: Russell King - ARM Linux <linux@arm.linux.org.uk>
Cc: Andre Przywara <andre.przywara@calxeda.com>,
Ian Campbell <Ian.Campbell@citrix.com>,
Arnd Bergmann <arnd@arndb.de>,
Stefano Stabellini <stefano.stabellini@eu.citrix.com>,
"xen.org" <ian.jackson@eu.citrix.com>,
xen-devel@lists.xensource.com,
Stefano Stabellini <stefano.stabellini@citrix.com>,
Olof Johansson <olof@lixom.net>,
linux-arm-kernel@lists.infradead.org
Subject: Re: Physical memory start contraints in the Linux kernel (Was: Re: Xen osstest on Calxeda midway progress (Was: Re: [Xen-devel] [xen-unstable test] 21486: tolerable FAIL - PUSHED))
Date: Tue, 12 Nov 2013 16:24:46 +0100 [thread overview]
Message-ID: <5282483E.1000101@monstr.eu> (raw)
In-Reply-To: <20131112132001.GJ16735@n2100.arm.linux.org.uk>
[-- Attachment #1.1: Type: text/plain, Size: 3173 bytes --]
On 11/12/2013 02:20 PM, Russell King - ARM Linux wrote:
> On Tue, Nov 12, 2013 at 12:25:18PM +0000, Stefano Stabellini wrote:
>> Arnd, Olof,
>
> This isn't really an arm-soc thing, it's a core ARM thing...
>
>> we have been having this discussion on xen-devel regarding whether Xen
>> should be allowed to modify the start address of the physical memory
>> region in device tree before passing it to dom0 or not.
>>
>> The reason why this question is coming up now, is that we realized that
>> we are going to have to live with the 1:1 pseudo-physical to physical
>> mapping for dom0 for a while. This limits the ability of the hypervisor
>> of allocating dom0 memory wherever it wants. Xen can allocate dom0
>> memory from the low end but maybe not exactly from the start.
>>
>> As a result we would adjust the start of physical memory in device tree
>> to match the start of the memory region allocated for dom0. For example
>> on the Arndale it could be 0x80800000 instead of 0x80000000.
>>
>> Unfortunately not all the platforms can cope with this very well. In
>> particular the Arndale seems to have issues.
>
> That should be no problem provided that:
>
> (a) you load the kernel somewhere between 0x80800000 and 0x80ffffff -
> the decompressor will decide that the start of memory is 0x80800000, and
> place the kernel at 0x80808000.
> (b) _at the moment_ you modify DT to specify that memory starts at
> 0x80800000 and not 0x80000000.
>
> (b) is going to change soon: the shmobile and zynq platforms already have
> a problem with their memory setup which needs a patch in this area, and
> the patch will have the side effect of automatically removing (in your
> case) 0x80000000 to 0x80800000. See the patch below.
I wouldn't say problem here - just use case where we want/need to ignore
the part of memory. The patch below works nicely for us.
>
> If there's any other issues with multiplatform, then yes, we want to hear
> about them.
>
> arch/arm/kernel/setup.c | 11 +++++++++++
> 1 files changed, 11 insertions(+), 0 deletions(-)
>
> diff --git a/arch/arm/kernel/setup.c b/arch/arm/kernel/setup.c
> index f52150d2ec00..1957d54198ad 100644
> --- a/arch/arm/kernel/setup.c
> +++ b/arch/arm/kernel/setup.c
> @@ -660,6 +660,17 @@ int __init arm_add_memory(u64 start, u64 size)
> }
> #endif
>
> + if (aligned_start < PHYS_OFFSET) {
> + if (aligned_start + size < PHYS_OFFSET) {
just a note I sent to Russell. Here should be "<=" instead of just "<"
> + pr_info("Ignoring memory below PHYS_OFFSET: 0x%08llx-0x%08llx\n",
> + aligned_start, aligned_start + size);
> + return -EINVAL;
> + }
> +
> + size -= PHYS_OFFSET - aligned_start;
> + aligned_start = PHYS_OFFSET;
We should printk a message here to be aware that alignment was done.
Thanks,
Michal
--
Michal Simek, Ing. (M.Eng), OpenPGP -> KeyID: FE3D1F91
w: www.monstr.eu p: +42-0-721842854
Maintainer of Linux kernel - Microblaze cpu - http://www.monstr.eu/fdt/
Maintainer of Linux kernel - Xilinx Zynq ARM architecture
Microblaze U-BOOT custodian and responsible for u-boot arm zynq platform
[-- Attachment #1.2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 263 bytes --]
[-- Attachment #2: Type: text/plain, Size: 176 bytes --]
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
next prev parent reply other threads:[~2013-11-12 15:24 UTC|newest]
Thread overview: 36+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-11-06 6:52 [xen-unstable test] 21486: tolerable FAIL - PUSHED xen.org
2013-11-06 9:52 ` Xen osstest on Calxeda midway progress (Was: Re: [xen-unstable test] 21486: tolerable FAIL - PUSHED) Ian Campbell
2013-11-06 11:14 ` Stefano Stabellini
2013-11-06 11:19 ` Ian Campbell
2013-11-06 19:40 ` Stefano Stabellini
2013-11-06 19:57 ` Andre Przywara
2013-11-07 11:14 ` Ian Campbell
2013-11-11 18:42 ` Stefano Stabellini
2013-11-12 9:53 ` Ian Campbell
2013-11-12 12:25 ` Physical memory start contraints in the Linux kernel (Was: Re: Xen osstest on Calxeda midway progress (Was: Re: [Xen-devel] [xen-unstable test] 21486: tolerable FAIL - PUSHED)) Stefano Stabellini
2013-11-12 13:20 ` Russell King - ARM Linux
2013-11-12 14:38 ` Ian Campbell
2013-11-12 14:44 ` Russell King - ARM Linux
2013-11-12 14:52 ` Ian Campbell
2013-11-12 15:24 ` Michal Simek [this message]
2013-11-12 15:39 ` Physical memory start contraints in the Linux kernel (Was: Re: Xen osstest on Calxeda midway progress (Was: " Russell King - ARM Linux
2013-11-12 15:40 ` Michal Simek
2013-11-12 13:37 ` Physical memory start contraints in the Linux kernel (Was: Re: Xen osstest on Calxeda midway progress (Was: Re: [Xen-devel] " Arnd Bergmann
2013-11-12 14:35 ` Julien Grall
2013-11-12 14:40 ` Ian Campbell
2013-11-12 18:39 ` Arnd Bergmann
2013-11-12 18:47 ` Stefano Stabellini
2013-11-12 20:08 ` Arnd Bergmann
2013-11-13 10:50 ` Ian Campbell
2013-11-13 17:33 ` Stefano Stabellini
2013-11-13 19:42 ` Arnd Bergmann
2013-11-14 15:24 ` Stefano Stabellini
2013-11-12 14:41 ` Russell King - ARM Linux
2013-11-12 14:52 ` [Xen-devel] Physical memory start contraints in the Linux kernel (Was: Re: Xen osstest on Calxeda midway progress (Was: " Julien Grall
2013-11-12 14:57 ` Ian Campbell
2013-11-12 15:24 ` Julien Grall
2013-11-12 15:32 ` Ian Campbell
2013-11-13 12:57 ` Julien Grall
2013-11-12 15:00 ` Physical memory start contraints in the Linux kernel (Was: Re: Xen osstest on Calxeda midway progress (Was: Re: [Xen-devel] " Stefano Stabellini
2013-11-12 15:16 ` Russell King - ARM Linux
2013-11-12 13:58 ` Xen osstest on Calxeda midway progress (Was: Re: [xen-unstable test] 21486: tolerable FAIL - PUSHED) Julien Grall
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=5282483E.1000101@monstr.eu \
--to=monstr@monstr.eu \
--cc=Ian.Campbell@citrix.com \
--cc=andre.przywara@calxeda.com \
--cc=arnd@arndb.de \
--cc=ian.jackson@eu.citrix.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux@arm.linux.org.uk \
--cc=olof@lixom.net \
--cc=stefano.stabellini@citrix.com \
--cc=stefano.stabellini@eu.citrix.com \
--cc=xen-devel@lists.xensource.com \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).