]> git.baikalelectronics.ru Git - kernel.git/commit
x86/sev: Add missing __init annotations to SEV init routines
authorMichael Roth <michael.roth@amd.com>
Fri, 22 Apr 2022 13:56:23 +0000 (08:56 -0500)
committerBorislav Petkov <bp@suse.de>
Wed, 27 Apr 2022 11:31:36 +0000 (13:31 +0200)
commit4fbaaa9d736ae4bb11956178854fdc7e202c3177
treeb2c730fb8fc71c3d985c548ab1b3a1bdc83ad3e6
parent5c88d0a356278e1223b67b1802622e7b83a5fbe7
x86/sev: Add missing __init annotations to SEV init routines

Currently, get_secrets_page() is only reachable from the following call
chain:

  __init snp_init_platform_device():
    get_secrets_page()

so mark it as __init as well. This is also needed since it calls
early_memremap(), which is also an __init routine.

Similarly, get_jump_table_addr() is only reachable from the following
call chain:

  __init setup_real_mode():
    sme_sev_setup_real_mode():
      sev_es_setup_ap_jump_table():
        get_jump_table_addr()

so mark get_jump_table_addr() and everything up that call chain as
__init as well. This is also needed since future patches will add a
call to get_secrets_page(), which needs to be __init due to the reasons
stated above.

Suggested-by: Borislav Petkov <bp@suse.de>
Signed-off-by: Michael Roth <michael.roth@amd.com>
Signed-off-by: Borislav Petkov <bp@suse.de>
Link: https://lore.kernel.org/r/20220422135624.114172-2-michael.roth@amd.com
arch/x86/kernel/sev.c
arch/x86/realmode/init.c