From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 553B3C4320E for ; Tue, 31 Aug 2021 16:58:50 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 23C106103D for ; Tue, 31 Aug 2021 16:58:50 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 23C106103D Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=arm.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=oGfLIeo7vs/9dcsu9qS2W4GYMu7G1bz+zJP3yhU4A3M=; b=yRXuhIGRH9ZnhJ lP4QNaYF7RlK5w5IZ6UsxTVz3zZAWUFxDNjOI+A75OpTb42JaE0g161c/sVOWwXUgjDLVkoKue+Do Cq9N/pdoAd5RCWE7ItLY8L6DEVncKuOvULpfaT9TlFNijPxqqgk6eyh5Ez1gB1oDfGr/PGN0d71mM UuGSASARd8CYI9KVJn8X2r66J/9TRYAPcX1GzIUfw5z5MSZBH9iXv9UKDP1jjnldRA2q+4g6YIQvZ jyvnERd9rtg4P0sDiz6eo51ikgQ48OuCeNBpSGlwB3geGeyICye994NjnYkMVd6wJLRuepD+/YZID kgPkCkUHSovOQOIB5gMA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mL74D-002ljw-RA; Tue, 31 Aug 2021 16:56:57 +0000 Received: from mail.kernel.org ([198.145.29.99]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mL74A-002ljZ-86 for linux-arm-kernel@lists.infradead.org; Tue, 31 Aug 2021 16:56:55 +0000 Received: by mail.kernel.org (Postfix) with ESMTPSA id D38B46103D; Tue, 31 Aug 2021 16:56:52 +0000 (UTC) Date: Tue, 31 Aug 2021 17:56:50 +0100 From: Catalin Marinas To: Linus Torvalds Cc: Christoph Hellwig , Will Deacon , Linux ARM , Linux Kernel Mailing List , Android Kernel Team Subject: Re: [GIT PULL] arm64 fix for 5.14 Message-ID: References: <20210826131747.GE26318@willie-the-truck> <20210827074041.GA24309@lst.de> <20210827171041.GA28149@lst.de> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210831_095654_349387_5BCC209D X-CRM114-Status: GOOD ( 21.65 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Fri, Aug 27, 2021 at 10:16:27AM -0700, Linus Torvalds wrote: > On Fri, Aug 27, 2021 at 10:10 AM Christoph Hellwig wrote: > > They CCed me on their earlier discussion, but I did not catch up on it > > until you responded to the pull request If I understood it correct it > > was about a platform device mapping a MMIO region (like a PCI bar), > > but something about section alignment cause pfn_valid to mistrigger. > > Yeah, so I can easily see the maxpfn numbers can easily end up being > rounded up to a whole memory section etc. > > I think my suggested solution should JustWork(tm) - exactly because if > the area is then in that "this pfn is valid" area, it will > double-check the actual underlying page. > > That said, I think x86 avoids the problem another way - by just making > sure max_pfn is exact. That works too, as long as there are no holes > in the RAM map that might be used for PCI BAR's. > > So I think arm could fix it that way too, depending on their memory layout. The suggested solution in the original thread was to change the generic DMA code to use memblock_is_memory() instead of pfn_valid(): https://lore.kernel.org/lkml/b720e7c8-ca44-0a25-480b-05bf49d03c35@redhat.com/ Given how late we discovered this in the -rc cycle, the decision was to revert the pfn_valid() patch. We'll re-instate it at some point but someone needs to sanity check the other pfn_valid() call sites and the expected semantics. -- Catalin _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel