From mboxrd@z Thu Jan 1 00:00:00 1970 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 7947DC433F5 for ; Thu, 24 Feb 2022 15:56:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236733AbiBXP5O (ORCPT ); Thu, 24 Feb 2022 10:57:14 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41960 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236720AbiBXP4z (ORCPT ); Thu, 24 Feb 2022 10:56:55 -0500 Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B251C254544 for ; Thu, 24 Feb 2022 07:56:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1645718184; x=1677254184; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=o7VDf0nJv0XlRbUzs4IaCYJuN/W3ueBazitrj9bCGEQ=; b=Liwmh+CzWUlYNhtmog678dN2iuYjPW9ovD6aW1AD/SWF3wB7AWVUlwBq TYR8DmOfCs2oCNRgwXrEEvp1aC3Pyo2Gve9+hFz5IYzXaVs/Kq/B+8yO5 E+ysIXAgH1l1Exzd8auMCHUbhjDjXOqyXMOTFGlfNqYMXcYah8FifeX37 4RZwxKuGaKdcB73UcgqC5lxZytUItxnwkp09/8uxBZod9pZwOh28bRCH/ zSoYRCdv2MSrvBHPp1kH0X30mz/1nh0YUtOvt0/sjW2vp3ncOgkIaPOVC 4X8jGYQ0L6wDYIUfUzBNbbbpfOQzaLLNXeLzVr9oqW4+QU/cpb5h5tNTN w==; X-IronPort-AV: E=McAfee;i="6200,9189,10268"; a="252186709" X-IronPort-AV: E=Sophos;i="5.90,134,1643702400"; d="scan'208";a="252186709" Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 24 Feb 2022 07:56:24 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.90,134,1643702400"; d="scan'208";a="574253915" Received: from black.fi.intel.com ([10.237.72.28]) by orsmga001.jf.intel.com with ESMTP; 24 Feb 2022 07:56:17 -0800 Received: by black.fi.intel.com (Postfix, from userid 1000) id 3A30993; Thu, 24 Feb 2022 17:56:34 +0200 (EET) From: "Kirill A. Shutemov" To: tglx@linutronix.de, mingo@redhat.com, bp@alien8.de, dave.hansen@intel.com, luto@kernel.org, peterz@infradead.org Cc: sathyanarayanan.kuppuswamy@linux.intel.com, aarcange@redhat.com, ak@linux.intel.com, dan.j.williams@intel.com, david@redhat.com, hpa@zytor.com, jgross@suse.com, jmattson@google.com, joro@8bytes.org, jpoimboe@redhat.com, knsathya@kernel.org, pbonzini@redhat.com, sdeep@vmware.com, seanjc@google.com, tony.luck@intel.com, vkuznets@redhat.com, wanpengli@tencent.com, thomas.lendacky@amd.com, brijesh.singh@amd.com, x86@kernel.org, linux-kernel@vger.kernel.org, "Kirill A. Shutemov" , David Rientjes Subject: [PATCHv4 01/30] x86/mm: Fix warning on build with X86_MEM_ENCRYPT=y Date: Thu, 24 Feb 2022 18:56:01 +0300 Message-Id: <20220224155630.52734-2-kirill.shutemov@linux.intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220224155630.52734-1-kirill.shutemov@linux.intel.com> References: <20220224155630.52734-1-kirill.shutemov@linux.intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org So far, AMD_MEM_ENCRYPT is the only user of X86_MEM_ENCRYPT. TDX will be the second. It will make mem_encrypt.c build without AMD_MEM_ENCRYPT, which triggers a warning: arch/x86/mm/mem_encrypt.c:69:13: warning: no previous prototype for function 'mem_encrypt_init' [-Wmissing-prototypes] Fix it by moving mem_encrypt_init() declaration outside of #ifdef CONFIG_AMD_MEM_ENCRYPT. Signed-off-by: Kirill A. Shutemov Fixes: 20f07a044a76 ("x86/sev: Move common memory encryption code to mem_encrypt.c") Acked-by: David Rientjes --- arch/x86/include/asm/mem_encrypt.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/arch/x86/include/asm/mem_encrypt.h b/arch/x86/include/asm/mem_encrypt.h index e2c6f433ed10..88ceaf3648b3 100644 --- a/arch/x86/include/asm/mem_encrypt.h +++ b/arch/x86/include/asm/mem_encrypt.h @@ -49,9 +49,6 @@ void __init early_set_mem_enc_dec_hypercall(unsigned long vaddr, int npages, void __init mem_encrypt_free_decrypted_mem(void); -/* Architecture __weak replacement functions */ -void __init mem_encrypt_init(void); - void __init sev_es_init_vc_handling(void); #define __bss_decrypted __section(".bss..decrypted") @@ -89,6 +86,9 @@ static inline void mem_encrypt_free_decrypted_mem(void) { } #endif /* CONFIG_AMD_MEM_ENCRYPT */ +/* Architecture __weak replacement functions */ +void __init mem_encrypt_init(void); + /* * The __sme_pa() and __sme_pa_nodebug() macros are meant for use when * writing to or comparing values from the cr3 register. Having the -- 2.34.1