From b2eafa666cb7f5318daa61962bae62859f4e4e88 Mon Sep 17 00:00:00 2001 From: Nico Huber Date: Sat, 18 Jul 2020 14:45:23 +0200 Subject: libpayload: Cache physical CMOS option table location In the presence of self-relocating payloads, it's safer to keep physical addresses in `libsysinfo`. Change-Id: I64a37bef263022edb504086c02a3fd22ce068ba4 Signed-off-by: Nico Huber Reviewed-on: https://review.coreboot.org/c/coreboot/+/43576 Tested-by: build bot (Jenkins) Reviewed-by: Angel Pons Reviewed-by: Julius Werner --- payloads/libpayload/libc/coreboot.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'payloads/libpayload/libc/coreboot.c') diff --git a/payloads/libpayload/libc/coreboot.c b/payloads/libpayload/libc/coreboot.c index 25812e5a95..cb47a8317b 100644 --- a/payloads/libpayload/libc/coreboot.c +++ b/payloads/libpayload/libc/coreboot.c @@ -170,8 +170,8 @@ static void cb_parse_sku_id(unsigned char *ptr, struct sysinfo_t *info) #if CONFIG(LP_NVRAM) static void cb_parse_optiontable(void *ptr, struct sysinfo_t *info) { - /* ptr points to a coreboot table entry and is already virtual */ - info->option_table = ptr; + /* ptr is already virtual, but we want to keep physical addresses */ + info->cmos_option_table = virt_to_phys(ptr); } static void cb_parse_checksum(void *ptr, struct sysinfo_t *info) -- cgit v1.2.3