All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] [v2] arm64: efi: make sure vmlinux load address aligned on 2MB
@ 2015-10-28 17:37 Timur Tabi
  2015-10-28 18:08 ` Mark Rutland
  0 siblings, 1 reply; 16+ messages in thread
From: Timur Tabi @ 2015-10-28 17:37 UTC (permalink / raw)
  To: linux-arm-kernel

The vmlinux image load address must be aligned to 2MB, as documented
in Documentation/arm64/booting.txt. Otherwise, __create_page_tables
in head.S will create incorrect page table entries.

Signed-off-by: Timur Tabi <timur@codeaurora.org>
Tested-by: Shanker Donthineni <shankerd@codeaurora.org>
---
 arch/arm64/kernel/efi-stub.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/arch/arm64/kernel/efi-stub.c b/arch/arm64/kernel/efi-stub.c
index 816120e..37118f4 100644
--- a/arch/arm64/kernel/efi-stub.c
+++ b/arch/arm64/kernel/efi-stub.c
@@ -42,7 +42,8 @@ efi_status_t __init handle_kernel_image(efi_system_table_t *sys_table_arg,
 		 * Mustang), we can still place the kernel at the address
 		 * 'dram_base + TEXT_OFFSET'.
 		 */
-		*image_addr = *reserve_addr = dram_base + TEXT_OFFSET;
+		*image_addr = *reserve_addr =
+			round_up(dram_base, SZ_2M) + TEXT_OFFSET;
 		nr_pages = round_up(kernel_memsize, EFI_ALLOC_ALIGN) /
 			   EFI_PAGE_SIZE;
 		status = efi_call_early(allocate_pages, EFI_ALLOCATE_ADDRESS,
-- 
Qualcomm Innovation Center, Inc.
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project.

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

end of thread, other threads:[~2015-10-29 15:08 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-10-28 17:37 [PATCH] [v2] arm64: efi: make sure vmlinux load address aligned on 2MB Timur Tabi
2015-10-28 18:08 ` Mark Rutland
2015-10-28 18:12   ` Timur Tabi
2015-10-28 18:12     ` Timur Tabi
     [not found]     ` <56311014.9020400-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
2015-10-28 18:21       ` Mark Rutland
2015-10-28 18:21         ` Mark Rutland
2015-10-29  2:59         ` Ard Biesheuvel
2015-10-29  2:59           ` Ard Biesheuvel
     [not found]           ` <CAKv+Gu-76knWJ+ffAemeR7sBBtVB68pmZNPGQZRZKhmnd21F9A-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2015-10-29 13:43             ` Mark Rutland
2015-10-29 13:43               ` Mark Rutland
2015-10-29 13:48               ` Ard Biesheuvel
2015-10-29 13:48                 ` Ard Biesheuvel
     [not found]                 ` <CAKv+Gu8yFYv7GNvsOzUD1UQaXZ0AeXByahq3XjodrCtOGRGfgQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2015-10-29 14:54                   ` Timur Tabi
2015-10-29 14:54                     ` Timur Tabi
     [not found]                     ` <56323311.8050708-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
2015-10-29 15:08                       ` Ard Biesheuvel
2015-10-29 15:08                         ` Ard Biesheuvel

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.