• James Morse's avatar
    ACPI / APEI: Don't store CPER records physical address in struct ghes · eeb25557
    James Morse authored
    When CPER records are found the address of the records is stashed
    in the struct ghes. Once the records have been processed, this
    address is overwritten with zero so that it won't be processed
    again without being re-populated by firmware.
    
    This goes wrong if a struct ghes can be processed concurrently,
    as can happen at probe time when an NMI occurs. If the NMI arrives
    on another CPU, the probing CPU may call ghes_clear_estatus() on the
    records before the handler had finished with them.
    Even on the same CPU, once the interrupted handler is resumed, it
    will call ghes_clear_estatus() on the NMIs records, this memory may
    have already been re-used by firmware.
    
    Avoid this stashing by letting the caller hold the address. A
    later patch will do away with the use of ghes->flags in the
    read/clear code too.
    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>
    eeb25557
ghes.c 30.9 KB