[Skiboot] [PATCH 0/4] libflash blocklevel ECC corrections

Cyril Bur cyril.bur at au1.ibm.com
Tue Apr 18 17:29:23 AEST 2017


Hello,

Recent configuration changes for new firmware builds has uncovered
problems with the way blocklevel deals with ECC. It somewhat
misleadingly says it will deal with it for you which is only true for
a very specific set of circumstances - namely; reading and writing
from the start of an ECC region but not arbitrarily within it.

This problem has remained unexposed as skiboot almost always reads and
writes from the start of an ECC region. Experiments involving turning
ECC on for the NVRAM partition lead linux to tell skiboot to write
into the partition at unaligned locations causing corruption of the
NVRAM partition.

Patches one, two and three define some helpers which are needed by
patch four which addresses the problem. Patch four removes code from
the gard tool which was only present to deal with the exact problem
which patch four addresses. The changes to the gard tool had to be
included in the fourth patch as double compensating for the presence
of ECC will result in incorrect behaviour.

Cyril Bur (4):
  libflash/ecc: Add functions to deal with unaligned ECC memcpy
  libflash/ecc: Add helpers to align a position within an ecc buffer
  libflash/blocklevel: Return region start from ecc_protected()
  libflash/blocklevel: Make read/write be ECC agnostic for callers

 external/gard/gard.c            |  32 ++--
 libflash/blocklevel.c           | 133 ++++++++++++++--
 libflash/ecc.c                  | 247 +++++++++++++++++++++++++++--
 libflash/ecc.h                  |   9 ++
 libflash/test/test-blocklevel.c | 341 ++++++++++++++++++++++++++++++++++++++--
 libflash/test/test-ecc.c        |  31 ++++
 6 files changed, 725 insertions(+), 68 deletions(-)

-- 
2.12.2



More information about the Skiboot mailing list