Received: by 2002:a05:7412:bbc7:b0:fc:a2b0:25d7 with SMTP id kh7csp1003029rdb; Fri, 2 Feb 2024 10:15:47 -0800 (PST) X-Google-Smtp-Source: AGHT+IFHWHWgx2WFwg17qZ5igCmJK2ErhAt90c2rMPLfebXmh23NGqND5PozohiDqI2vDg/xwEqj X-Received: by 2002:a62:9a02:0:b0:6df:b9c5:b83c with SMTP id o2-20020a629a02000000b006dfb9c5b83cmr5711965pfe.14.1706897747681; Fri, 02 Feb 2024 10:15:47 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706897747; cv=pass; d=google.com; s=arc-20160816; b=vykCxx7d3OErJAH2fRgOo2HTrejeH/VMgcSwDkQdSdoEv7f7bXrZrpcZ3eGwNUg1oP F5z+1hN7Olrfwvkg0V0R7igXxsDDqUksPeAjYw7axrmqS62anwArTLIxJulCS145rs0w xbKMh6oyJKlNY2kcIJvW8s6Wn+34X0nACBAQDagk/9WflkdP/UlnmSn9JbQffHFfM2qV jkscMFde6NWXy5CNmAWzCqWB8PhyyRwV9/UWvSMBO3ecZ/1rl3ZLrA3USeB7o+IY+0Kc nECA+OAvPMMScsWiyndRputYcTun4r9tl6uB3mmXRERuNrBiGQb+mNowGpFIBBxoXfwL 0/DQ== 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=T+NxqikMqY8zMy1caHhysblQq9xG1f252fz6RtPoVcE=; fh=x+MpLah6NK56cEtaiH/8m+ejTAbFgs/FKRH8rDOn7J0=; b=e+mXl9LFhnbRmpcyY9uCILCqv6CGfIj9mTAriRjcfaoLheVraPekQEOOkFOgSNYUEt 8aTOOHn/wL1pN7p1oEUIz8ADgQI3piZprtBfWt7eXKS8fquxPhiMnZlnJzm71HVd3WSx DtCwdkM7IRkMx19uKkgYkJg7g0AcP67ZK4+JxAAXYJT/P8XX5JMHSzcwR5L8PEl4F3xA bJOxwFLXnYm6Bx7U9aTLwk9XEQGY0ug3ywPsPVj5SqAXCgV6qbBvJk1C2i9XipKlct89 heplpMCYjZXb87E/irSMs80vagIVBSeh08PIk6NJpBAQH/P2KqlYLVPpnYXw7se2/YR4 iNSw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=SlVx6PbB; 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-50256-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-50256-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; AJvYcCXs6cKsMa/izj4e0GIwwnOS2AZnEkrBrid/ss9omH8D4jJ6AsgnSHjAf/Yw+8gXTn8wcFB7uxnRHORvRTqmJzsNnckIx0LrRVA6T5RrQQ== Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id y19-20020a62b513000000b006dbbae74070si1890893pfe.184.2024.02.02.10.15.47 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 02 Feb 2024 10:15:47 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-50256-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=SlVx6PbB; 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-50256-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-50256-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 sy.mirrors.kernel.org (Postfix) with ESMTPS id C5FAEB29369 for ; Fri, 2 Feb 2024 17:44:21 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id F262A14AD36; Fri, 2 Feb 2024 17:43:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="SlVx6PbB" Received: from mail-yb1-f175.google.com (mail-yb1-f175.google.com [209.85.219.175]) (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 6D56014900B for ; Fri, 2 Feb 2024 17:43:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.219.175 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706895794; cv=none; b=qjUUjCssSSrBviV1jat3MIQvbFo7NjrEh1oycs3MKuZrpnYFGs+6eL3VawSfAsVzGiItKdhzr6TIsRTIGb3HPCvJfaMl04jyiJvAq6DqHfHbuyWjYlrmFXBprXLNHhWDh4sYs4CrLkvvVu8afFiDzGR9/6wsTsGh3SOQuM1J/Dg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706895794; c=relaxed/simple; bh=T+NxqikMqY8zMy1caHhysblQq9xG1f252fz6RtPoVcE=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=ZL+ILUaY0bjfuWEcKBli93LCSCfYcZbHDYs2x2xhK/5Schhk1Qsc8klKQW/rFaENpUWyjBXCDdVMgiR1s0Rg02jSSuUj328UBw+Gv+uidXg1lW8plGjMpHKsvBLvas3kQMKRl0tKpN8Iw3JZI34pfVJMIdUVSLzroghv75PS9p0= 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=SlVx6PbB; arc=none smtp.client-ip=209.85.219.175 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-yb1-f175.google.com with SMTP id 3f1490d57ef6-d9b9adaf291so2106207276.1 for ; Fri, 02 Feb 2024 09:43:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1706895791; x=1707500591; 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=T+NxqikMqY8zMy1caHhysblQq9xG1f252fz6RtPoVcE=; b=SlVx6PbB7PYS11tWyXl1FRKQN9gJVKiolOghLgYliRP+lkaopifg6QQvJZOYzHj2RP qn7frcav8E4KPXfnOhzhwD0bxDEnRhD6MTvxMcwo+ZVoifkRppGPZdFuzySzyvut6js0 5zV8CZ3pPYntE97AjeD4gOQzVeyY5Ipy02Qsq04dfWDRX//ylGr+L3smhB0L8SKU9TKx /ZlyAY47wVqCFy1kj40ntfbpw3MQe6ry/uZLoD5oXJqrD8ZOg/e0hTzdm0yN9Q23Gp7Z OHzNMhiuS9PNAiYfhrbhwkDKtj7stnQ45MmUKPWeIn0v/0mXl1o4vaiLutdSwM5unWkT 0EGQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706895791; x=1707500591; 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=T+NxqikMqY8zMy1caHhysblQq9xG1f252fz6RtPoVcE=; b=IR6AGG0URNnx4GK0lLNPMsGrFa7CXrkAeu+MWkcD3ThJE/GwYW7tbkZz0wd9Jd7235 Gn6UiJdT7x1NGKMO8DUS0YSka7EOS91jpzF/dhyzjqxcFOUPHfi6vprP0kDTjLs95yd0 P1C3tvIzCs1vF9U0eLJ43n3Nt0wkIVJ6/YtAxyMhC98zY6yJRAD6p4J6mXpiVQcQhiL2 FuoQkkpe0Vq0RHGTkWbOYcLY23yfPLB3DnUk/FjiPMELfDRmFoxm4CgcyrQ8uA51eb0a n8hoIIp48flx7CkVzD0kayeJr+jGYr0qx4M4ZXv+PzgIzoNm/77Zx/Go23jsU2qzq31s 5tlg== X-Gm-Message-State: AOJu0YytFZmNOFNGayP8i9n55DeCSZdmJHA6P6mHUZ20sxGTDa6cbGH6 IVdU++GwFXNfsTND6nLcFfNaud/x/vIvjXhMXXaK8mUvsiNLZRWKe3TRkAxTJfWuzCy0VfV5OZp MRhPyl7Ny9xLVOU1qtPbOOA6AexQFDpnQLYxUHQ== X-Received: by 2002:a25:5f49:0:b0:dc6:af04:2e05 with SMTP id h9-20020a255f49000000b00dc6af042e05mr6356972ybm.7.1706895791304; Fri, 02 Feb 2024 09:43:11 -0800 (PST) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20240202140550.9886-1-yan.y.zhao@intel.com> In-Reply-To: <20240202140550.9886-1-yan.y.zhao@intel.com> From: Linus Walleij Date: Fri, 2 Feb 2024 18:43:00 +0100 Message-ID: Subject: Re: [PATCH] mm: Remove broken pfn_to_virt() on arch csky/hexagon/openrisc 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 Fri, Feb 2, 2024 at 3:35=E2=80=AFPM Yan Zhao wrot= e: > Remove the broken pfn_to_virt() on architectures csky/hexagon/openrisc. > > The pfn_to_virt() on those architectures takes PFN instead of PA as the > input to macro __va(), with PAGE_SHIFT applying to the converted VA, whic= h > is not right, especially when there's a non-zero offset in __va(). [1] > > The broken pfn_to_virt() was noticed when checking how page_to_virt() is > unfolded on x86. It turns out that the one in linux/mm.h instead of in > asm-generic/page.h is compiled for x86. However, page_to_virt() in > asm-generic/page.h is found out expanding to pfn_to_virt() with a bug > described above. The pfn_to_virt() is found out not right as well on > architectures csky/hexagon/openrisc. > > Since there's no single caller on csky/hexagon/openrisc to pfn_to_virt() > and there are functions doing similar things as pfn_to_virt() -- > - pfn_to_kaddr() in asm/page.h for csky, > - page_to_virt() in asm/page.h for hexagon, and > - page_to_virt() in linux/mm.h for openrisc, > just delete the pfn_to_virt() on those architectures. > > The pfn_to_virt() in asm-generic/page.h is not touched in this patch as > it's referenced by page_to_virt() in that header while the whole header i= s > going to be removed as a whole due to no one including it. > > Link:https://lore.kernel.org/all/20240131055159.2506-1-yan.y.zhao@intel.c= om [1] > Cc: Linus Walleij > Suggested-by: Arnd Bergmann > Signed-off-by: Yan Zhao Thanks for making the kernel a better place! Reviewed-by: Linus Walleij Yours, Linus Walleij