diff options
author | 2021-10-26 15:00:48 -0700 | |
---|---|---|
committer | 2021-11-15 11:13:16 -0800 | |
commit | 03b122da74b22fbe7cd98184fa5657a9ce13970c (patch) | |
tree | 8facf7bfc6961ff9dfd924ac0d17da0ab4a277a7 /include/linux/mm.h | |
parent | x86/sgx: Add SGX infrastructure to recover from poison (diff) | |
download | linux-03b122da74b22fbe7cd98184fa5657a9ce13970c.tar.gz linux-03b122da74b22fbe7cd98184fa5657a9ce13970c.tar.bz2 linux-03b122da74b22fbe7cd98184fa5657a9ce13970c.zip |
x86/sgx: Hook arch_memory_failure() into mainline code
Add a call inside memory_failure() to call the arch specific code
to check if the address is an SGX EPC page and handle it.
Note the SGX EPC pages do not have a "struct page" entry, so the hook
goes in at the same point as the device mapping hook.
Pull the call to acquire the mutex earlier so the SGX errors are also
protected.
Make set_mce_nospec() skip SGX pages when trying to adjust
the 1:1 map.
Signed-off-by: Tony Luck <tony.luck@intel.com>
Signed-off-by: Dave Hansen <dave.hansen@linux.intel.com>
Reviewed-by: Jarkko Sakkinen <jarkko@kernel.org>
Reviewed-by: Naoya Horiguchi <naoya.horiguchi@nec.com>
Tested-by: Reinette Chatre <reinette.chatre@intel.com>
Link: https://lkml.kernel.org/r/20211026220050.697075-6-tony.luck@intel.com
Diffstat (limited to 'include/linux/mm.h')
-rw-r--r-- | include/linux/mm.h | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/include/linux/mm.h b/include/linux/mm.h index a7e4a9e7d807..57f1aa2a33b6 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h @@ -3231,6 +3231,19 @@ extern void shake_page(struct page *p); extern atomic_long_t num_poisoned_pages __read_mostly; extern int soft_offline_page(unsigned long pfn, int flags); +#ifndef arch_memory_failure +static inline int arch_memory_failure(unsigned long pfn, int flags) +{ + return -ENXIO; +} +#endif + +#ifndef arch_is_platform_page +static inline bool arch_is_platform_page(u64 paddr) +{ + return false; +} +#endif /* * Error handlers for various types of pages. |