Raul Rangel has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/42208 )
Change subject: soc/amd/picasso/bootblock: Clear BSS ......................................................................
soc/amd/picasso/bootblock: Clear BSS
The PSP does not currently reload bootblock on S3 resume. This means the memory retains the previous values from the run. We need to clear bss to avoid sharing state from the last run.
BUG=b:147042464 TEST=Verified staic variables are 0 on S3 resume.
Signed-off-by: Raul E Rangel rrangel@chromium.org Change-Id: I6071600b14e9edb7b09510b595e9380ae8957d9f --- M src/soc/amd/picasso/bootblock/pre_c.S 1 file changed, 9 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/08/42208/1
diff --git a/src/soc/amd/picasso/bootblock/pre_c.S b/src/soc/amd/picasso/bootblock/pre_c.S index 5c186f1..da9ecb9 100644 --- a/src/soc/amd/picasso/bootblock/pre_c.S +++ b/src/soc/amd/picasso/bootblock/pre_c.S @@ -18,6 +18,15 @@ and $0xfffffff0, %esp sub $8, %esp
+ /* clear .bss section since it is not cleared on S3 resume. */ + cld + xor %eax, %eax + movl $(_ebss), %ecx + movl $(_bss), %edi + sub %edi, %ecx + shrl $2, %ecx + rep stosl + movd %mm2, %eax pushl %eax /* tsc[63:32] */ movd %mm1, %eax