• James Morse's avatar
    ACPI / APEI: Don't update struct ghes' flags in read/clear estatus · 5cc6c682
    James Morse authored
    ghes_read_estatus() sets a flag in struct ghes if the buffer of
    CPER records needs to be cleared once the records have been
    processed. This flag value is a problem if a struct ghes can be
    processed concurrently, as happens at probe time if an NMI arrives
    for the same error source. The NMI clears the flag, meaning the
    interrupted handler may never do the ghes_estatus_clear() work.
    
    The GHES_TO_CLEAR flags is only set at the same time as
    buffer_paddr, which is now owned by the caller and passed to
    ghes_clear_estatus(). Use this value as the flag.
    
    A non-zero buf_paddr returned by ghes_read_estatus() means
    ghes_clear_estatus() should clear this address. ghes_read_estatus()
    already checks for a read of error_status_address being zero,
    so CPER records cannot be written here.
    Signed-off-by: default avatarJames Morse <james.morse@arm.com>
    Reviewed-by: default avatarBorislav Petkov <bp@suse.de>
    Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
    5cc6c682
ghes.c 30.7 KB