Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp108217iob; Tue, 17 May 2022 20:27:23 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzRWCBkEU0XMDDR4vwIo2Fe/2e3arPAjjQVnCaVuxzUtXJBVG6xkG1AkuQfcLs2yXfJbpAE X-Received: by 2002:a05:6a02:105:b0:381:fd01:330f with SMTP id bg5-20020a056a02010500b00381fd01330fmr21594401pgb.483.1652844443751; Tue, 17 May 2022 20:27:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1652844443; cv=none; d=google.com; s=arc-20160816; b=pwy/K6MppNd93lzp76o+PjBRs1UTSaLZsTynjDppjNg2tb/KjWnlKRUbr/uYx6s/+R x9NGvNtCWrU0xMT3o/3T/RU2qdqE5FEwnc0JvpyESESKEcGy8PA1BRwtAfvjF+EwU/w7 VcLGhupNNx0Harysj2kThNV+WzdJXgYnC/gIar9nGL9dyDDZyUdqRAqZlfQ6yccj9O/m 1W8oeHAYRX59SVLhml9dyAaYk13O4NsitsukWpWkSswLuj5BiCBTBV+cuqUg3S4mgokV Tw4WlE4ny5CuFoYeNOvrL3tLssoeiedepHdAj1lHTPeXyQFbsPwHFoXZ9cAoavZ3suG3 nWJg== 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=pvd0q95uJCSzrUcSPspBy/3xWQeyzSLMNTzhkSvL6Qo=; b=PMWql1kAoeEp4ChHtcsbNtZdu/QJ3VRIwxKkHfAeqls6XtsMrQwm1kraUzArmcv7mK taCmzX3j5oQH8zwd5kFGX4xb+xj1svjhLRbUei2/HY0lqrzTOGpivqxURuEiFKwdJyMy 87PyGAHPYiOlLVvHxJZWN/w/HrlDkPdtBGrnx7TgriqpL4mBWIqkGFV7zXhqga38dVq/ mt6gvJqoM0Sm3DOUUALJ777Vex71aa+8kZx5WkF72AwFGFXyNH0WICZqyMtpK4aEbs4a DqLa6vXZGi7B1/Bw7FP4gyKU2mf/XsV13+mSNCuJ87lPpUd35RZo7+CMKNcwKzoR/w/N XHZg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=hjdSHOYJ; 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 l7-20020a654487000000b003c65dfad4afsi1011351pgq.367.2022.05.17.20.27.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 17 May 2022 20:27:23 -0700 (PDT) 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=hjdSHOYJ; 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 6F1A469CFF; Tue, 17 May 2022 20:22:41 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239307AbiEQPfb (ORCPT + 99 others); Tue, 17 May 2022 11:35:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36434 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1350180AbiEQPfF (ORCPT ); Tue, 17 May 2022 11:35:05 -0400 Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A739941624; Tue, 17 May 2022 08:35:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1652801704; x=1684337704; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=Gepnq+G3FqhcuUO0CXCxB2ziSQE4OecO4NsW7OsOcao=; b=hjdSHOYJwsB3F9frZ1fdLFrKxlcmVz65dRswpCv2eHVxJ42y/tUJHNQF 9uT72IC+UVxINY4yl87HHsCTGUJVZhNEINhiQOawYGGgPV0CUL5omogmv GSEmBP/3dbRuPtlfbH+E9W4PtkLGYvEkGHiW4uv2cCVVRsJlXFpL44joj 80bC1yiwVygqkXbCYJ9Cn6TGuTUA1oUG9v2Vr1PRzvHFuUhBalUU1baQV cvrv0qLD358hssmHKR41Yqgre0VCPIEWW+KHCFWc32R7oFcYFPcm3zY0T lmZIUXjrdHTwPz1NQu+OVH0zGUXocZJNqORcRUU2wNw8OknVW+3Bof00O Q==; X-IronPort-AV: E=McAfee;i="6400,9594,10350"; a="271167672" X-IronPort-AV: E=Sophos;i="5.91,233,1647327600"; d="scan'208";a="271167672" Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 17 May 2022 08:34:57 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.91,233,1647327600"; d="scan'208";a="816947559" Received: from black.fi.intel.com ([10.237.72.28]) by fmsmga006.fm.intel.com with ESMTP; 17 May 2022 08:34:50 -0700 Received: by black.fi.intel.com (Postfix, from userid 1000) id 5377A109; Tue, 17 May 2022 18:34:50 +0300 (EEST) From: "Kirill A. Shutemov" To: Borislav Petkov , Andy Lutomirski , Sean Christopherson , Andrew Morton , Joerg Roedel , Ard Biesheuvel Cc: Andi Kleen , Kuppuswamy Sathyanarayanan , David Rientjes , Vlastimil Babka , Tom Lendacky , Thomas Gleixner , Peter Zijlstra , Paolo Bonzini , Ingo Molnar , Varad Gautam , Dario Faggioli , Dave Hansen , Mike Rapoport , David Hildenbrand , marcelo.cerri@canonical.com, tim.gardner@canonical.com, khalid.elmously@canonical.com, philip.cox@canonical.com, x86@kernel.org, linux-mm@kvack.org, linux-coco@lists.linux.dev, linux-efi@vger.kernel.org, linux-kernel@vger.kernel.org, "Kirill A. Shutemov" , Mike Rapoport Subject: [PATCHv6 01/15] x86/boot: Centralize __pa()/__va() definitions Date: Tue, 17 May 2022 18:34:30 +0300 Message-Id: <20220517153444.11195-2-kirill.shutemov@linux.intel.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220517153444.11195-1-kirill.shutemov@linux.intel.com> References: <20220517153444.11195-1-kirill.shutemov@linux.intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.0 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 Replace multiple __pa()/__va() definitions with a single one in misc.h. Signed-off-by: Kirill A. Shutemov Reviewed-by: David Hildenbrand Reviewed-by: Mike Rapoport --- arch/x86/boot/compressed/ident_map_64.c | 8 -------- arch/x86/boot/compressed/misc.h | 9 +++++++++ arch/x86/boot/compressed/sev.c | 2 -- 3 files changed, 9 insertions(+), 10 deletions(-) diff --git a/arch/x86/boot/compressed/ident_map_64.c b/arch/x86/boot/compressed/ident_map_64.c index 44c350d627c7..66a2e992c5f5 100644 --- a/arch/x86/boot/compressed/ident_map_64.c +++ b/arch/x86/boot/compressed/ident_map_64.c @@ -8,14 +8,6 @@ * Copyright (C) 2016 Kees Cook */ -/* - * Since we're dealing with identity mappings, physical and virtual - * addresses are the same, so override these defines which are ultimately - * used by the headers in misc.h. - */ -#define __pa(x) ((unsigned long)(x)) -#define __va(x) ((void *)((unsigned long)(x))) - /* No PAGE_TABLE_ISOLATION support needed either: */ #undef CONFIG_PAGE_TABLE_ISOLATION diff --git a/arch/x86/boot/compressed/misc.h b/arch/x86/boot/compressed/misc.h index 4910bf230d7b..245cf8f2a0bd 100644 --- a/arch/x86/boot/compressed/misc.h +++ b/arch/x86/boot/compressed/misc.h @@ -19,6 +19,15 @@ /* cpu_feature_enabled() cannot be used this early */ #define USE_EARLY_PGTABLE_L5 +/* + * Boot stub deals with identity mappings, physical and virtual addresses are + * the same, so override these defines. + * + * will not define them if they are already defined. + */ +#define __pa(x) ((unsigned long)(x)) +#define __va(x) ((void *)((unsigned long)(x))) + #include #include #include diff --git a/arch/x86/boot/compressed/sev.c b/arch/x86/boot/compressed/sev.c index 52f989f6acc2..730c4677e9db 100644 --- a/arch/x86/boot/compressed/sev.c +++ b/arch/x86/boot/compressed/sev.c @@ -104,9 +104,7 @@ static enum es_result vc_read_mem(struct es_em_ctxt *ctxt, } #undef __init -#undef __pa #define __init -#define __pa(x) ((unsigned long)(x)) #define __BOOT_COMPRESSED -- 2.35.1