Received: by 2002:a05:6a10:1d13:0:0:0:0 with SMTP id pp19csp295507pxb; Wed, 25 Aug 2021 03:34:08 -0700 (PDT) X-Google-Smtp-Source: ABdhPJypgunyYu6hHu6tnK/T34/0+cKA29rpe5q08BJNIhoEgsagwKyxE5PJXLfxxcBbOt67fD5I X-Received: by 2002:a17:906:498b:: with SMTP id p11mr46507698eju.295.1629887648126; Wed, 25 Aug 2021 03:34:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1629887648; cv=none; d=google.com; s=arc-20160816; b=ljPZ+jQbxPJxoCr89/N+avBceEH6MBe3YDPQBQEOT7x4wx5LPwPM443tEutIFt1GdZ wumQRVPRdPWfCrhuBLEjP3lKkM+W9Apmz7A09oXZLw9yVbkYFkKuUqedLVddGvI0DMRF A9bNmGuexR/un2yFhIWVbwQxCHvDLgosMkhO41jPdA+XOL1qUClE83g23W/+PAptYwra epRqHOJGo4AyR0JXnSZGt05nuOvpFvXCJvfoXc4rQQPhy6EHZp+jMlF1JS87Pd6qHmbh R7jd3+YN51i/Q2iY7iaIwG6Cfum2IdJmTipefDdMMZ+Iw3Tlf87kxOqO3pUel1qtAzNo uwwg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=v38/8wLWuWfBhT2V91SUnj2K9dm84rEyaf/tpYPCPRU=; b=cKJBa1re3h/CMPvKNwXqKFVH687KGOkBg//yR3XYOcGYs8sZeiUcgUpy+bUS51qHlp eZYt8RSpSlOJCGEvk+GG/XJWs0MeCv36stbvrUbWF8qybXpdbQtPdJ5r1f4FraveSR9/ oxEjlOyMvrFQV/C0+m7yqoqoB0zROhBN7z6kk+fBDlvdquaObXR5Aqi04wQoIpmpkSjq BXa60sWtzswWpoY5J+lKX5qJGzev4WDaNdgfPrz9NUJRQPX9VCHLc8RZ6mkUI31+wpoI XVBGerP3cC8CQawMRNXgrrL3cEExuocycHAdcBr5jbpgu/MperJJveK7K0YbM+X1zRDT LKJA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="i/W8C9NR"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id k8si8663932edr.262.2021.08.25.03.33.44; Wed, 25 Aug 2021 03:34:08 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="i/W8C9NR"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238303AbhHYKdO (ORCPT + 99 others); Wed, 25 Aug 2021 06:33:14 -0400 Received: from mail.kernel.org ([198.145.29.99]:42242 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237180AbhHYKdO (ORCPT ); Wed, 25 Aug 2021 06:33:14 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id EE2FF61139; Wed, 25 Aug 2021 10:32:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1629887548; bh=LBkEVhXk6nP+PCt46F0eZs1fuqXceK0E7MqW8V2Hc8U=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=i/W8C9NRzVDY6t5f5deJdUpGbBfcDy5CEjRlBFvhSZ7Vo7ehuzLwapvfO7Ob5lnCk /ZQpwFPe1VDf2kihwnsKuQ3UkqehyM6Fq2/Z9zhiMnQh6A2BYuEDnrdFDQ6Mda5JV7 G47H96SylwEZ5Ae9Lx+2V1zkc/AKdhzRrI1Am6mAM8SBGLlgvc+SQBcc9UcgS2r+S4 ct+8jWCrHWG9UXjn6fTAfqCZjcjlVABTUXkkk65rESQqx1ftwYJsL0W6k1rQGI47/g PjsO6YYgU10R16U5oeZmMM7IFdN35oCYGB/11A5SgFecabqKQQ6E9uei2zLwv4Zh5Y qZZm5bUUkgOrw== Date: Wed, 25 Aug 2021 11:32:23 +0100 From: Will Deacon To: Catalin Marinas Cc: David Hildenbrand , Robin Murphy , Mike Rapoport , Alex Bee , Andrew Morton , Anshuman Khandual , Linux Kernel Mailing List , linux-mm@kvack.org, Linux ARM , Christoph Hellwig Subject: Re: [BUG 5.14] arm64/mm: dma memory mapping fails (in some cases) Message-ID: <20210825103223.GE24546@willie-the-truck> References: <20210824173741.GC623@arm.com> <0908ce39-7e30-91fa-68ef-11620f9596ae@arm.com> <60a11eba-2910-3b5f-ef96-97d4556c1596@redhat.com> <20210825102044.GA3420@arm.com> <20210825102856.GD24546@willie-the-truck> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210825102856.GD24546@willie-the-truck> User-Agent: Mutt/1.10.1 (2018-07-13) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Aug 25, 2021 at 11:28:56AM +0100, Will Deacon wrote: > On Wed, Aug 25, 2021 at 11:20:46AM +0100, Catalin Marinas wrote: > > Given how later we are in the -rc cycle, I suggest we revert Anshuman's > > commit 16c9afc77660 ("arm64/mm: drop HAVE_ARCH_PFN_VALID") and try to > > assess the implications in 5.15 (the patch doesn't seem to have the > > arm64 maintainers' ack anyway ;)). > > I'll stick the revert (below) into kernelci now so we can get some coverage > in case it breaks something else. Bah, having said that... > diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h > index fcb535560028..ee70f21a79d5 100644 > --- a/include/linux/mmzone.h > +++ b/include/linux/mmzone.h > @@ -1463,15 +1463,6 @@ static inline int pfn_valid(unsigned long pfn) > { > struct mem_section *ms; > > - /* > - * Ensure the upper PAGE_SHIFT bits are clear in the > - * pfn. Else it might lead to false positives when > - * some of the upper bits are set, but the lower bits > - * match a valid pfn. > - */ > - if (PHYS_PFN(PFN_PHYS(pfn)) != pfn) > - return 0; > - I suppose we should leave this bit as-is, since the whole point here is trying to minimise the impact on other architectures. Will