On Tue, Nov 07, 2023 at 03:36:47PM -0600, Avadhut Naik wrote: > From: Avadhut Naik <Avadhut.Naik@xxxxxxx> > > 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: Yazen Ghannam <yazen.ghannam@xxxxxxx> > Signed-off-by: Avadhut Naik <Avadhut.Naik@xxxxxxx> > --- > drivers/acpi/apei/einj.c | 24 ++++++++++++++++++++++++ > 1 file changed, 24 insertions(+) Reviewed-by: Borislav Petkov (AMD) <bp@xxxxxxxxx> -- Regards/Gruss, Boris. https://people.kernel.org/tglx/notes-about-netiquette