Re: [PATCH] x86/sgx: Skip EPC initialization in the kdump kernel

From: Dave Hansen

Date: Wed Nov 11 2026 - 10:27:46 EST


On 11/11/26 04:39, Yuanhe Shu wrote:
> + /* The kdump kernel has no use for SGX. Skip it. */
> + if (is_kdump_kernel())
> + return -ENODEV;

I'd much rather this be inverted: have the kdump code maintain a list of
things it needs to turn off rather than sprinkle is_kdump_kernel()
around any further.

I'd suggest a small bit of kdump specific code that does:

setup_clear_cpu_cap(X86_FEATURE_SGX);

It'll need to be in x86 code or under an x86 #ifdef.