Aaron Durbin has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/31181
Change subject: cbmem: use aligned_memcpy for reading cbmem address information ......................................................................
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.
chromium:925961
Change-Id: I28365b204962ac89d65d046076d862b6f9374c06 Signed-off-by: Aaron Durbin adurbin@chromium.org --- M util/cbmem/cbmem.c 1 file changed, 1 insertion(+), 1 deletion(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/81/31181/1
diff --git a/util/cbmem/cbmem.c b/util/cbmem/cbmem.c index 8e73d9c..fc2dcdc 100644 --- a/util/cbmem/cbmem.c +++ b/util/cbmem/cbmem.c @@ -302,7 +302,7 @@ continue; debug(" LB_MEM_TABLE found.\n"); /* The last one found is CBMEM */ - cbmem = mem->map[i]; + aligned_memcpy(&cbmem, &mem->map[i], sizeof(cbmem)); } }
Manoj Gupta has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/31181 )
Change subject: cbmem: use aligned_memcpy for reading cbmem address information ......................................................................
Patch Set 1: Code-Review+1
Thanks!
Furquan Shaikh has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/31181 )
Change subject: cbmem: use aligned_memcpy for reading cbmem address information ......................................................................
Patch Set 1: Code-Review+2
Julius Werner has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/31181 )
Change subject: cbmem: use aligned_memcpy for reading cbmem address information ......................................................................
Patch Set 1: Code-Review+2
Hello Julius Werner, build bot (Jenkins), Manoj Gupta, Furquan Shaikh,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/31181
to look at the new patch set (#2).
Change subject: cbmem: use aligned_memcpy for reading cbmem address information ......................................................................
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 --- M util/cbmem/cbmem.c 1 file changed, 1 insertion(+), 1 deletion(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/81/31181/2
Aaron Durbin has submitted this change and it was merged. ( https://review.coreboot.org/c/coreboot/+/31181 )
Change subject: cbmem: use aligned_memcpy for reading cbmem address information ......................................................................
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 --- M util/cbmem/cbmem.c 1 file changed, 1 insertion(+), 1 deletion(-)
Approvals: build bot (Jenkins): Verified Furquan Shaikh: Looks good to me, approved Julius Werner: Looks good to me, approved Manoj Gupta: Looks good to me, but someone else must approve
diff --git a/util/cbmem/cbmem.c b/util/cbmem/cbmem.c index 8e73d9c..fc2dcdc 100644 --- a/util/cbmem/cbmem.c +++ b/util/cbmem/cbmem.c @@ -302,7 +302,7 @@ continue; debug(" LB_MEM_TABLE found.\n"); /* The last one found is CBMEM */ - cbmem = mem->map[i]; + aligned_memcpy(&cbmem, &mem->map[i], sizeof(cbmem)); } }