Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp2353938pxb; Mon, 20 Sep 2021 19:52:52 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwB1A4HeffZUxNxw80cdd9lD2YMBDcoXPmaxOMDAUb4UyDk1MZ3Tgjcy9TuM+KooVGwPQjz X-Received: by 2002:aa7:cb92:: with SMTP id r18mr33096183edt.282.1632192772163; Mon, 20 Sep 2021 19:52:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1632192772; cv=none; d=google.com; s=arc-20160816; b=q6T0WAkYG/JN7HxHHOGC/Ko8b5KMnYh6EOp9izyZG1+1aKAyyEwdc/L8h20N8U1Ijb U4MoM0c3Up15mDthv9Plft+MB2mDC6HoYZMi1SYClJwzaaPSJHpfUJDbv0WvM8OL+FQ0 uMKZr4pgmU59lDokLoTznhuFiQngN6gk15ghrDUx3xKMeHGVirqlvQ6+TV7jlSaShs2x xNHg7Ewi1gsg9A/aXnDxnhuNpND0ye2qjuit1/moge1OHAhAc2wE2aVm6Qo6q5+6yU5H nP8J0T8OnXFJyTMz+FEg3pRFrcAFF1K3DLE+SGv5UbjyYLB/74qnQ3Xb7+T2fctw8bNQ tOXw== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=ZnWoTxxyFIifnC81KQynJmkLZzodECNnweE0zfECcjg=; b=UxBBfwVLmqgJOmU9oVjvlZ1MJSmGwxw5wLb4gIydVrDrh0VnLuEzIOd+hjDQ1SjOZv QqW9FoKcg5cxq772Veq7LcaAbipaESD+bv14sPxfiPlDOwMMM+yE9bMZlBhtAQoHGgUR uPZmwRHEO+bSBfnBLT1k+LYAp6EAx8qVuawPJxGT03ArILG3QBaGzCvj0DsfbtUaY17t JaNxsc8qWo7rOhmmHJNFTn2575zbRIPqRG5Nu7z8JPk6SXbcRYtTaRl94NzeW388gPxv hufGRYKO5yFVhe3O/XFJqOl54GbCKF/5X2SsJXn3SaKAS1sfC0zFlTayUisGzwmrZyIU +Enw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=SRM2GW7W; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id s4si6214552eds.584.2021.09.20.19.52.28; Mon, 20 Sep 2021 19:52:52 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=SRM2GW7W; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1384944AbhITStW (ORCPT + 99 others); Mon, 20 Sep 2021 14:49:22 -0400 Received: from mail.kernel.org ([198.145.29.99]:33544 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1384096AbhITSqc (ORCPT ); Mon, 20 Sep 2021 14:46:32 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id B6D2263361; Mon, 20 Sep 2021 17:33:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1632159220; bh=walABZlX11JaDQYOkSKG4JpsE8wTH7I7GPEVcS8ooGA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=SRM2GW7WVLz/mRmsipx2Wue5RhJgwXA+hzCU62ENSdJVimFnLVSPWt9msTCGyCIgY CzerZLL5YF9tILmxkUWfkMYfUNeeeBDfGDlDu0PzBSeKxw+cvYKnbDFdWokBuCWJ3c EW2vGlc4tSMr5qlIbm1tX4HScTp1ijEH03ZCsg9Q= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Kenneth Lee , Palmer Dabbelt , Sasha Levin Subject: [PATCH 5.14 100/168] riscv: fix the global name pfn_base confliction error Date: Mon, 20 Sep 2021 18:43:58 +0200 Message-Id: <20210920163924.927901763@linuxfoundation.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20210920163921.633181900@linuxfoundation.org> References: <20210920163921.633181900@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Kenneth Lee [ Upstream commit fb31f0a499332a053477ed57312b214e42476e6d ] RISCV uses a global variable pfn_base for page/pfn translation. But this is a common name and will be used elsewhere. In those cases, the page-pfn macros which refer to this name will be referred to the local/input variable instead. (such as in vfio_pin_pages_remote). This make everything wrong. This patch changes the name from pfn_base to riscv_pfn_base to fix this problem. Signed-off-by: Kenneth Lee Signed-off-by: Palmer Dabbelt Signed-off-by: Sasha Levin --- arch/riscv/include/asm/page.h | 4 ++-- arch/riscv/mm/init.c | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/arch/riscv/include/asm/page.h b/arch/riscv/include/asm/page.h index b0ca5058e7ae..767852ae5e84 100644 --- a/arch/riscv/include/asm/page.h +++ b/arch/riscv/include/asm/page.h @@ -79,8 +79,8 @@ typedef struct page *pgtable_t; #endif #ifdef CONFIG_MMU -extern unsigned long pfn_base; -#define ARCH_PFN_OFFSET (pfn_base) +extern unsigned long riscv_pfn_base; +#define ARCH_PFN_OFFSET (riscv_pfn_base) #else #define ARCH_PFN_OFFSET (PAGE_OFFSET >> PAGE_SHIFT) #endif /* CONFIG_MMU */ diff --git a/arch/riscv/mm/init.c b/arch/riscv/mm/init.c index 7cb4f391d106..9786100f3a14 100644 --- a/arch/riscv/mm/init.c +++ b/arch/riscv/mm/init.c @@ -234,8 +234,8 @@ static struct pt_alloc_ops _pt_ops __initdata; #define pt_ops _pt_ops #endif -unsigned long pfn_base __ro_after_init; -EXPORT_SYMBOL(pfn_base); +unsigned long riscv_pfn_base __ro_after_init; +EXPORT_SYMBOL(riscv_pfn_base); pgd_t swapper_pg_dir[PTRS_PER_PGD] __page_aligned_bss; pgd_t trampoline_pg_dir[PTRS_PER_PGD] __page_aligned_bss; @@ -579,7 +579,7 @@ asmlinkage void __init setup_vm(uintptr_t dtb_pa) kernel_map.va_kernel_pa_offset = kernel_map.virt_addr - kernel_map.phys_addr; #endif - pfn_base = PFN_DOWN(kernel_map.phys_addr); + riscv_pfn_base = PFN_DOWN(kernel_map.phys_addr); /* * Enforce boot alignment requirements of RV32 and -- 2.30.2