open-power / hostboot

System initialization firmware for Power systems
Apache License 2.0
75 stars 97 forks source link

Does the ATTR value be saved to the PNOR flash when setting it in the Hostboot Runtime? #247

Open ierictin opened 4 months ago

ierictin commented 4 months ago

https://github.com/open-power/hostboot/blob/c4227d1e3dcf86b00ce0275cfebe2148d2035a24/src/include/usr/targeting/common/target.H#L1049

Hello, I want to set ATTR in the Hostboot Runtime to transfer some data for the next boot (Hostboot IPL), but I failed.

Here are some tests I did, for the same ATTR (non-volatile):

  1. If set the ATTR in the Hostboot IPL, I can see that the ATTR takes effect during the next Hostboot IPL boot.
  2. If set the ATTR in the Hostboot Runtime, I see that the ATTR is not set successfully and still uses the default value during the next Hostboot IPL boot.
  3. After setting the ATTR in the Hostboot Runtime and immediately reading it back for verification, it was found the ATTR was set successfully.

I guess that the ATTR value may only be stored in memory and not written back to PNOR. So, I want to know will the ATTR value be saved to the PNOR flash when setting it in the Hostboot Runtime?  Thanks.

dcrowell77 commented 4 months ago

Your guess is correct, at runtime all of the attributes live in memory only. Nothing is ever written into PNOR. Note that even during IPL the save doesn't happen automatically on each write, there is an explicit moment in time when all of the data is written out. See AttrRP::updatePreservedAttrSection() which is invoked at a high level by a call to syncAllAttributesToSP().

ierictin commented 4 months ago

Thanks, I can try other ways to transfer data.