RE: [PATCH v4 5/6] x86/sgx: Hook sgx_memory_failure() into mainline code

From: Luck, Tony
Date: Tue Sep 07 2021 - 20:59:16 EST


> I'm going to explore Dave's suggestion of changing the names to something less sgx specific.

So now I have the two functions renamed to

arch_memory_failure() and arch_is_platform_page()

in arch/x86/kernel/cpu/sgx/main.c

In arch/x86/include/asm/processor.h

+#ifdef CONFIG_X86_SGX
+int arch_memory_failure(unsigned long pfn, int flags);
+#define arch_memory_failure arch_memory_failure
+
+bool arch_is_platform_page(u64 paddr);
+#define arch_is_platform_page arch_is_platform_page
+#endif

and in include/linux/mm.h

+#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

Dave: Is that what you wanted? If so I can fold these bits back into the
appropriate bits of the series. Address other comments. and post v5.

Sean: If you have stuff that needs attention in v4 please holler soon.

-Tony