Re: [PATCH 2/2] x86/sme: Mark the code as __head in mem_encrypt_identity.c

From: Ingo Molnar
Date: Wed Oct 18 2023 - 06:22:33 EST



* Thomas Gleixner <tglx@xxxxxxxxxxxxx> wrote:

> On Tue, Oct 17 2023 at 14:52, Ingo Molnar wrote:
> > * Hou Wenlong <houwenlong.hwl@xxxxxxxxxxxx> wrote:
> >> -static inline void __init sme_encrypt_kernel(struct boot_params *bp) { }
> >> -static inline void __init sme_enable(struct boot_params *bp) { }
> >> +static inline void sme_encrypt_kernel(struct boot_params *bp) { }
> >> +static inline void sme_enable(struct boot_params *bp) { }
> >
> > So I think we should preserve the previous convention of marking functions
> > __init in the header-declaration and at the definition site as well, and do
> > the same with __head as well?
>
> I'm not convinced about the value of prototype annotations, but have no
> strong preference either.

So it has some minor documentation purpose: when someone looks up a
function via the header only (I do that frequently), __init-alike
annotations really show the intended boot-only limitations of the API.

But that's a really minor Nth order benefit, I have no strong preference
either.

Thanks,

Ingo