[Skiboot] [PATCH] external/gard: Fix displaying 'cleared' gard records
Cyril Bur
cyril.bur at au1.ibm.com
Fri Jan 8 10:32:05 AEDT 2016
On Thu, 07 Jan 2016 16:08:09 +1100
Stewart Smith <stewart at linux.vnet.ibm.com> wrote:
> Cyril Bur <cyril.bur at au1.ibm.com> writes:
>
> > When a garded component is replaced hostboot detects this and updates the
> > gard partition.
> >
> > What hostboot does is set the record_id field to 0xFFFFFFFF but leaves the
> > rest of the flash untouched, this has caused issues with the gard tool the
> > thinking was that an entire record of all 0xFF bytes would signal not a
> > valid record.
> >
> > This patch add rectifies this issue and `gard list` will no longer show any
> > record with an id of 0xFFFFFFFF.
> >
> > Signed-off-by: Cyril Bur <cyril.bur at au1.ibm.com>
> > ---
> > Stewart: Fixes BZ 131707
>
> I gather this should also head towards stable ?
Yes sorry, should I have explicitly stated that?
>
> > diff --git a/external/gard/gard.c b/external/gard/gard.c
> > index 0b7a68b..53f31d9 100644
> > --- a/external/gard/gard.c
> > +++ b/external/gard/gard.c
> > @@ -41,6 +41,8 @@
> >
> > #include "gard.h"
> >
> > +#define CLEARED_RECORD_ID 0xFFFFFFFF
>
> Prior to this patch, what was the check? We were just going until we saw
> a all 0xFF gard record, right?
Yes
> It looks like that functionality isn't
> removed, is it still correct?
Short answer, no idea. Long answer, when flash is wiped it will be all 0xFF so
to avoid reading a lot more than necessary I put that check in, there can't
possibly be a valid record that is all 0xFF (confirmed now with this clearing
business) and while I can't be sure, I expect it to be fairly safe that once I
hit a 0xFF record I've hit erased flash. What I would like to know and haven't
quite had the will to look through hostboot is, will it write gard records
after one that it has 'cleared', I've written this assuming it will but it
would make life easier for the tool if I can be sure it won't.
>
More information about the Skiboot
mailing list