From nobody Sun May 10 18:33:38 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 72F7FC433F5 for ; Wed, 27 Apr 2022 11:56:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233303AbiD0L7u (ORCPT ); Wed, 27 Apr 2022 07:59:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49260 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233310AbiD0L7k (ORCPT ); Wed, 27 Apr 2022 07:59:40 -0400 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0B6143121D; Wed, 27 Apr 2022 04:56:26 -0700 (PDT) Date: Wed, 27 Apr 2022 11:56:23 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1651060585; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=IddAXshVgMNCP9JFdlFoYWmAbyPtf8OxhZZPaT9sJqY=; b=VWlcUPX7w/PFnRIgMOUt5f0eN/V4zjIULMcIWwxSKzqf3YmevyMGxvO0s7F8c3Fltvslqc DHmB3nXOoeE/Xgq+o+x4zYH7hm2q4Mfr6XoCs936JNv77GV7v6vJD+AAU6aXlo5C9faoOv zmdeVUAR1UbztJDC0dux66hTdKYm2yryKEnJ8l8vEsVRVZE5AQdc7RixW+3OhZoAzdg63Z subp0XWECrAgT9G2X2qybcHMg8VYurHEPfPnczz8O6zlz+8exWu+gZQfW5xF0kOMdMfuXm OtF0xjKIGqnQBPUtnxOwCToH8X2fNqD8WKrp/081fJKmrxGRG7q6iD5D8XnVuw== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1651060585; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=IddAXshVgMNCP9JFdlFoYWmAbyPtf8OxhZZPaT9sJqY=; b=K9vZEZD98KBotYE3nv3RM5LMNwOf1T4DVAwe0hi6yOECxtPwlPuosnJyISA4yJz+FaxHLf FlogdWxYCB1OU4AA== From: "tip-bot2 for Michael Roth" Sender: tip-bot2@linutronix.de Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: x86/sev] x86/sev: Add missing __init annotations to SEV init routines Cc: Borislav Petkov , Michael Roth , x86@kernel.org, linux-kernel@vger.kernel.org In-Reply-To: <20220422135624.114172-2-michael.roth@amd.com> References: <20220422135624.114172-2-michael.roth@amd.com> MIME-Version: 1.0 Message-ID: <165106058382.4207.3592489487323661828.tip-bot2@tip-bot2> Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The following commit has been merged into the x86/sev branch of tip: Commit-ID: 75d359ec4141b013727022a663762931f69e6510 Gitweb: https://git.kernel.org/tip/75d359ec4141b013727022a663762931f= 69e6510 Author: Michael Roth AuthorDate: Fri, 22 Apr 2022 08:56:23 -05:00 Committer: Borislav Petkov CommitterDate: Wed, 27 Apr 2022 13:31:36 +02:00 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 Signed-off-by: Michael Roth Signed-off-by: Borislav Petkov Link: https://lore.kernel.org/r/20220422135624.114172-2-michael.roth@amd.com --- arch/x86/kernel/sev.c | 6 +++--- arch/x86/realmode/init.c | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/arch/x86/kernel/sev.c b/arch/x86/kernel/sev.c index 2fa87a0..b7fd191 100644 --- a/arch/x86/kernel/sev.c +++ b/arch/x86/kernel/sev.c @@ -558,7 +558,7 @@ void noinstr __sev_es_nmi_complete(void) __sev_put_ghcb(&state); } =20 -static u64 get_jump_table_addr(void) +static u64 __init get_jump_table_addr(void) { struct ghcb_state state; unsigned long flags; @@ -1077,7 +1077,7 @@ void snp_set_wakeup_secondary_cpu(void) apic->wakeup_secondary_cpu =3D wakeup_cpu_via_vmgexit; } =20 -int sev_es_setup_ap_jump_table(struct real_mode_header *rmh) +int __init sev_es_setup_ap_jump_table(struct real_mode_header *rmh) { u16 startup_cs, startup_ip; phys_addr_t jump_table_pa; @@ -2171,7 +2171,7 @@ static struct platform_device sev_guest_device =3D { .id =3D -1, }; =20 -static u64 get_secrets_page(void) +static u64 __init get_secrets_page(void) { u64 pa_data =3D boot_params.cc_blob_address; struct cc_blob_sev_info info; diff --git a/arch/x86/realmode/init.c b/arch/x86/realmode/init.c index c5e29db..41d7669 100644 --- a/arch/x86/realmode/init.c +++ b/arch/x86/realmode/init.c @@ -67,7 +67,7 @@ void __init reserve_real_mode(void) memblock_reserve(0, SZ_1M); } =20 -static void sme_sev_setup_real_mode(struct trampoline_header *th) +static void __init sme_sev_setup_real_mode(struct trampoline_header *th) { #ifdef CONFIG_AMD_MEM_ENCRYPT if (cc_platform_has(CC_ATTR_HOST_MEM_ENCRYPT))