qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] QEMU: ARM: boot: Load kernel at an Image friendly address
@ 2014-03-25  3:34 Joel Fernandes
  2014-03-25 12:29 ` Christopher Covington
                   ` (2 more replies)
  0 siblings, 3 replies; 11+ messages in thread
From: Joel Fernandes @ 2014-03-25  3:34 UTC (permalink / raw)
  To: qemu-devel; +Cc: Joel Fernandes, Linux ARM Kernel List

Loading kernel at offset 0x10000 works only for zImage, but not for Image,
because the kernel expect the start of decompressed kernel (.head.text) to be
at an address that's a distance that's 16MB aligned from  PAGE_OFFSET +
TEXT_OFFSET (see vmlinux.lds.S). This check is enfornced in __fixup_pv_table in
arch/arm/kernel/head.S TEXT_OFFSET is 0x00008000, so a 16MB alignment needs to
have a "0x8000" in the lower 16 bits so that they cancel out. Currently the
offset Qemu loads it at is 0x10000.

With zImage, this need is met because zImage loads the uncompressed Image
correctly, however when loading an Image and executing directly Qemu is
required it to load it at the correct location. Doing so, doesn't break Qemu's
zImage loading. With this patch, both zImage and Image work correctly.

Signed-off-by: Joel Fernandes <joelf@ti.com>
---
 hw/arm/boot.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/hw/arm/boot.c b/hw/arm/boot.c
index dc62918..566b5c2 100644
--- a/hw/arm/boot.c
+++ b/hw/arm/boot.c
@@ -23,7 +23,7 @@
  * They have different preferred image load offsets from system RAM base.
  */
 #define KERNEL_ARGS_ADDR 0x100
-#define KERNEL_LOAD_ADDR 0x00010000
+#define KERNEL_LOAD_ADDR 0x00008000
 #define KERNEL64_LOAD_ADDR 0x00080000
 
 typedef enum {
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2014-04-02 16:06 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-03-25  3:34 [Qemu-devel] [PATCH] QEMU: ARM: boot: Load kernel at an Image friendly address Joel Fernandes
2014-03-25 12:29 ` Christopher Covington
2014-03-25 13:43   ` Joel Fernandes
2014-03-25 13:13 ` Peter Maydell
2014-03-25 13:46   ` Joel Fernandes
2014-04-01 17:10 ` Peter Maydell
2014-04-02 12:11   ` Peter Crosthwaite
2014-04-02 12:47     ` Peter Maydell
2014-04-02 12:58       ` Peter Crosthwaite
2014-04-02 15:04       ` Christopher Covington
2014-04-02 16:06       ` Joel Fernandes

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).