> Inspired by commit c6acb1e7bf46 (x86/sgx: Add hook to error injection > address validation), add a similar code in hwpoison_inject function to > check if the address is located in SGX Memory. The error will then be > handled by the arch_memory_failure function in the SGX driver. Looks good to me. [I wish that Linux hadn't called this "hwpoison_inject()" because there's nothing hardware related about this injection. But you are just an innocent consumer of that poor naming choice] Reviewed-by: Tony Luck <tony.luck@xxxxxxxxx> -Tony