Patrick Rudolph has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/35682 )
Change subject: security/memory: Add x86_64 support ......................................................................
security/memory: Add x86_64 support
Fix compiler warning by adding an additional check for the fastpath memset.
Change-Id: I9a80438995bafe7e436f3fe2180b8c9574eeff23 Signed-off-by: Patrick Rudolph siro@das-labor.org --- M src/security/memory/memory_clear.c 1 file changed, 2 insertions(+), 1 deletion(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/82/35682/1
diff --git a/src/security/memory/memory_clear.c b/src/security/memory/memory_clear.c index 638c41a..45bee91 100644 --- a/src/security/memory/memory_clear.c +++ b/src/security/memory/memory_clear.c @@ -127,7 +127,8 @@ __func__, range_entry_base(r), range_entry_end(r));
/* Does regular memset work? */ - if (!(range_entry_end(r) >> sizeof(void *) * 8)) { + if (sizeof(resource_t) == sizeof(void *) || + !(range_entry_end(r) >> (sizeof(void *) * 8))) { /* fastpath */ memset((void *)(uintptr_t)range_entry_base(r), 0, range_entry_size(r));
Arthur Heymans has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/35682 )
Change subject: security/memory: Add x86_64 support ......................................................................
Patch Set 7: Code-Review+2
Patrick Rudolph has submitted this change. ( https://review.coreboot.org/c/coreboot/+/35682 )
Change subject: security/memory: Add x86_64 support ......................................................................
security/memory: Add x86_64 support
Fix compiler warning by adding an additional check for the fastpath memset.
Change-Id: I9a80438995bafe7e436f3fe2180b8c9574eeff23 Signed-off-by: Patrick Rudolph siro@das-labor.org Reviewed-on: https://review.coreboot.org/c/coreboot/+/35682 Reviewed-by: Arthur Heymans arthur@aheymans.xyz Tested-by: build bot (Jenkins) no-reply@coreboot.org --- M src/security/memory/memory_clear.c 1 file changed, 2 insertions(+), 1 deletion(-)
Approvals: build bot (Jenkins): Verified Arthur Heymans: Looks good to me, approved
diff --git a/src/security/memory/memory_clear.c b/src/security/memory/memory_clear.c index 638c41a..45bee91 100644 --- a/src/security/memory/memory_clear.c +++ b/src/security/memory/memory_clear.c @@ -127,7 +127,8 @@ __func__, range_entry_base(r), range_entry_end(r));
/* Does regular memset work? */ - if (!(range_entry_end(r) >> sizeof(void *) * 8)) { + if (sizeof(resource_t) == sizeof(void *) || + !(range_entry_end(r) >> (sizeof(void *) * 8))) { /* fastpath */ memset((void *)(uintptr_t)range_entry_base(r), 0, range_entry_size(r));