Skip to content

Commit

Permalink
libipl: Checking write flag before applying guard
Browse files Browse the repository at this point in the history
Change:
Adding checkWriteFlag, which will read the write flag
in guard partition, this to see if the guard partition
is not corrupt or not. If the write flag is set to 0x00
checkWriteFlag will return true and need to clear the
guard records from the partition.

Tested:
Setting the write flag as 0x00, seeing that guard records
are getting clear.

Signed-off-by: Chirag Sharma <[email protected]>
  • Loading branch information
Chirag Sharma committed May 29, 2022
1 parent 3cafe26 commit f74017c
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions libipl/p10/ipl0.C
Original file line number Diff line number Diff line change
Expand Up @@ -291,6 +291,12 @@ static void process_guard_records()

openpower::guard::libguard_init(false);

if (openpower::guard::checkWriteFlag()) {
ipl_log(IPL_INFO, "Guard partition is corrupt");
openpower::guard::clearAll();
return;
}

auto records = openpower::guard::getAll();
if (records.size()) {
ipl_log(IPL_INFO, "Number of Records = %d\n",records.size());
Expand Down

0 comments on commit f74017c

Please sign in to comment.