Attention is currently required from: Bora Guvendik, Furquan Shaikh, Selma Bensaid, Tim Wawrzynczak, Subrata Banik, Julius Werner, Aaron Durbin. Angel Pons has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/51445 )
Change subject: timestamp: Add new helper functions ......................................................................
Patch Set 8:
(1 comment)
Commit Message:
https://review.coreboot.org/c/coreboot/+/51445/comment/95685d8c_7565957b PS3, Line 7: Add helper fucntions
Thanks Angel and Julius for your suggestion. I believe we all are in same page but we are using different notation to explain our understanding.
Let me put the question straight here:
if you take a look into below table, the timestamp ids are in serialized order where
944: CSE sent boot stall done to PMC is the first activity for CSE RO post coming out from reset. Followed by 945, 946 and finally 947 where CSE receives CPU reset ack from PMC and we are moving towards CPU coming out from reset
Yes, makes sense.
now if we subtract the CSE timestamp from base or `0` and the cbmem does its sorting, it breaks the pre-cpu reset order (as you can see below, 947 becoming the least negative number).
If I understand you correctly, does "least negative number" mean the same as "negative number with the smallest absolute value"? For example, the "least negative number" among { -6, -3, -4 } would be -3, right? Or am I misunderstanding you?
If my interpretation is correct, I don't see what the problem is. 947 is the last event that happened before the "1st timestamp", so it should be the "least negative number". AIUI, the result should be something like this:
944:CSE sent 'Boot Stall Done' to PMC -1,074,000 (18,483,711,496,695,957) 945:CSE started to handle ICC configuration -308,000 (18,483,711,496,697,957) 946:CSE sent 'Host BIOS Prep Done' to PMC -303,000 (18,483,711,495,936,957) 947:CSE received 'CPU Reset Done Ack sent' from PMC -296,000 0:1st timestamp 0
Hmmm, but timestamps currently use unsigned integers. I guess that's why the numbers in parentheses are so large, they underflow.
This is what my concern was about. I believe subtract is the final solution for simplicity but followed by sorting makes it weird as below.
0:1st timestamp 0 947:CSE received 'CPU Reset Done Ack sent' from PMC 1,074,000 946:CSE sent 'Host BIOS Prep Done' to PMC 308,000 (18,483,711,495,936,957) 945:CSE started to handle ICC configuration 303,000 (18,483,711,496,697,957) 944:CSE sent 'Boot Stall Done' to PMC 296,000 (18,483,711,496,695,957)
Yes, I agree this ordering looks very weird.