From patchwork Wed Jan 31 05:57:40 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yan Zhao X-Patchwork-Id: 194507 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7301:2087:b0:106:209c:c626 with SMTP id gs7csp1703463dyb; Tue, 30 Jan 2024 22:27:44 -0800 (PST) X-Google-Smtp-Source: AGHT+IHNuR+eV9H/l4yXhf1Ja2GJjflDIw02UGbkmmhBVqcn93Rw/yYisEMWxV95SrpTrUjnGB7p X-Received: by 2002:a17:906:694a:b0:a36:5657:f442 with SMTP id c10-20020a170906694a00b00a365657f442mr433975ejs.10.1706682463900; Tue, 30 Jan 2024 22:27:43 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706682463; cv=pass; d=google.com; s=arc-20160816; b=ndG+CViOA2b/teWTedl3vC5ntCx5VZgGwscO1Y4kbAA6lb8jz/PXvi1gkGO/pWNRum nYRxOxYS0TVVl+2ug+1RS8f+0ibzsTOjNad8frJZDVVXTn5muRBIs5Tfpd1si6dwmdXA xSSE21Wg3wAsH35ASVStjR8W2XVimPRgP1nwwvhrRAZ2R0OlMeJWG5ihTDXbs5LtKI2Q 0sXxybeqNw6oZ5+UxtH04EmUqCWNig1xQRBnX+ZJduWv9BLTqNc0Xc59XyPJnNxzJHoB RkRYKqzjQzP41dQ21Cejxd/7fwmw2a2ZHAoXWY68qPgt+dDDwh+hf200qJnwcirOLGA/ SZgg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-unsubscribe:list-subscribe:list-id:precedence:references :in-reply-to:message-id:date:subject:cc:to:from:dkim-signature; bh=7rrBvB3XFDISjZVY96sfyW8ukjk2tqLZ3jDUll6XHXk=; fh=lvUVaBN1pBEY5hvf6fWoIqZZGOzj2ocAG27WpwGNaPg=; b=k32iNrjnpZvRKGd8kY88cEjM2osTbUy8S4hTWbODgqbNHWQg9Noue2XQIMjXIj9ahI gY1a1MgLMimlxJN8ZqDaW4T+CdED3nxnKRQPVztMaNmyrNy8hNq1fZaUgkvBzbwPm5Wc cHk8A/Um4Rn1Q02sWYrUGRU/4Bqh9BN+yS7mdcaUcTG2vI+iGq1toFMBgTxpylndd0wJ 6xgNz9oANviNIrQhIs4In/DpCYyQqU64DSj3rckOAp0KSL9wTwo/SROaNu5o6vaCWVyG 1Sq7lzEvRzcvhJJHMpFm+/jNBgafDgiU/YZsZosrrtq2XX2I4gjs2XF9xQqg7uQIKNxj VBLg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=Z2czEHs1; arc=pass (i=1 spf=pass spfdomain=intel.com dkim=pass dkdomain=intel.com dmarc=pass fromdomain=intel.com); spf=pass (google.com: domain of linux-kernel+bounces-45826-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-45826-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com X-Forwarded-Encrypted: i=1; AJvYcCXEGozI//Cp4YMzZvt076yHAbJDgi7qG2bwLGcAMZAvqwDDp6lbsY/xNJ3SpNEYJ2laVhOXnbbeTk7Lzk6ItsXtpde0FQ== Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id r14-20020a1709067fce00b00a35d33e21adsi2388805ejs.44.2024.01.30.22.27.43 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 30 Jan 2024 22:27:43 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-45826-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=Z2czEHs1; arc=pass (i=1 spf=pass spfdomain=intel.com dkim=pass dkdomain=intel.com dmarc=pass fromdomain=intel.com); spf=pass (google.com: domain of linux-kernel+bounces-45826-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-45826-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 833231F21D9E for ; Wed, 31 Jan 2024 06:27:43 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id CFA2E3EA8E; Wed, 31 Jan 2024 06:27:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="Z2czEHs1" Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.11]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6923540BE9; Wed, 31 Jan 2024 06:27:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.11 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706682438; cv=none; b=WHYLtg/4tiVvR7s712AeapNosYIA7iK4OzsqiyT1oXw0h9z544OdlqxhygrM2zBE/ySr2THLnwbekR8yexx8ElVIj2Sj+Gc+1LC003igBgxsiH6eG6e9BlvI3vw1jiO50+MFWQhb6MGXUiB71AjjQ99CkQb8twFo5h9y8Kj+Q1k= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706682438; c=relaxed/simple; bh=Xo8Jvj5oQfz6M2xvN89WBs3fC3gskTN27sgAVfq3fjI=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References; b=is4erkwnkhjsVO68fYZo6ZZwZ9leBSlpOiH1fnSLU1Wzz4PsZDMwk8k0TTAbKtXcAklr4nq9Dhue/fxkp6cbFNynIH6zNkrF4IBYmw7xe7Byh34EnFvkbxCyj63xD9LbyWcno2glpocTYxTE98WJRTm4bZpgnJ9gbh0Q0boetCE= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com; spf=pass smtp.mailfrom=intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=Z2czEHs1; arc=none smtp.client-ip=198.175.65.11 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=intel.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1706682437; x=1738218437; h=from:to:cc:subject:date:message-id:in-reply-to: references; bh=Xo8Jvj5oQfz6M2xvN89WBs3fC3gskTN27sgAVfq3fjI=; b=Z2czEHs12ncbG+D4JgStwFJcGuQylSGpN2rThGtbYZFR6rOSlV8aKJsA FNzbYAHaor7nIY8LvTktsB8a8PPjEPJTLfVMv/vgXDBYDLt4VfLTS1g9E B4HC0tGZNIQ/xB6MzyzApi+GDdpEVKLkGgKoJ5iRtRlz7M4GTf8i7Hoir FVSOB4J4cWivCDLtT2tS3hxE8NjGIrmFR8oMtjdB/mk0Osi3+j4CjACz6 3zHCXCjKfTM33LqbT3gv8HhZUJdeWrtRNOreDKpw0I1j+UfeuwKVksnwa FxrGNDH438lknycSPiO6jBnZxG+sYDyjUXGfQ5qDgdKL4VHY1qYxYqLZj g==; X-IronPort-AV: E=McAfee;i="6600,9927,10969"; a="10144950" X-IronPort-AV: E=Sophos;i="6.05,231,1701158400"; d="scan'208";a="10144950" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orvoesa103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 30 Jan 2024 22:27:14 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10969"; a="931737324" X-IronPort-AV: E=Sophos;i="6.05,231,1701158400"; d="scan'208";a="931737324" Received: from yzhao56-desk.sh.intel.com ([10.239.159.62]) by fmsmga001-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 30 Jan 2024 22:27:10 -0800 From: Yan Zhao To: arnd@arndb.de, linus.walleij@linaro.org, guoren@kernel.org, bcain@quicinc.com, jonas@southpole.se, stefan.kristiansson@saunalahti.fi, shorne@gmail.com Cc: linux-arch@vger.kernel.org, linux-kernel@vger.kernel.org, linux-csky@vger.kernel.org, linux-hexagon@vger.kernel.org, linux-openrisc@vger.kernel.org, Yan Zhao Subject: [PATCH 1/4] asm-generic/page.h: apply page shift to PFN instead of VA in pfn_to_virt Date: Wed, 31 Jan 2024 13:57:40 +0800 Message-Id: <20240131055740.2579-1-yan.y.zhao@intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20240131055159.2506-1-yan.y.zhao@intel.com> References: <20240131055159.2506-1-yan.y.zhao@intel.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1789586271192444556 X-GMAIL-MSGID: 1789586271192444556 Apply the page shift to PFN to get physical address for final VA. The macro __va should take physical address instead of PFN as input. Fixes: 2d78057f0dd4 ("asm-generic/page.h: Make pfn accessors static inlines") Signed-off-by: Yan Zhao Reviewed-by: Guo Ren Reviewed-by: Linus Walleij --- include/asm-generic/page.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/asm-generic/page.h b/include/asm-generic/page.h index 9773582fd96e..4f1265207b9a 100644 --- a/include/asm-generic/page.h +++ b/include/asm-generic/page.h @@ -81,7 +81,7 @@ static inline unsigned long virt_to_pfn(const void *kaddr) #define virt_to_pfn virt_to_pfn static inline void *pfn_to_virt(unsigned long pfn) { - return __va(pfn) << PAGE_SHIFT; + return __va(pfn << PAGE_SHIFT); } #define pfn_to_virt pfn_to_virt