[coreboot-gerrit] Patch set updated for coreboot: 9027f60 libpayload arm64: don't modify cbtable entries

Patrick Georgi (pgeorgi@google.com) gerrit at coreboot.org
Fri Mar 20 12:42:06 CET 2015


Patrick Georgi (pgeorgi at google.com) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/8797

-gerrit

commit 9027f608b5ab36135a52a9f1809ae0036b2c8aeb
Author: Aaron Durbin <adurbin at chromium.org>
Date:   Tue Nov 18 11:55:33 2014 -0600

    libpayload arm64: don't modify cbtable entries
    
    The framebuffer structure lives in the coreboot tables. Those
    tables have a checksum calculation applied over all the entries.
    Therefore, one shouldnot be modifying fields within the coreboot
    table entries because the calculated checksum would be wrong.
    
    BRANCH=none
    BUG=chrome-os-partner:31936
    TEST=On ryu, confirmed dev screen still works as well as cbmem utility
         once booted.
    
    Change-Id: I93830a8efe98aa848f2b0f8388688de0e93b2f82
    Signed-off-by: Patrick Georgi <pgeorgi at chromium.org>
    Original-Commit-Id: 6026ca5ad0254c14c30412882dc63550656c7d16
    Original-Change-Id: Ic9c164ded03d10d6f6f3ce15e9b38b1f6ce61a91
    Original-Signed-off-by: Aaron Durbin <adurbin at chromium.org>
    Original-Reviewed-on: https://chromium-review.googlesource.com/230471
    Original-Reviewed-by: Furquan Shaikh <furquan at chromium.org>
    Original-Commit-Queue: Furquan Shaikh <furquan at chromium.org>
---
 payloads/libpayload/arch/arm64/mmu.c | 13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)

diff --git a/payloads/libpayload/arch/arm64/mmu.c b/payloads/libpayload/arch/arm64/mmu.c
index 41fb10b..86d9fc5 100644
--- a/payloads/libpayload/arch/arm64/mmu.c
+++ b/payloads/libpayload/arch/arm64/mmu.c
@@ -675,6 +675,7 @@ static void mmu_extract_ranges(struct memrange *cb_ranges,
 static void mmu_add_fb_range(struct mmu_ranges *mmu_ranges)
 {
 	struct mmu_memrange *fb_range;
+	static struct cb_framebuffer modified_fb;
 	struct cb_framebuffer *framebuffer = lib_sysinfo.framebuffer;
 	uint32_t fb_size;
 
@@ -695,8 +696,16 @@ static void mmu_add_fb_range(struct mmu_ranges *mmu_ranges)
 	if (fb_range == NULL)
 		mmu_error();
 
-	/* Set framebuffer address */
-	framebuffer->physical_address = fb_range->base;
+	/*
+	 * Set framebuffer address. However, one needs to use a freshly
+	 * allocated framebuffer structure because the one in the coreboot
+	 * table is part of a checksum calculation. Therefore, one cannot
+	 * modify a field without recomputing the necessary checksum
+	 * calcuation.
+	 */
+	modified_fb = *framebuffer;
+	modified_fb.physical_address = fb_range->base;
+	lib_sysinfo.framebuffer = &modified_fb;
 }
 
 /*



More information about the coreboot-gerrit mailing list