• Avadhut Naik's avatar
    ACPI: APEI: EINJ: Add support for vendor defined error types · 22fca621
    Avadhut Naik authored
    Vendor-Defined Error types are supported by the platform apart from
    standard error types if bit 31 is set in the output of GET_ERROR_TYPE
    Error Injection Action.[1] While the errors themselves and the length
    of their associated "OEM Defined data structure" might vary between
    vendors, the physical address of this structure can be computed through
    vendor_extension and length fields of "SET_ERROR_TYPE_WITH_ADDRESS" and
    "Vendor Error Type Extension" Structures respectively.[2][3]
    
    Currently, however, the einj module only computes the physical address of
    Vendor Error Type Extension Structure. Neither does it compute the physical
    address of OEM Defined structure nor does it establish the memory mapping
    required for injecting Vendor-defined errors. Consequently, userspace
    tools have to establish the very mapping through /dev/mem, nopat kernel
    parameter and system calls like mmap/munmap initially before injecting
    Vendor-defined errors.
    
    Circumvent the issue by computing the physical address of OEM Defined data
    structure and establishing the required mapping with the structure. Create
    a new file "oem_error", if the system supports Vendor-defined errors, to
    export this mapping, through debugfs_create_blob(). Userspace tools can
    then populate their respective OEM Defined structure instances and just
    write to the file as part of injecting Vendor-defined Errors. Similarly,
    the tools can also read from the file if the system firmware provides some
    information through the OEM defined structure after error injection.
    
    [1] ACPI specification 6.5, section 18.6.4
    [2] ACPI specification 6.5, Table 18.31
    [3] ACPI specification 6.5, Table 18.32
    Suggested-by: default avatarYazen Ghannam <yazen.ghannam@amd.com>
    Signed-off-by: default avatarAvadhut Naik <Avadhut.Naik@amd.com>
    Reviewed-by: default avatarTony Luck <tony.luck@intel.com>
    Reviewed-by: default avatarBorislav Petkov (AMD) <bp@alien8.de>
    Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
    22fca621
einj.c 22.1 KB