* ARM kernel at memory offset 32MB
@ 2015-03-12 16:08 magnus at minimum.se
2015-03-12 20:06 ` Russell King - ARM Linux
0 siblings, 1 reply; 2+ messages in thread
From: magnus at minimum.se @ 2015-03-12 16:08 UTC (permalink / raw)
To: linux-arm-kernel
Hi,
I'm trying to run my kernel at an offset of 32 MB in order to reserve the
first 32 MB for an AMP application. I'm using a Xilinx Zynq-7000 where
Linux boots both CPU cores, then brings down CPU #1 and loads a
"baremetal"/AMP application onto it. This app then lives in the first 32
MB of the memory.
I've been able to run the kernel at offset 128 MB, and it correctly
ignores memory below PHYS_OFFSET. If I change it to any offset below 128
MB, the kernel snaps back to running at offset 0x0.
It seems like CONFIG_AUTO_ZRELADDR is what adjusts the load adress here;
and I noticed the alignment is hardcoded to 128 MB. Is this a hardware
limitation (can't we run a kernel at any offset between 0 and 128 MB?)
I tried changing the alignment in arch/arm/boot/compression/head.S and it
seems to work, but I feel like I'm on really thin ice here. I also tried
disabling CONFIG_AUTO_ZRELADDR, but it seems like my arch depend on it..?
Is it completely insane to try to reserve memory in front of the kernel?
Should I just go ahead and reserve memory after the kernel instead?
best regards, Magnus
^ permalink raw reply [flat|nested] 2+ messages in thread
* ARM kernel at memory offset 32MB
2015-03-12 16:08 ARM kernel at memory offset 32MB magnus at minimum.se
@ 2015-03-12 20:06 ` Russell King - ARM Linux
0 siblings, 0 replies; 2+ messages in thread
From: Russell King - ARM Linux @ 2015-03-12 20:06 UTC (permalink / raw)
To: linux-arm-kernel
On Thu, Mar 12, 2015 at 05:08:21PM +0100, magnus at minimum.se wrote:
> It seems like CONFIG_AUTO_ZRELADDR is what adjusts the load adress here;
> and I noticed the alignment is hardcoded to 128 MB. Is this a hardware
> limitation (can't we run a kernel at any offset between 0 and 128 MB?)
It's a balance between what various platforms require in terms of the
alignment of their physical memory, and what we can tolerate through
tricks such as what you're trying to do.
Let's take an example. A platform has 128MB starting at 0xc8000000.
If we increase the alignment to 256MB, this means we decide that
physical memory starts at 0xc0000000, which would map that to
PAGE_OFFSET, which ultimately will crash the kernel on this platform.
If, on the other hand, we have someone who has decided that they want
to hand over the first 64MB of memory for another application (such
as what you're doing), they will be loading the kernel at 64MB + 32K.
If we reduced the alignment to 64M, it means that on that platform,
we then decide that physical memory magically starts 64MB higher
than it used to, again leading to problems.
So, we basically can't change it now - the risks are too great.
--
FTTC broadband for 0.8mile line: currently at 10.5Mbps down 400kbps up
according to speedtest.net.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2015-03-12 20:06 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-03-12 16:08 ARM kernel at memory offset 32MB magnus at minimum.se
2015-03-12 20:06 ` Russell King - ARM Linux
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).