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) \