cbmem: use aligned_memcpy for reading cbmem address information

The coreboot table entry containing the memory entries can have
fields unnaturally aligned in memory. Therefore one needs to perform
an aligned_memcpy() so that it doesn't cause faults on certain
architectures that assume naturally aligned accesses.

BUG=chromium:925961

Change-Id: I28365b204962ac89d65d046076d862b6f9374c06
Signed-off-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-on: https://review.coreboot.org/c/31181
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Manoj Gupta <manojgupta@google.com>
Reviewed-by: Furquan Shaikh <furquan@google.com>
Reviewed-by: Julius Werner <jwerner@chromium.org>
This commit is contained in:
Aaron Durbin 2019-01-31 09:40:26 -07:00
parent 3f559d960c
commit eb722282da
1 changed files with 1 additions and 1 deletions

View File

@ -302,7 +302,7 @@ static void parse_memory_tags(const struct lb_memory *mem)
continue; continue;
debug(" LB_MEM_TABLE found.\n"); debug(" LB_MEM_TABLE found.\n");
/* The last one found is CBMEM */ /* The last one found is CBMEM */
cbmem = mem->map[i]; aligned_memcpy(&cbmem, &mem->map[i], sizeof(cbmem));
} }
} }