[PATCHv11 11/19] x86/tdx: Convert shared memory back to private on kexec
Dave Hansen
dave.hansen at intel.com
Wed Jun 5 09:05:05 PDT 2024
On 6/5/24 05:43, Kirill A. Shutemov wrote:
> Okay fair enough. Check out the fixup below. Is it what you mean?
Yes. Much better.
> One other thing I realized is that these callback are dead code if kernel
> compiled without kexec support. Do we want them to be wrapped with
> #ifdef COFNIG_KEXEC_CORE everywhere? It is going to be ugly.
>
> Any better ideas?
The other callbacks don't have #ifdefs either and they're dependent on
memory encryption as far as I can tell.
I think a simple:
if (IS_ENABLED(COFNIG_KEXEC_CORE))
return;
in the top of the callbacks will result in a tiny little stub function
when kexec is disabled. So the bloat will be limited to kernels that
have TDX compiled in but kexec compiled out (probably never). The bloat
will be two callback pointer, one tiny stub function, and a quick
call/return in a slow path.
I think that probably ends up being a few dozen bytes of bloat in kernel
text for a "probably never" config.
More information about the kexec
mailing list