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 From patchwork Wed Jan 31 05:59:04 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yan Zhao X-Patchwork-Id: 194508 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7301:2087:b0:106:209c:c626 with SMTP id gs7csp1703920dyb; Tue, 30 Jan 2024 22:29:24 -0800 (PST) X-Google-Smtp-Source: AGHT+IH5nsHSivOYI5KS4BIFXddymuH4218bbLvqBZH40ccirPrwoL7zMUXNdU7KnW1tffsTEaZ4 X-Received: by 2002:aa7:800e:0:b0:6d9:b4e6:ffb with SMTP id j14-20020aa7800e000000b006d9b4e60ffbmr913364pfi.0.1706682564285; Tue, 30 Jan 2024 22:29:24 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706682564; cv=pass; d=google.com; s=arc-20160816; b=B3Slnko7+HSRqPNrC85KI/tv0w+ly/2TllnQTSbYLp8AtpbO0s55rRV7opUL+G5IWa 5N8AteR6cPVbVaqDVGupEqNVVzzC5lRmZniqMHKfIAWihv2pL8Eu1+xyUG+YzPMv0RNk 1KVr9MwqcDZyCCv53xzrc0SLUhUa+WZuHjTF642BboIizMwFAO3M6VA/HXYDRkVUFMg+ m2QwC2UWY7Tbs8guvIJlzK/ixBU3KR1C9UDUf8RY7Gw+5pcO/m23JE319S0Q7XrJRYt9 l34wVfY6OhYq0sZOtPDoZUdkc49+Q4pHEU3hQlkio0ZfgZ0B8AUifw+qya3un8swDQe9 sG+A== 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=tMjuSeUE9J6zxCzLVGGLFVyFM7KVtcKmO8Jbkdq/0NY=; fh=h6GX5LkK1UYaSKo3inchVK8usjLkmAL3QCKC9jkinHc=; b=wtxmNzyO4oitf4BCMfs1D7qAhstacC9gBg2HnZ9MYk4a3QF0S5JLIA/5nfvViDe4NV iL/GeAWIFNUyIhzlkzA0qGWgaRVDy3rN3PrawHsEjApFAWJLXowf1TqxV4KsA0g7OrcX cfJrfMM/osZ5Lbssfy6TMxGl3qdRbC0YNGnV5Cy+6bg3J0qRZQqsMVfb4PeHh6PvEzL1 Aum90cDAobtp02pZYwEo5Rn+EAsAq18v8ubudrg2BikJiEjTImMVTgPizo/B6ur5Lm9U FCDC3NLA/h7HxidmAlJrHMxqck7UbXxRcuYE9kH/cygGJ02OsiypNVSXSu4NlI86ba5F eKDA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=We2OMRKG; 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-45831-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-45831-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com X-Forwarded-Encrypted: i=1; AJvYcCU9eGNZ53V08UtsvHy8z4+NiBfterl+T5/nRPkt4Pst3fZuHDe/bvM2vsromitUM+xvLOBKPZRJHW1noL+aqeh/LnaaXw== Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id m10-20020a056a00080a00b006d3c35096dcsi9080835pfk.320.2024.01.30.22.29.24 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 30 Jan 2024 22:29:24 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-45831-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=We2OMRKG; 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-45831-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-45831-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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 79E51283897 for ; Wed, 31 Jan 2024 06:29:00 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 5FB223EA88; Wed, 31 Jan 2024 06:28:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="We2OMRKG" Received: from mgamail.intel.com (mgamail.intel.com [134.134.136.31]) (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 0BE7D3E48F; Wed, 31 Jan 2024 06:28:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=134.134.136.31 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706682522; cv=none; b=ffmwqJEKl1frr+EeHoACz110SUraPpL24CWnywJf3B2yMedHzJu2rINl6ypfHxEKQ8Fdu5UhgdNWvplhVY2uHA8jO5dXXD2ij5OcROhJRRt4IUKREL+M1APsnVvMxp7AduYJy1mm3bfTTolw0c0ZQsNkHWJqToGVevt8K1725IU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706682522; c=relaxed/simple; bh=hfVSVgT0v5YPemJxSQBciKx1IHu0qbunahQtFTlHaHI=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References; b=YAToFqPgFtDwGNtCeXm68QvnKgQyunv2QqI6l/5oG+qt8innpCVoZ5KFs47mzX1oyH+ob9OEuauApKPKOKr5Sj7UxFDl/goYNWE1ZsKCp7VJkgBGGr6MbdHfcExzvNGuTMXLMjgiA+dkcWdggLF2HA6GVye8IRl7vGp1O8w4y9o= 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=We2OMRKG; arc=none smtp.client-ip=134.134.136.31 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=1706682521; x=1738218521; h=from:to:cc:subject:date:message-id:in-reply-to: references; bh=hfVSVgT0v5YPemJxSQBciKx1IHu0qbunahQtFTlHaHI=; b=We2OMRKGOsLHH3l/j9Vk4F4SVlti1xrIpm1no5lhY+jr9EpUbTf63X1Q 11T0CB6esi+fS/f+OY5jQa662l4EJGiebMm0yEV0IPDl7owu3xgIEXfUY HtVIEMqVe9R+O2E800MZzIagIu+i6rsB7kWaeIWEDLhAp5eesslOQL5ax WQh+/dj+0zeu0vIEe0rtdJ/P4H0WPzWOFC+HDwL3Q+p0ge/cCd38E4OWM Zj3it3Ckia26YDswK4dLPIwukGgsGuQC+HqHwe2TAjpPjmnZhNp+Jm7m9 eGDqP5crjDiZLND6Xznh/tbu9xvVtDtzP3l/cQc9tDhTsLcE+Db7CpQ0X g==; X-IronPort-AV: E=McAfee;i="6600,9927,10969"; a="467751655" X-IronPort-AV: E=Sophos;i="6.05,231,1701158400"; d="scan'208";a="467751655" Received: from fmviesa001.fm.intel.com ([10.60.135.141]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 30 Jan 2024 22:28:33 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.05,231,1701158400"; d="scan'208";a="30385588" Received: from yzhao56-desk.sh.intel.com ([10.239.159.62]) by smtpauth.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 30 Jan 2024 22:28:30 -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 2/4] csky: apply page shift to PFN instead of VA in pfn_to_virt Date: Wed, 31 Jan 2024 13:59:04 +0800 Message-Id: <20240131055904.2652-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: 1789586376524385948 X-GMAIL-MSGID: 1789586376524385948 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: c1884e1e1164 ("csky: Make pfn accessors static inlines") Signed-off-by: Yan Zhao Reviewed-by: Guo Ren --- arch/csky/include/asm/page.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/csky/include/asm/page.h b/arch/csky/include/asm/page.h index 4a0502e324a6..2c4cc7825a7b 100644 --- a/arch/csky/include/asm/page.h +++ b/arch/csky/include/asm/page.h @@ -84,7 +84,7 @@ static inline unsigned long virt_to_pfn(const void *kaddr) static inline void * pfn_to_virt(unsigned long pfn) { - return (void *)((unsigned long)__va(pfn) << PAGE_SHIFT); + return __va(pfn << PAGE_SHIFT); } #define MAP_NR(x) PFN_DOWN((unsigned long)(x) - PAGE_OFFSET - \ From patchwork Wed Jan 31 06:00:21 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yan Zhao X-Patchwork-Id: 194509 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7301:2087:b0:106:209c:c626 with SMTP id gs7csp1704273dyb; Tue, 30 Jan 2024 22:30:31 -0800 (PST) X-Google-Smtp-Source: AGHT+IF/uFWqF3fOZpTnPirjvAvLR/bbb67dvCPhPMhTJeMLjQD+ZPF5HfJCruAxQiLhHx/mfyhy X-Received: by 2002:a81:7c0b:0:b0:604:1c9:62e1 with SMTP id x11-20020a817c0b000000b0060401c962e1mr632424ywc.44.1706682630942; Tue, 30 Jan 2024 22:30:30 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706682630; cv=pass; d=google.com; s=arc-20160816; b=t4keWSS/akFg1Vh1wOoTDlTRa3oAUjm2I1lBbweHLX56NaqKqffwqVJ68kIwL7Tap7 ie4JXl81Ac+D0AKL7qLQnz5VoW5YtD5iZmrKztiVZcXVL17kQyfsPi2b3Kr6lNHq2Bqu Ue/6Tpr6PYJPN6cqVr99aI8JuhcrUtXQK/yvU23WJkOUjWlkCt0gZMjHOtO7WKkCPUNt JJZCCNHGovoGwlwQHIRMvuU+X5GKEIkhpG4DGizT1JGgUhq+i1rKxKgi82Jg+ei9vnY9 5sZ7CN6+xplh6jQyOuERCjftDF3t88zHrvEEJ28D6ER1g2siJH6psKIyZ54ayoX4OhC6 UUtQ== 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=Tsccz4YcFO2xmRfKEQdog1xb0JOIPRDARLn/1bQa0lE=; fh=AZCEI+W1w8Wirfdh5mmfG6aXohxTlm8TE2cHvs34ytk=; b=fdrQo+LbOLJ4x8jBMS8+0aYFrn9n0PYBXXfhLKXywz6t3vg7jZuo3KQPWN52pXjY3m ni4eRvIbura2qyVtJKcfwqzeIqN/RKGmvAUVm2eiyry9t2xn9oUuJgsQvO6d1/XykuQ4 RRAXBTLvHNQh4ssXoA0d+Roe5Ss8EI8Sv1jK9oNSr/av1JFktAmSxI+P0acAvf1vzR9s Ftspp1J1xXzN/nKSB+61xWgACKfEf6i7BmpwHV41orFB4k+4ItihHwRfj6BOS1Xv++D5 0HMCuMXdEBHEvNrfpwOTjFhdxySRxA7Y/LR5KeK+d1jvl4a8m/vvsDk/lpOigRjUotUe xyjw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=RUUJh4ZU; 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-45834-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-45834-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com X-Forwarded-Encrypted: i=1; AJvYcCWbkYN5pHMutyUInRl2GPc8qLn0TzPjoplaGvJGkm68XXdgK3/ybnu4kA7Y7JAAtRYeBfIsFKz6y5qLnAVNr5MaRJY22w== Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id y6-20020a05622a120600b0042aa738fb14si5679422qtx.473.2024.01.30.22.30.30 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 30 Jan 2024 22:30:30 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-45834-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=RUUJh4ZU; 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-45834-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-45834-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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 09A7C1C22753 for ; Wed, 31 Jan 2024 06:30:11 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 422A43EA91; Wed, 31 Jan 2024 06:29:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="RUUJh4ZU" Received: from mgamail.intel.com (mgamail.intel.com [192.55.52.88]) (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 07E8D3D56E; Wed, 31 Jan 2024 06:29:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.55.52.88 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706682593; cv=none; b=gZq7X9M31FLI/66EX0AP83nGavrq4m0Y9yWL86fDPgg5mPRMGffJ5yTM9A0cdHzLsTDQa/4ACFzDV+Vft3D3zkemzsY8USKrxwmqTEqcM4lqHt1zxYEByuqg1320s7ArHefPcNY0kvEzwIu9qWrO7FWQ40QlgYsWvqJbCBSAf9w= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706682593; c=relaxed/simple; bh=2FW/d4u/muEUqMbOvxlTPNXE5CaRll4su+xJMlD1d+8=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References; b=JjRoAzAhv2xdkwmiRa5tlvyF+9pjXrVYKOER8oKao6oWGwwGTk5hJTylFJ+bzPjROh8CwLCpDUJT1kx8dF8D3dcVEPlHyEaR2D4oxYJY1HV3BpWsHRyS/VyFhupHuP3kDXzMWXVSNLZ4vf3owsDK1Shk9PNylHzSBk3UAPdCF0A= 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=RUUJh4ZU; arc=none smtp.client-ip=192.55.52.88 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=1706682592; x=1738218592; h=from:to:cc:subject:date:message-id:in-reply-to: references; bh=2FW/d4u/muEUqMbOvxlTPNXE5CaRll4su+xJMlD1d+8=; b=RUUJh4ZU/6OkQmQ7HDqomPWqUT2m/bgt2kNtWCqxFj2GTdFqZxAr8LW2 /fdCmj2nSrTW9llp+C2XBvfrg1GxVTiHSbPMf1e8A607xI44Io5JGBVVb z3EPGSf0aHAdvDhZVzUoW5vU2iIY6fTpAmTtwKYh62UZsKC2/6pfh0lrk EvHjexpGPnHgjHfQCy2YJ05dLQGZeIyYiOjOmVG8UBa11hHsZdWeOH7eh WVls0JYLhPuFRN11ibpOBCbES7IjVv5lducSp0nh5L4j2pVs+Dv6h/RZ9 RXq8WbNLmBl8vaQtwA/esepZ9ijolpZsDFebher0miwy4/qLv5fMQ4L/2 w==; X-IronPort-AV: E=McAfee;i="6600,9927,10969"; a="434679669" X-IronPort-AV: E=Sophos;i="6.05,231,1701158400"; d="scan'208";a="434679669" Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 30 Jan 2024 22:29:51 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10969"; a="822458493" X-IronPort-AV: E=Sophos;i="6.05,231,1701158400"; d="scan'208";a="822458493" Received: from yzhao56-desk.sh.intel.com ([10.239.159.62]) by orsmga001-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 30 Jan 2024 22:29:47 -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 3/4] Hexagon: apply page shift to PFN instead of VA in pfn_to_virt Date: Wed, 31 Jan 2024 14:00:21 +0800 Message-Id: <20240131060021.2749-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: 1789586446391329780 X-GMAIL-MSGID: 1789586446391329780 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: d6e81532b10d ("Hexagon: Make pfn accessors statics inlines") Signed-off-by: Yan Zhao --- arch/hexagon/include/asm/page.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/hexagon/include/asm/page.h b/arch/hexagon/include/asm/page.h index 10f1bc07423c..1d341590791a 100644 --- a/arch/hexagon/include/asm/page.h +++ b/arch/hexagon/include/asm/page.h @@ -135,7 +135,7 @@ static inline unsigned long virt_to_pfn(const void *kaddr) static inline void *pfn_to_virt(unsigned long pfn) { - return (void *)((unsigned long)__va(pfn) << PAGE_SHIFT); + return __va(pfn << PAGE_SHIFT); } From patchwork Wed Jan 31 06:01:42 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yan Zhao X-Patchwork-Id: 194511 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7301:2087:b0:106:209c:c626 with SMTP id gs7csp1707621dyb; Tue, 30 Jan 2024 22:41:29 -0800 (PST) X-Google-Smtp-Source: AGHT+IEiI6k1vcay8XBLT+VAFE6hNPZdNik/k7WcIPPjoP6WXtMWeM8mXMCtGbioOFZOgh5GYane X-Received: by 2002:a17:906:f111:b0:a31:f7e:8a53 with SMTP id gv17-20020a170906f11100b00a310f7e8a53mr405565ejb.26.1706683288928; Tue, 30 Jan 2024 22:41:28 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706683288; cv=pass; d=google.com; s=arc-20160816; b=zmk4vkybTzSGtSjXkxFx7Lqq5DFkRGmP3eyKFwbFPx96cgzsOA8Qw1kg8ecZA0qq65 wbqPfRL6JCHdm41GGnRgtSOghRh3Hy1kk747xfQ9QAeNCvtWhzIGYxmt1cltIsvTIfbv tF1Xd2pEluMEyZ1keDyVPA+zW4OU8XjmwgFOXoKSj4tOFXM7b6j8uX7puwEqiMjz+SJn hsc0Zp5tT3+cOl01EJmagmgn9n9zXr4PwaXeJJSglbQe6hycX3q/A8DT9Go/DnwovII1 7/XaAT1vuJCz2ilk95NuEITP/PotKRpjcTIVNB13NJfqPgVL6fD02+saM/k7bnPF6/ir Q7nw== 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=IjCr10RzZBGMopE/Cgo7o4rVYnofVVaZQpO2EI+EJTU=; fh=Y52h1WlnVNAV0stCT1WYkC91vxI3d4vyPM5H5K5yzZI=; b=dBOy1JjZo5qxAJFfeNuiOc7Pi/PhcuM3bkTwBdIToQu+FZzWiF5skMSZ6hUVoIJVjx Q55FdCQCBP6OGFaHiOeAujF3RGvyWTbW2OY8RaJVUurKhSeUV97Vp08QpaUrhA9yMgoe EFV8OZSk0MSmKZP3dj2/Fz9BzDIHJxGlsnMms6L4OXb9bwa0dFcfPXjn5FgW4XcMmxlV d+pWnzbWGleo1xoGAlYJhY26NJIwC51Mp/eXJLEifK3auM8Z0TvBccXmWQekGW87XhXn SmH7iEDwndORTrt5ihEETvIGTNVWMFkBmw+9d0p+FYR6P+FvNKIf0TDiU8f1HvuttRg4 eWdA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=mmQFZQ15; 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-45838-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-45838-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com X-Forwarded-Encrypted: i=1; AJvYcCXcNZIau+cz/X/DAhnNIg2dFJuciuiXW1OksWfAW4SfkI/52IS5N0s9Vxj1qOeKKBXeiaG3dn6lwfsniSyx4n1yFqJr9g== Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id o23-20020a1709064f9700b00a3660f5cdb1si585468eju.352.2024.01.30.22.41.28 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 30 Jan 2024 22:41:28 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-45838-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=mmQFZQ15; 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-45838-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-45838-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 984AF1F29DA0 for ; Wed, 31 Jan 2024 06:31:53 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 4FC505024D; Wed, 31 Jan 2024 06:31:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="mmQFZQ15" 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 00817125CA; Wed, 31 Jan 2024 06:31:11 +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=1706682673; cv=none; b=V5A9XemPKHnblvKiTT5NRg04pZzadydrR+eS1ZrgV/g1k2nSb9HgqusiQ4aCfpdZz5rJq08LfUCwm6ie35ggmqRzhLD+Kkr/T/F8UIejbk3vVPKdP8zyHwM8Es+7Cf+3en2HfhLw7WUnaz3Y379bN6oBX37RQ4ApLfHySTUzCmQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706682673; c=relaxed/simple; bh=rWpNYhvi5Y7XEDqsmQ7YOXj2NszqHIpA2qBYV+5aizE=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References; b=bKrVVEJyzBzJv0e43ll4wN6rRozrJ3EgFMgZKX3odYvE/SR/lOlHEElX0OjKCpDAjFKjB9Ml7RwJ7vpxXQrINfmsyAFZbWqyNoBZmAWsGxY7O3SBZnmdSFybPTXBREofAVBZSKsej1fdyvQefYB0TdOKEI2rpj4TySGSXAy0CoA= 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=mmQFZQ15; 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=1706682673; x=1738218673; h=from:to:cc:subject:date:message-id:in-reply-to: references; bh=rWpNYhvi5Y7XEDqsmQ7YOXj2NszqHIpA2qBYV+5aizE=; b=mmQFZQ15dYt8NhEMlVcdhRYa0u3xnfkQLqMib7qbOgJtDIz2y/RIPt4+ 2WA5JJfD2219ZbFDdU5ORcag9Gfva0fQwvivmjqn6hFvBrBCDXAFf6AmV 2jsNQvP5dHNdlT7ZZauPcuoZaeb+k/meHXAaD6Gs7ACSpSFDNY3Dt0yBQ h7mC+/202asF2pdIQNypTg7L0gro0TeX+dvXvNNDPu48JsrEus7ww1+u1 nluYSQDSjSnl8HwCaGE3E5O6KxSCcYP6ZLuzycMQ73TWwwHJeDBuRzq+L rFX1fvXX/9Ooxji1GxQmKOy0myy1ycKTkYaNmDCMrRCc7gxJcJG+5mMiO Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10969"; a="10145767" X-IronPort-AV: E=Sophos;i="6.05,231,1701158400"; d="scan'208";a="10145767" Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orvoesa103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 30 Jan 2024 22:31:11 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10969"; a="907779612" X-IronPort-AV: E=Sophos;i="6.05,231,1701158400"; d="scan'208";a="907779612" Received: from yzhao56-desk.sh.intel.com ([10.239.159.62]) by fmsmga002-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 30 Jan 2024 22:31:07 -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 4/4] openrisc: apply page shift to PFN instead of VA in pfn_to_virt Date: Wed, 31 Jan 2024 14:01:42 +0800 Message-Id: <20240131060142.2823-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: 1789587136262635171 X-GMAIL-MSGID: 1789587136262635171 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: 232ba1630c66 ("openrisc: Make pfn accessors statics inlines") Signed-off-by: Yan Zhao --- arch/openrisc/include/asm/page.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/openrisc/include/asm/page.h b/arch/openrisc/include/asm/page.h index 44fc1fd56717..55c66f6cb1bd 100644 --- a/arch/openrisc/include/asm/page.h +++ b/arch/openrisc/include/asm/page.h @@ -79,7 +79,7 @@ static inline unsigned long virt_to_pfn(const void *kaddr) static inline void * pfn_to_virt(unsigned long pfn) { - return (void *)((unsigned long)__va(pfn) << PAGE_SHIFT); + return __va(pfn << PAGE_SHIFT); } #define virt_to_page(addr) \