Re: Comet Lake: TOLUM change causes suspend/resume after reboot to fail

Jonathon Hall <[email protected]>
Newsgroups gmane.linux.bios
Message-ID <[email protected]>
Thanks for the great suggestions Nico!

I'll check the UPDs between cold boot / cold boot resume / reboot / 
reboot resume, try some delays, etc., to see if I can identify anything 
relevant on the coreboot side that could impact this.  It'd be great to 
find a solution there rather than having to kludge around it.

If I can't find a solution there, I'll try padding the FSP allocation, 
and we can see what that implementation looks like.  I belive the IMD 
structs already have magic numbers, so I could probably look for those 
on 4K-aligned positions in the bootloader reserved area during resume 
without costing too much (and all of this could be Kconfig-controlled if 
needed).

On 11/3/23 18:35, Nico Huber wrote:
> Hi Jonathon,
>
> On 03.11.23 22:46, Jonathon Hall wrote:
>> On Librem Mini v2, rebooting, then suspending and resuming fails to resume.
>>
>> I've tracked this down to a change in the TOLUM returned by FSP, which
>> causes failures to find important cbmem regions during S3 resume.  (I've
>> run into problems relating to the TOLUM change before:
>> https://puri.sm/posts/how-we-fixed-reboot-loops-on-the-librem-mini/.)
>> This doesn't seem to happen on all CML boards but has always happened on
>> Mini v2 for whatever reason.  I have some ideas to address it, but I'm
>> not sure which is best.
>>
>> For example:
>> * Cold boot: cbmem_top() = 0x99fff000
>> * Reboot: cbmem_top() = 0x9a000000 (4K later, FSP seems to reserve 4K
>> less memory for itself on reboot)
>> * Resume after reboot: cbmem_top() = 0x99fff000 (will not be able to
>> find cbmem from reboot, not sure if the upper 4 KB have been overwritten
>> by FSP)
> I would love to blame FSP for this, but first we should make sure that
> it's not coreboot's fault. I assume FSP is free to change the allocation
> depending on its inputs. So it would be coreboot's job to ensure that
> these inputs don't change when resuming. Obviously UPDs handed to FSP-M
> shouldn't change. Have you confirmed that? (maybe dump them or a check-
> sum). Otherwise, the hardware state could be different. I don't know any
> example for FSP-M, but generally FSP checking for the presence of a PCIe
> device, for instance, is imaginable. Then it could be bad timing. Maybe
> as a desperate last test, try a 200ms delay before jumping into FSP-M.
>
> If it's not that simple, I think we should bug Intel to provide a
> complete list of all inputs that affect TOLUM.
>
>> * Put the imd structures below the FSP reserved memory with some buffer
>> space?
> This would probably require additional hacks for coreboot to find
> things in the FSP reserved memory later. I'm not sure how invasive
> this would be. I can't remember rn. what were the reasons to keep
> the IMD structures on top. But IIRC FSP was changed for this, so I
> bet there are good reasons. (Ironically, I believe not having to
> move them when the amount of data FSP-M spews changes, was among
> them.)
>
>> * Put the imd structures somewhere else entirely, like toward the
>> beginning of the available low memory instead of the end?
> This could conflict with payloads, and (legacy) bootloaders and OSs.
>
>> * Ask FSP to reserve more than 8 KB for some buffer in case TOLUM
>> changes on resume, so the imd structures are still there?
> This was also one of my first thoughts. We may still have to jump
> through some hoops if the location of the FSP reserved things move,
> though.
>
> Nico
>

_______________________________________________
coreboot mailing list -- [email protected]
To unsubscribe send an email to [email protected]
OpenPGP_0x1E9C3CA91AE25114.asc (application/pgp-keys, 2.4 KB)
-----BEGIN PGP PUBLIC KEY BLOCK-----

