diff mbox

[U-Boot,v4,02/14] efi: Correct cache flush alignment

Message ID 1478533636-17577-3-git-send-email-sjg@chromium.org
State Accepted
Commit d0d9099365f6658cfc89943b4e08d6436200845f
Delegated to: Alexander Graf
Headers show

Commit Message

Simon Glass Nov. 7, 2016, 3:47 p.m. UTC
Make sure that the cache flushes correctly by ensuring that the end
address is correctly aligned.

Signed-off-by: Simon Glass <sjg@chromium.org>
---

Changes in v4: None
Changes in v3: None
Changes in v2: None

 lib/efi_loader/efi_image_loader.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Comments

Alexander Graf Nov. 14, 2016, 11:06 p.m. UTC | #1
> Make sure that the cache flushes correctly by ensuring that the end
> address is correctly aligned.
> 
> Signed-off-by: Simon Glass <sjg@chromium.org>

Thanks, applied to efi-next

Alex
diff mbox

Patch

diff --git a/lib/efi_loader/efi_image_loader.c b/lib/efi_loader/efi_image_loader.c
index 5165377..3262d76 100644
--- a/lib/efi_loader/efi_image_loader.c
+++ b/lib/efi_loader/efi_image_loader.c
@@ -174,7 +174,8 @@  void *efi_load_pe(void *efi, struct efi_loaded_image *loaded_image_info)
 	efi_loader_relocate(rel, rel_size, efi_reloc);
 
 	/* Flush cache */
-	flush_cache((ulong)efi_reloc, virt_size);
+	flush_cache((ulong)efi_reloc,
+		    ALIGN(virt_size, CONFIG_SYS_CACHELINE_SIZE));
 	invalidate_icache_all();
 
 	/* Populate the loaded image interface bits */