From patchwork Fri Jun 16 20:32:22 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: tip-bot2 for Thomas Gleixner X-Patchwork-Id: 109359 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp1600554vqr; Fri, 16 Jun 2023 13:35:57 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5HgfA3MUqdHCJ+2PQmxW3V3fW/EB1zEm8OawjpEDMXKCxYm2YnzyViqVCF0YwJfwJ4gOQe X-Received: by 2002:a17:902:d714:b0:1b5:1590:77fd with SMTP id w20-20020a170902d71400b001b5159077fdmr2240741ply.46.1686947757064; Fri, 16 Jun 2023 13:35:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686947757; cv=none; d=google.com; s=arc-20160816; b=ryKVFQAeklik9MnV0wgqrSFXOPzOrY8qOEWMS9RgAPPX6zbMXjkyX4WQtu9BonJAJW zefiRoK5QwjqYXEReJWdMm95uf4rvnubttFpUA84ibpDvnI7EMYpIoB/gqUa2CrBR6zt HLJiFjwPc6ygG9RahLstdHrQwXlCh+DtkVtaAvUsHvqSrFxV2HvE8Zofa5TbSbhBq7lU 1JEi8OflPQuFtmXWbLFfGdMJlQHcULOIn5Fi9+2oVawlwxeA3zWAn17BXpfcRn+JlEua i66Onr7hCSOA0Dzk9JxU8gsZGC0GR3ypP69swMEqkEpGQpSt1zt0dTR9sDY8R6XpdR2Q dX+Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:robot-unsubscribe :robot-id:message-id:mime-version:cc:subject:to:reply-to:sender:from :dkim-signature:dkim-signature:date; bh=BqamN30uwioVV9z8bqlQUd/bYGXRjuLvuHgCeh9Wjmg=; b=xwgj4mR1G2630wYukU6OGwGgxWVrzHO1FGgtcMteqoh2537jMKjBjJImI/YT0QKTbm bzKfphHiud6cm2dN9duCPMCS9iQbjy/lAx4fsLrtkI8BccTrWbSiWaAUrqxnKkTFdQD7 jpSH6OyRwz8GaDBD4aRSbhIZ0EfjGA/Tg9fZC6ntVobT+sVyBq76yHKwZMlaH0oLUFiv MSyYVZt61DqtFyqNl0eaNlvSwQjQAYG+fHKUz479ccq0JRjEhFTxVAycOSXjH8jA1noH /uP1PglN34FYWevhtSCzW7YwzDlrnMKK+ArZRdSI4taUdj8ZJ3di82EIjADaaX5XjNBF Unwg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b="IyQDwPs/"; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b=QaDl2b13; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id l6-20020a170902f68600b001a94f85b0besi2719523plg.406.2023.06.16.13.35.44; Fri, 16 Jun 2023 13:35:57 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b="IyQDwPs/"; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b=QaDl2b13; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231403AbjFPUc1 (ORCPT + 99 others); Fri, 16 Jun 2023 16:32:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54864 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229938AbjFPUc0 (ORCPT ); Fri, 16 Jun 2023 16:32:26 -0400 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 31D3F3A91; Fri, 16 Jun 2023 13:32:25 -0700 (PDT) Date: Fri, 16 Jun 2023 20:32:22 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1686947543; 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; bh=BqamN30uwioVV9z8bqlQUd/bYGXRjuLvuHgCeh9Wjmg=; b=IyQDwPs/kz5HH35ns2xrQPYA3CiHmBcnLmCM2r/LCT86yc/OQQViC3DktI1fvjTpGfV356 LNhYKrxxNwl1CBABNlKzxP+RS0tskznyQ75pxj6RI1WxFqeX7Q5DNJiMQn5U/5ccMDXPme SsnncOoKK1g1Q+f975i68zBmnDdVmdgjCiYCgIDI4QLq0M2ULl/2dkm4dSShEqrhvZcrKA TjNsCbIWr9J4rjPoGIvjdGHSlP/zfpvOQapY7n92RgRCEWxKbF8g1YI/syiWj1TV3QhvU+ R8Rqsi1+9+wxZi7wZZ3Mea0nlDgMp+669tuAPU5BUo+VVl3lIQfxfFFrD+YS3A== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1686947543; 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; bh=BqamN30uwioVV9z8bqlQUd/bYGXRjuLvuHgCeh9Wjmg=; b=QaDl2b13pXjmTE57VQ/vFnQICyRQJaP23kXX/pTMPYES/JzPS6XkYuS4JOAIjVlVztFIus tCHsa4yQmMCOE7DQ== From: "tip-bot2 for Thomas Gleixner" Sender: tip-bot2@linutronix.de Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: x86/boot] x86/mem_encrypt: Unbreak the AMD_MEM_ENCRYPT=n build Cc: kernel test robot , Thomas Gleixner , x86@kernel.org, linux-kernel@vger.kernel.org MIME-Version: 1.0 Message-ID: <168694754244.404.18209616336431541908.tip-bot2@tip-bot2> Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1768892931048796557?= X-GMAIL-MSGID: =?utf-8?q?1768892931048796557?= The following commit has been merged into the x86/boot branch of tip: Commit-ID: 0a9567ac5e6a40cdd9c8cd15b19a62a15250f450 Gitweb: https://git.kernel.org/tip/0a9567ac5e6a40cdd9c8cd15b19a62a15250f450 Author: Thomas Gleixner AuthorDate: Fri, 16 Jun 2023 22:15:31 +02:00 Committer: Thomas Gleixner CommitterDate: Fri, 16 Jun 2023 22:23:27 +02:00 x86/mem_encrypt: Unbreak the AMD_MEM_ENCRYPT=n build Moving mem_encrypt_init() broke the AMD_MEM_ENCRYPT=n because the declaration of that function was under #ifdef CONFIG_AMD_MEM_ENCRYPT and the obvious placement for the inline stub was the #else path. This is a leftover of commit 20f07a044a76 ("x86/sev: Move common memory encryption code to mem_encrypt.c") which made mem_encrypt_init() depend on X86_MEM_ENCRYPT without moving the prototype. That did not fail back then because there was no stub inline as the core init code had a weak function. Move both the declaration and the stub out of the CONFIG_AMD_MEM_ENCRYPT section and guard it with CONFIG_X86_MEM_ENCRYPT. Fixes: 439e17576eb4 ("init, x86: Move mem_encrypt_init() into arch_cpu_finalize_init()") Reported-by: kernel test robot Signed-off-by: Thomas Gleixner Closes: https://lore.kernel.org/oe-kbuild-all/202306170247.eQtCJPE8-lkp@intel.com/ --- arch/x86/include/asm/mem_encrypt.h | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/arch/x86/include/asm/mem_encrypt.h b/arch/x86/include/asm/mem_encrypt.h index 98ce265..7f97a8a 100644 --- a/arch/x86/include/asm/mem_encrypt.h +++ b/arch/x86/include/asm/mem_encrypt.h @@ -17,6 +17,12 @@ #include +#ifdef CONFIG_X86_MEM_ENCRYPT +void __init mem_encrypt_init(void); +#else +static inline void mem_encrypt_init(void) { } +#endif + #ifdef CONFIG_AMD_MEM_ENCRYPT extern u64 sme_me_mask; @@ -51,8 +57,6 @@ void __init mem_encrypt_free_decrypted_mem(void); void __init sev_es_init_vc_handling(void); -void __init mem_encrypt_init(void); - #define __bss_decrypted __section(".bss..decrypted") #else /* !CONFIG_AMD_MEM_ENCRYPT */ @@ -85,8 +89,6 @@ early_set_mem_enc_dec_hypercall(unsigned long vaddr, int npages, bool enc) {} static inline void mem_encrypt_free_decrypted_mem(void) { } -static inline void mem_encrypt_init(void) { } - #define __bss_decrypted #endif /* CONFIG_AMD_MEM_ENCRYPT */