lkml.org 
[lkml]   [2024]   [Feb]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 3/4] x86/kexec(): Reset TDX private memory on platforms with TDX erratum
On Wed, Jan 31, 2024 at 01:21:39PM -0800, Dave Hansen wrote:
> > #ifdef CONFIG_KEXEC_JUMP
> > if (image->preserve_context)
> > save_processor_state();
> > + else
> > + tdx_reset_memory();
> > +#else
> > + tdx_reset_memory();
> > #endif
>
> Wow, that's awfully hard to read. I really wish folks' gag reflex would
> kick in when they see stuff like this to get them to spend an additional
> 15 seconds to turn this into:
>
> if (IS_ENABLED(CONFIG_KEXEC_JUMP) && image->preserve_context)
> save_processor_state();
> else
> tdx_reset_memory();

save_processor_state() is declared under CONFIG_PM_SLEEP, so I guess your
variant might break build in some cases without updated suspend.h.
--
Kiryl Shutsemau / Kirill A. Shutemov

\
 
 \ /
  Last update: 2024-05-27 14:43    [W:0.096 / U:3.052 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site