• H
    ACPI, APEI, Add ERST record ID cache · 885b976f
    Huang Ying 提交于
    APEI ERST firmware interface and implementation has no multiple users
    in mind.  For example, if there is four records in storage with ID: 1,
    2, 3 and 4, if two ERST readers enumerate the records via
    GET_NEXT_RECORD_ID as follow,
    
    reader 1		reader 2
    1
    			2
    3
    			4
    -1
    			-1
    
    where -1 signals there is no more record ID.
    
    Reader 1 has no chance to check record 2 and 4, while reader 2 has no
    chance to check record 1 and 3.  And any other GET_NEXT_RECORD_ID will
    return -1, that is, other readers will has no chance to check any
    record even they are not cleared by anyone.
    
    This makes raw GET_NEXT_RECORD_ID not suitable for used by multiple
    users.
    
    To solve the issue, an in-memory ERST record ID cache is designed and
    implemented.  When enumerating record ID, the ID returned by
    GET_NEXT_RECORD_ID is added into cache in addition to be returned to
    caller.  So other readers can check the cache to get all record ID
    available.
    Signed-off-by: NHuang Ying <ying.huang@intel.com>
    Reviewed-by: NAndi Kleen <ak@linux.intel.com>
    Signed-off-by: NLen Brown <len.brown@intel.com>
    885b976f
erst-dbg.c 5.0 KB