X-Received: by 2002:a17:90a:e50c:b0:1bc:ae25:3b5c with SMTP id t12-20020a17090ae50c00b001bcae253b5cmr6914129pjy.173.1645720927374; Thu, 24 Feb 2022 08:42:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1645720927; cv=none; d=google.com; s=arc-20160816; b=DVSOgLZaRYjkZMptAnMzNecjlkn8h95J6hJf2y/VVXq2uc/f+v/BfjqP69wz+Uxw+B OwKTh0t84SStUWIDNHGRyc9seDG3SI2baXY+k13imNt9+1sSlrGlx3Mem/uPttwXDZqa A/nYmJ/DJhM/Civ0hMjmUqtweTCMM6T4ghn9PZChU0ivx9MwuBglkLCogVzsYIDhyO9C g/cMmfMpn5knXnRD43BBziM/VxFIxL9hsLSigx2C8Com8cVXkxGnGGfs+gPXYOfFzkmT ybHwIlI5H7rzBZIMZhGsHdLADckNLsrorWYI8eULyfRVtXoRXYVhBXu1k+lQ6Xl60sCK Yxdg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=xQz0VfZW4d9knEj1/8LWY43uT1KqNNBY+zr2K5qyQnA=; b=ln0qUFGGyNBN61Ts1OzMVpgSzjVSUDH3JiOT9Lgalcta2UZfT78cZyDF5I43xxKAmt Ra0nB+3RLaift2zmQGtvFvnbEbMrm1oPSJvUUqYmpzn677DqHj9/iuXNIbAbrFTaPeDq 1kO+c1LGxsFStuiBR7xBB5cR9q8/ZT1ft5ycAQTWHLvnpl54GUzYN/TtDkbOm02uyi5g w//B2WCKAwsWBf81OmCBR1yNpAZlqS3VLoKdrg5ewpIVd1KFzo1DbT+vl0Iu/rRC/9kF HLNKTqHPzbPOyw99u9FfDqslCvhFlL91JJIbVxHfD8WnzEY3RMVRIT6e5BbRmB3XT4/o JI5A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=Liwmh+Cz; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id k7si2867246plg.487.2022.02.24.08.42.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 24 Feb 2022 08:42:07 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=Liwmh+Cz; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from out1.vger.email (out1.vger.email [IPv6:2620:137:e000::1:20]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id E1CF41F76B9; Thu, 24 Feb 2022 08:21:59 -0800 (PST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236730AbiBXP5N (ORCPT + 99 others); Thu, 24 Feb 2022 10:57:13 -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 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no 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 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