lkml.org 
[lkml]   [2024]   [Apr]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v3 01/14] x86/sev: Rename snp_init() in the boot/compressed/sev.c file
On 4/9/24 12:09, Borislav Petkov wrote:
> On Mon, Mar 25, 2024 at 05:26:20PM -0500, Tom Lendacky wrote:
>> The snp_init() in boot/compressed/sev.c is local to that file and is not
>> called from outside of the file. Change the name so that it is not tied
>> to the function definition in arch/x86/include/asm/sev.h.
>
> That part I don't understand: I can rename the function without making
> it static and it builds fine, so where is it "tied" to the function
> definition in kernel proper?

When it's not static and has the name snp_init(), then it has to match
the definition in arch/x86/include/asm/sev.h, which is really intended
for the snp_init() in arch/x86/kernel/sev.c when called from
arch/x86/mm/mem_encrypt_identity.c.

So, yes, changing the name would be enough except then it remains not a
static and you can get a compiler warning about not having a prototype
for it if the -Wmissing-prototypes option is ever applied to that file
(I don't believe it is today because it is in the decompressor code, but
that can change). And since nothing calls the snp_init() in
arch/x86/boot/compressed/sev.c from outside of that file, making it
static was appropriate.

Thanks,
Tom

>
> Don't get me wrong - leaking kernel proper symbols into the decompressor
> has been a pet peeve of mine for a while now but this is not the case
> here, is it?
>
> And yes, the patch is fine - I'm just asking...
>
> Thx.
>

\
 
 \ /
  Last update: 2024-04-09 19:44    [W:0.141 / U:0.144 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site