From mboxrd@z Thu Jan 1 00:00:00 1970 Subject: Possible [BUG] PeiCore: HOBs after cache-as-RAM teardown To: devel@edk2.groups.io From: "Benjamin Doron" X-Originating-Location: Richmond Hill, Ontario, CA (24.52.200.135) X-Originating-Platform: Linux Firefox 89 User-Agent: GROUPS.IO Web Poster MIME-Version: 1.0 Date: Tue, 06 Jul 2021 22:55:20 -0700 Message-ID: Content-Type: multipart/alternative; boundary="cvtJCqJ0DtrwojdAOPR4" --cvtJCqJ0DtrwojdAOPR4 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Hi all, I'm working on root-causing an issue where I'm unable to retrieve any debu= g logs after cache-as-RAM teardown on my MinPlatform board port for GSoC 20= 21. I'm using KabylakeOpenBoardPkg/PeiSerialPortLibSpiFlash. My best guess at the moment is that it's related to HOBs, which this Seria= lPortLib uses. If I reinitialise the library stack, it largely works, but a= HOB/context structure entry "CurrentWriteOffset" also looks like it's zero= ed. Also, GetFeatureImplemented() in MinPlatformPkg/Test/TestPointCheckLib/Pei= TestPointCheckLib.c asserts with "Status =3D Not Found". Internally, the te= st point architecture uses HOBs. I don't think this should happen, so, if n= ot for this, I would think that perhaps a pointer in the serial port librar= y needed to be updated. I can see that the heap is copied over to permanent memory by the PEI core= dispatcher ( https://github.com/tianocore/edk2/blob/master/MdeModulePkg/Co= re/Pei/Dispatcher/Dispatcher.c#L881 ). However, I can't see that the HOB li= st pointer is updated, so it looks like it ( https://github.com/tianocore/e= dk2/blob/master/MdeModulePkg/Core/Pei/Hob/Hob.c#L44 ) still has the value t= hat's copied over from the old PEI core's data ( https://github.com/tianoco= re/edk2/blob/master/MdeModulePkg/Core/Pei/PeiMain/PeiMain.c#L348 ). Does this look like a bug, or might there be something else that I'm missi= ng? Best regards, Benjamin --cvtJCqJ0DtrwojdAOPR4 Content-Type: text/html; charset="utf-8" Content-Transfer-Encoding: quoted-printable Hi all,
I'm working on root-causing an issue where I'm unable to retri= eve any debug logs after cache-as-RAM teardown on my MinPlatform board port= for GSoC 2021. I'm using KabylakeOpenBoardPkg/PeiSerialPortLibSpiFlash.
My best guess at the moment is that it's related to HOBs, which th= is SerialPortLib uses. If I reinitialise the library stack, it largely work= s, but a HOB/context structure entry "CurrentWriteOffset" also looks like i= t's zeroed.

Also, GetFeatureImplemented() in MinPlatformPkg/Test= /TestPointCheckLib/PeiTestPointCheckLib.c asserts with "Status =3D Not Foun= d". Internally, the test point architecture uses HOBs. I don't think this s= hould happen, so, if not for this, I would think that perhaps a pointer in = the serial port library needed to be updated.

I can see that the= heap is copied over to permanent memory by the PEI core dispatcher (https://gith= ub.com/tianocore/edk2/blob/master/MdeModulePkg/Core/Pei/Dispatcher/Dispatch= er.c#L881). However, I can't see that the HOB list pointer is updated, = so it looks like it (= https://github.com/tianocore/edk2/blob/master/MdeModulePkg/Core/Pei/Hob/Hob= .c#L44) still has the value that's copied over from the old PEI core's = data (https:= //github.com/tianocore/edk2/blob/master/MdeModulePkg/Core/Pei/PeiMain/PeiMa= in.c#L348).

Does this look like a bug, or might there be som= ething else that I'm missing?

Best regards,
Benjamin --cvtJCqJ0DtrwojdAOPR4--