From d0db3a90add3333ccdd70922967ff6f2d9315451 Mon Sep 17 00:00:00 2001 From: Julius Werner Date: Mon, 1 Dec 2014 13:11:52 -0800 Subject: [PATCH] vboot2: Reduce minimum required work buffer size Apparently our initial submission of 16K was a little too generous for the vboot2 work buffer, and I hear that we should also be well within bounds for 12K. This patch reduces the minimum asserted by memlayout so some of our low-mem boards can get a few more kilobytes back for discretionary spending. Also changes the required minimum alignment to 8 since that's what the current vboot code aligns it to anyway, and add a warning comment to make it clearer that this is a dangerous number people should not be playing with lightly. BRANCH=None BUG=None TEST=Built and booted on Pinky. Original-Change-Id: Iae9c74050500a315c90f5d5517427d755ac1dfea Original-Signed-off-by: Julius Werner Original-Reviewed-on: https://chromium-review.googlesource.com/232613 Original-Reviewed-by: Randall Spangler Original-Reviewed-by: Aaron Durbin (cherry picked from commit 64e972f10363451cd544fdf8642bd484463703bc) Signed-off-by: Aaron Durbin Change-Id: I362b8c33cf79534bb76bd7acda44d467563fe133 Reviewed-on: http://review.coreboot.org/9445 Reviewed-by: Patrick Georgi Tested-by: build bot (Jenkins) --- src/vendorcode/google/chromeos/vboot2/memlayout.h | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/vendorcode/google/chromeos/vboot2/memlayout.h b/src/vendorcode/google/chromeos/vboot2/memlayout.h index 9e1920039d..7903dd230d 100644 --- a/src/vendorcode/google/chromeos/vboot2/memlayout.h +++ b/src/vendorcode/google/chromeos/vboot2/memlayout.h @@ -22,9 +22,12 @@ #ifndef __CHROMEOS_VBOOT2_MEMLAYOUT_H #define __CHROMEOS_VBOOT2_MEMLAYOUT_H +/* Careful: required work buffer size depends on RW properties such as key size + * and algorithm -- what works for you might stop working after an update. Do + * NOT lower the asserted minimum without consulting vboot devs (rspangler)! */ #define VBOOT2_WORK(addr, size) \ - REGION(vboot2_work, addr, size, 4) \ - _ = ASSERT(size >= 16K, "vboot2 work buffer must be at least 16K!"); + REGION(vboot2_work, addr, size, 8) \ + _ = ASSERT(size >= 12K, "vboot2 work buffer must be at least 12K!"); #ifdef __VERSTAGE__ #define VERSTAGE(addr, sz) \