Received: by 2002:a05:7412:d1aa:b0:fc:a2b0:25d7 with SMTP id ba42csp1497777rdb; Tue, 30 Jan 2024 23:38:04 -0800 (PST) X-Google-Smtp-Source: AGHT+IFejVqF2Z1/kCpPjBmSJK/Gi0pbF9XxD32GKaDTqlT2Ac6rCUDBkNdluujqtj/Z7qvUthkM X-Received: by 2002:ac8:5996:0:b0:42b:e377:5b6d with SMTP id e22-20020ac85996000000b0042be3775b6dmr950682qte.25.1706686683823; Tue, 30 Jan 2024 23:38:03 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706686683; cv=pass; d=google.com; s=arc-20160816; b=g/ZLoIDZIUxWDibg0W8ZZUuiX6JF9MGjYT27sQycwBcG1iCHlO2HBo3I7e1wGa3Ms/ E82hwdn5U4kg9RhR8OUhIhwMbvqbfNfWyG+0FEhyvsr7k+PVE5qw+i/IP7yIk+sGAVps sNsWO2OBnvT7K8EK3Xht5J3KyIUDgdxx9zJJrnm2cKJgsb04UQYfhchLo/8S+N2N/qSh xWc/SMjtzCljbuZT6XZkuwi+fwJr34bVxeftXs+vlJSxAHEbryv1wXtE7YW/jm8rgfo6 lbuYOCoFms2h2lNCCNDcgXZT2lfOPXGIpxDLUre3pKK+ZviE+r6R/gBhvAqoe474JQPe iQOg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:list-unsubscribe:list-subscribe :list-id:precedence:dkim-signature; bh=TmG+rznpqqyErX4zfSJ54u90o8JuQXslthwDpqEjAiI=; fh=6/PYavqayZCwUGOFBqMGfrWFooRGAjeCCvNfb8dL5fA=; b=upSKcFfTS5GGLmljZ/krRTivtnmB2XaThm45hP+5SsH1F4ge+eB2TGlSO2yqocTSFz Yg2Di3Ple1oCdilcxWejvxdgQa8CFT8GoIbQI7JwR5F1+J+1ONUVihgWXbMkrycGEMgs /OmhkMgRXuEUSfGnqd5a/3KxDHH1jupPRS/46vPtZwSdixKBrA2Cbic+/OEupaaLyrE+ WwWaJ4z72Cii4wg0dwLCDnoKZqkvhqW+itPHNDUR/W8Lh6+piGEOUDIzCiobaWeXukAQ KyPRO0P5qvLcvzRHoK6+2jXvq6aE4Tc7oIE/IPL2cRgcdLEXu0/csRoYOsOibIGHNH9U Ijvg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=qugRA3lU; arc=pass (i=1 spf=pass spfdomain=linaro.org dkim=pass dkdomain=linaro.org dmarc=pass fromdomain=linaro.org); spf=pass (google.com: domain of linux-kernel+bounces-45932-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-45932-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org X-Forwarded-Encrypted: i=1; AJvYcCXXbBdfUZJi3kgpB/V9vEqrKh0FrwG5KUzW+8mIVh4VENQJLCsLmIMuAnE/5O9xH4rdr15pjECA9iBtzBCFVhhYbRA3BWNWE6BbFB5mew== Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id f17-20020ac87f11000000b0042aad436da3si5059281qtk.447.2024.01.30.23.38.03 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 30 Jan 2024 23:38:03 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-45932-linux.lists.archive=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=@linaro.org header.s=google header.b=qugRA3lU; arc=pass (i=1 spf=pass spfdomain=linaro.org dkim=pass dkdomain=linaro.org dmarc=pass fromdomain=linaro.org); spf=pass (google.com: domain of linux-kernel+bounces-45932-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-45932-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org 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 933771C25851 for ; Wed, 31 Jan 2024 07:38:03 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id F2EF654BDE; Wed, 31 Jan 2024 07:37:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="qugRA3lU" Received: from mail-yw1-f176.google.com (mail-yw1-f176.google.com [209.85.128.176]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7993951C59 for ; Wed, 31 Jan 2024 07:37:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.176 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706686676; cv=none; b=nTHHO6CFlyNZ/Yzt+549uvNwNk/zHduvlGU87iy7drg/xTT2DZD1nJ8jTvW8fj1wQT5bxwUJheQmJUMduG/AXTeokJdUPKAEkY0A8EFGQg6UwkMkxCphw0HZPhumHO0jiKUeLbSbSeq/jkChU35idPRjoovq658/H8LlSdtIKs4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706686676; c=relaxed/simple; bh=TmG+rznpqqyErX4zfSJ54u90o8JuQXslthwDpqEjAiI=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=gMk2VZGNDzzxwXhoEbxUc+/PxYl+Nc9RSePY/Kpyn1w+UxcWntIpeQlRsZl4qIW9SUlmVZclFkYBcpN1zX9UwxA3cLHdIib1JQZQGZSqmcCQLhP/DhwzAOHIHs3z29PszWNQw+AZYOs0B+rWQXbTjOoYTTOMsoqk7N8xJgN3kWw= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=qugRA3lU; arc=none smtp.client-ip=209.85.128.176 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Received: by mail-yw1-f176.google.com with SMTP id 00721157ae682-5ff821b9acfso46316777b3.1 for ; Tue, 30 Jan 2024 23:37:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1706686672; x=1707291472; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=TmG+rznpqqyErX4zfSJ54u90o8JuQXslthwDpqEjAiI=; b=qugRA3lUGE+4iv2RbCrW9rOiaw+w1w3TnSsPYDomTVfsIhBg2yT8hCDktaLzV3YGPN WBPsoZOl2KfuIr0rENOH+XOCCEeDvC3sZczUAKUMtG7ZqIdeEaKs1yFvO/WULHi4fXYc QXg/hYuy920fMaLiFZcR5MURBY0NKyO505nTAXQiC2yHNPMZ2aENuRnHDJlfmFVDwVJl 7qt9yIFqWkVfGto8L5BeZSTJ3GlnL8D6EaEgkKMbzlDnoa/G03OPi52x9soysoVd0wst agXaaPO1fxdI4jS0s22srNBdAFPD1+vYng+hLso2Z0EQi5ud482G+YaHuHAD5CMh49p0 UHOA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706686672; x=1707291472; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=TmG+rznpqqyErX4zfSJ54u90o8JuQXslthwDpqEjAiI=; b=OZSSrkt0BoUTKNwOa1kqrIpkLgKTBbQUOWfs/CB21h++F5jeuWzGqQhsXBnrIgOGvd XuwWvqFXaxHnaCEGl6aXOzvVLusIPHQ/ggR/RvKhmn0pupgZ5nqk7XEQWRX1lRh3xaGN UUFFusypJpMfo9GYUMGYewr36ai+zmxOLxxPn9BDmOAyAXmNoNa2u3eFx1ipH7tIWPax +G4D9dsPgzVXRiqsbGrZkUGJCDDDXmpZD+b7n3nNsNoZRnMAx4ej+PCRw7UDQRNBX8ta ScnDExqzlqXi8HHUb6ZU2e9rO8Lv5THk9XNNIg8LG62D5yAlJfCRYyLTYwIAUZXCA2QO mShw== X-Gm-Message-State: AOJu0YxoP/hEzuyRGiVcvaakd5kbMjm8LueBsMCVleapSCIH8Hq9M2ZI ofkt1wLsO1AwFf99yUdVE34abgv0anQbqYaX1QAJl2BJAhTN2126CQ5P6psdI3Izis+ya0WNalG zBTv22rNX+u8LxEv82F9pOPa3w+RzhdDxzPN/Zg== X-Received: by 2002:a81:c545:0:b0:5ff:a52b:55ac with SMTP id o5-20020a81c545000000b005ffa52b55acmr594058ywj.34.1706686672385; Tue, 30 Jan 2024 23:37:52 -0800 (PST) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20240131055159.2506-1-yan.y.zhao@intel.com> In-Reply-To: <20240131055159.2506-1-yan.y.zhao@intel.com> From: Linus Walleij Date: Wed, 31 Jan 2024 08:37:40 +0100 Message-ID: Subject: Re: [PATCH 0/4] apply page shift to PFN instead of VA in pfn_to_virt To: Yan Zhao Cc: arnd@arndb.de, guoren@kernel.org, bcain@quicinc.com, jonas@southpole.se, stefan.kristiansson@saunalahti.fi, shorne@gmail.com, 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 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Wed, Jan 31, 2024 at 7:25=E2=80=AFAM Yan Zhao wro= te: > This is a tiny fix to pfn_to_virt() for some platforms. > > The original implementaion of pfn_to_virt() takes PFN instead of PA as th= e > input to macro __va, with PAGE_SHIFT applying to the converted VA, which > is not right under most conditions, especially when there's an offset in > __va. Ooops that's right, I wonder why I got it wrong. Arithmetic made it not regress :/ Thank you so much for fixing this Yan! Reviewed-by: Linus Walleij Arnd: I think you can take most of them through the arch tree. Yours, Linus Walleij