From patchwork Thu Apr 6 20:48:33 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: 80536 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp1310951vqo; Thu, 6 Apr 2023 14:27:42 -0700 (PDT) X-Google-Smtp-Source: AKy350Zrlcm+sWA6Hq8at8OHy+ok+S9km+dz5/eXE+zafIe7xkIIEihhaHqIDHKOeeblFV2cRs24 X-Received: by 2002:a17:90a:bb89:b0:244:8a1c:8054 with SMTP id v9-20020a17090abb8900b002448a1c8054mr45766pjr.10.1680816462298; Thu, 06 Apr 2023 14:27:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680816462; cv=none; d=google.com; s=arc-20160816; b=Vt1vmIui0HS8i0VFdRpw7Mjj4eSqAtPXYSHrxxKquj/Vhk9c7vre742tsXNpsdz21T 33ufwHgX1m2o0GZOHSpfWK9EvyD764CmTK4Bs+GFi2xT4q04I/L31BHPpBTSljKRCJcr B47V74Jljk9vSGMB+IvZuGoOO/pK35BAKANxVRmRQbpSvVUAjeM59IzpGnXpbhUUshii O9NzjbKsv2kb3gb8mUdlKhw7w5hKKiePYTfw8w90N/x6OFEMyOyeYYoAHK3++AkAa06U LROVgoY8lhX1msLXve9thk5tj5Xi6p/9KNTbBUm4U0Apquj5HgfMU0sz4101Wi/yhKte D0rA== 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=fbL2+aKE7uWxGvp96AkCTTIcstJSjZVPvRpLsq3o3LI=; b=YwwMsl8AUEBgW1YmAqLz+/CASPUrYbilD5ziJwibRPFj19ENu5Rsa9RCh41qu2OPxX SCGfjbfYex4Lle14DQ+SdJXQ7iGmqL5vJEz73qH4hjhdXAubF5hp46zOhHecqcm9BqhD igKKxFwNnScNVYdTNTfJKFnZ/0oQhWan66P4wE31viD2cNKJwbtFpYq7LWqjrbmaVpo+ 2ad/mraHgHKFXuLpiFh55oeLkvQIszZPgQnDQnguXviIdTUOXF9GgF9N73HrmS00LMr3 OthtLsLblebMVQYKNUJj0O1IKFLq6gwLJqpB7R8Ma80Vep9cr9r/7A0q8SSresgN0nPY woQQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=1GiO0WK8; dkim=neutral (no key) header.i=@linutronix.de header.b=vxFNZhFf; 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 h21-20020a17090aa89500b00236405d76basi1523148pjq.72.2023.04.06.14.27.30; Thu, 06 Apr 2023 14:27:42 -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=1GiO0WK8; dkim=neutral (no key) header.i=@linutronix.de header.b=vxFNZhFf; 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 S240640AbjDFUts (ORCPT + 99 others); Thu, 6 Apr 2023 16:49:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45620 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239649AbjDFUtS (ORCPT ); Thu, 6 Apr 2023 16:49:18 -0400 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 633EF9768; Thu, 6 Apr 2023 13:48:35 -0700 (PDT) Date: Thu, 06 Apr 2023 20:48:33 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1680814114; 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=fbL2+aKE7uWxGvp96AkCTTIcstJSjZVPvRpLsq3o3LI=; b=1GiO0WK8UY95oCMJ4h6lyJbyCu3JyOcFZ/ymaaWAoSlXeAgkPsz9H6UYQDtgtu2doMkAYj OA7Yg+SJwlNf0Pe6sjuuSSDJUqMb6G43kFsg2+ZD3V25cjICioqv2qKO4Mtc5JRor3N77v tLtJxsTaWDscWLeI74CdU3BtiAYvwR7IOmWUCu7V50VuhRkIgp0yqHDs2mbb1kMrmm8Mv5 kPYiZPIF+9OkC777e0SzHx/DQPuMpFZQbYt9J2XT7hieQXoYx5BM2PSwyawOg0QEoU3kgQ xfHu7ls0PFCbL0ML756dAqKrCesuCB6eLC7PkQIDEi9rJpR8rQI96WnFFbg6Zg== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1680814114; 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=fbL2+aKE7uWxGvp96AkCTTIcstJSjZVPvRpLsq3o3LI=; b=vxFNZhFfxknS1vNGn4gu6R7xC8aGhqUPL6TuOKomX8ukxH37XLEkcw3gS9NhwgYFZygHRD jqXaKPDMexuklaBw== From: "tip-bot2 for Kirill A. Shutemov" Sender: tip-bot2@linutronix.de Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: x86/cleanups] x86/boot: Centralize __pa()/__va() definitions Cc: "Kirill A. Shutemov" , Dave Hansen , David Hildenbrand , Mike Rapoport , x86@kernel.org, linux-kernel@vger.kernel.org MIME-Version: 1.0 Message-ID: <168081411330.404.15815077102640119254.tip-bot2@tip-bot2> Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails X-Spam-Status: No, score=-2.5 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE,SPF_PASS autolearn=unavailable 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?1762463802278212033?= X-GMAIL-MSGID: =?utf-8?q?1762463802278212033?= The following commit has been merged into the x86/cleanups branch of tip: Commit-ID: 5462ade6871e96646502cc95e7e05f0ab4fc84de Gitweb: https://git.kernel.org/tip/5462ade6871e96646502cc95e7e05f0ab4fc84de Author: Kirill A. Shutemov AuthorDate: Thu, 30 Mar 2023 14:49:43 +03:00 Committer: Dave Hansen CommitterDate: Tue, 04 Apr 2023 13:42:37 -07:00 x86/boot: Centralize __pa()/__va() definitions Replace multiple __pa()/__va() definitions with a single one in misc.h. Signed-off-by: Kirill A. Shutemov Signed-off-by: Dave Hansen Reviewed-by: David Hildenbrand Reviewed-by: Mike Rapoport Reviewed-by: Dave Hansen Link: https://lore.kernel.org/all/20230330114956.20342-2-kirill.shutemov%40linux.intel.com --- 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 321a501..bcc956c 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 20118fb..2f155a0 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 d63ad8f..014b89c 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