xsDNBGKqedoBDADJBEGR1HhCL7NNss7dnXuudhBBd5HgyqYuPnPSRse2ai3nonDB
s1BvgquoHF4JG0JeMD009HXctqFStEO5BzDdtfMyWJ1HLChqQRjEMxZ76HI91yGn
pPvc7GPP9xxGs1zIM8ZGj3dGBEEUOnFBqojHVa/5MfIpf+UqPMkjck8dmEYRcueV
8gL+woFwMcw+9J6F9KJlFgbZGXLH0MyDd1GJyvhUFvwBT18CFWEORsBKvtxEZSBy
7mDFM5EAyY1FBvOxLiFn9B3tUXfCMINdC/RRCbzekmvilWrXDMWgCtLm8yLQHiaZ
KDLu5tvssWZH4p5vD3zIwr0RiCDzprMuwEqvSQchQeAiWUZpqjb114wdB7YLouae
otvVGdl4szUQ60PhlLarVcngAYZLeK6z3AYUei79wyzT04419b0wCXnwbVSY6pxd
+ltqybgbzJj7oiRq5qNPO9q1x3v+YsaWyJAevFfEYuGHfs5GPpXG5mCM21gmZiuK
YopEIsTivuLhExcAEQEAAc0lSm9uYXRob24gSGFsbCA8am9uYXRob24uaGFsbEBw
dX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Bx/L3f51Msy4SmzsrPcl/JR7VMtRd8f
g5jzc+rNZ3UsD0hydVrIEnYECmbaWqahjos0EAKpi8CUfvHqfV5mBEYrqKUnHupY
elyJ2oX8GT1LABEBAAHCwPwEGAEKACYWIQSHNVQCJemL28gkkbQenDypGuJRFAUC
Yqp52gIbDAUJA8JnAAAKCRAenDypGuJRFK05C/9eGD7mHOKEujtOiuebz4WsKfuZ
TdZ3AW7OzDlDFrwXTF0FIzidpSrsW5/iGFk3Uekcku1BJ7Hb7zueH0akHPeg9LHt
D6SDtasrY8jElkBo8p8mj2CDnCJOVts1yW37xDiMj7fzq7Nq3YjNzjAlGQyGmLWO
NVayqV5G4tmtMurAJ5HZKkMzaYwdM+ZixZ/qc3Lg66FGNUF+9i+YrqbMSXZAqEmB
amKgAodlflTu2Fy3W4tZ4IcQ0y/irLM9HDGh+lBB5QYTqj5ra750TDb7qc72tWDt
1q0ydgGMmYCHbwQM/i9pvEJOtBoJWHpj5deDeJWxg65GyBaVWyNJ5bXpEgYrXDOf
NbgFcuytwKLehoikas3Bm0OXYlewuzmbQNhysdVLQHKh58KLgU2wfqTdCm6riv5N
dLu7oysqFPXDk/iEzkgo8wbmJrqY7zfbazqZgCIjyD6Ym3c7p71yZwvUlWpUC0eF
TDpTzLru1daCcxs8s3k9xMDsIG3WvJXWWJicjqA=
=UdJq
-----END PGP PUBLIC KEY BLOCK-----
OpenPGP_signature.asc (application/pgp-signature, 665 B)
-----BEGIN PGP SIGNATURE-----

wsD5BAABCAAjFiEEhzVUAiXpi9vIJJG0Hpw8qRriURQFAmVI7JMFAwAAAAAACgkQHpw8qRriURRG
RAv/Vt7ZUaphYoaLHYF0D+kR+p5QTveHcVv9fcw4ExAElJbzZS36AC19RXrntcWk4gH5PkdfGzOB
zGbG//sCsoY46FrN/cXbCdAyuoM7fTZcBeHlMgMWkfxQ7oCs8Ph/jGY1EXiiFG/T32DrML/bkbY4
t/+erowUOrhfjKs3LhKeZAG6yZXIeXqb57gHgvCIHBulqnYoTsgh396k1eUr0WjvFplf6WmSr5hc
9tzlUfSsBaUng1M0InqsFHTJ7jtAmb06pxy7Ku7RNPh3/UZ8yjMr6vM+pB0uU3YRcJTCow8dgPwc
IWPedbFpXoI+LHsYsWs2lLOK7yfZGkg//O83Eju3goKVfVsgVFYPyPhXPDRPVvAicqL4CKjAzSIb
srTkg0ZkNNLVYXQB6bjJoxlImkNzU3QfeJiRtuJRcbdFoFqqm65xwVboA7M6Fs4wIq5OqoKDX4Li
swW84Sn9L0KTgFYlCRx2cB3wC57Ob0WMw7pXH43m6tSlwlTKtofoz+JzJC8y
=XjdF
-----END PGP SIGNATURE-----
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.