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.7 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,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 A57BFC432BE for ; Wed, 25 Aug 2021 10:57:33 +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 7460661184 for ; Wed, 25 Aug 2021 10:57:33 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 7460661184 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org 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=ak0rbXwnN9j99zQOK8g1oglB2gaP2KDihzWsZBYz1FY=; b=ryc5+k+w+uucza jr6YtSs3rh669HKC/ZWfqQlN0j8YICBlk//X2QszN0XBcGa1DXqQxcwkvLBYPzk9Q1xFv411L3dsx YTmeVtJUsgE7iF0aHrNAPJmtPV4WmtysPqZ82CNlIhuA7PMtXHsqLcRtOLbrC4yVHu/dhhZ91lRHm ZiX7rolLDZ6Ol9IM1OJr0LM/9/BrsucbrurZ0ceWM5zvKkH5pWdvvFi1XgiCoKg7Y7JAK4j6QPG5z fI8fUD+lNSM+k4bbtVwD4orM4feOZQebjW/43E8s94hjOmSuiapxGhIMcop+RGRi4+lEnC5FXp6gZ hOehPL2owPzqMBRB2hJg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mIqYe-006gHm-Rf; Wed, 25 Aug 2021 10:55:01 +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 1mIqYV-006gEN-QC for linux-arm-kernel@lists.infradead.org; Wed, 25 Aug 2021 10:54:56 +0000 Received: by mail.kernel.org (Postfix) with ESMTPSA id 8B3DE610D0; Wed, 25 Aug 2021 10:54:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1629888891; bh=43dMkUgGcDYcyzWnolvQYPW9uYzAg+QlRlBiAYcHEqk=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=HTPiJObERgLnfoiCA+F1nMwZZ86Km8eMk/fEw72ai9DIWymU2fxJhScwVftlUfCBz 2nFJNucUUqJRrqJsXwboQwWqVBHyE1/KR1xSezpLFqa4Zsafe6QVI1sjQi1vwfLS3K LOefmynFQuDZO2qS0HQMaf/cI5YiKayJ07+n9DbL2N2vQUXG9DS37Pd6eUhrUavVPx SFN7Tfdo5cEyW4pvGTChmeFAtI9bnm+6DP8nhSnJgNOFvGns7UlNAd+shdGBOl+ZuZ B4ttJCYCo61dFcyiPpde6NMyaSFHFrgwIWkoCuvH4SMTJrWIhrMEyP+tbXA/n4flKW vbTbvJxvor/RA== Date: Wed, 25 Aug 2021 13:54:45 +0300 From: Mike Rapoport To: David Hildenbrand Cc: Catalin Marinas , Robin Murphy , Alex Bee , Will Deacon , 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: References: <20210824173741.GC623@arm.com> <0908ce39-7e30-91fa-68ef-11620f9596ae@arm.com> <60a11eba-2910-3b5f-ef96-97d4556c1596@redhat.com> <20210825102044.GA3420@arm.com> 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-20210825_035451_965183_7423CBEB X-CRM114-Status: GOOD ( 18.85 ) 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 Wed, Aug 25, 2021 at 12:38:31PM +0200, David Hildenbrand wrote: > On 25.08.21 12:20, Catalin Marinas wrote: > > > I can see the documentation for pfn_valid() does not claim anything more > > than the presence of an memmap entry. But I wonder whether the confusion > > is wider-spread than just the DMA code. At a quick grep, try_ram_remap() > > assumes __va() can be used on pfn_valid(), though I suspect it relies on > > the calling function to check that the resource was RAM. The arm64 > > kern_addr_valid() returns true based on pfn_valid() and kcore.c uses > > standard memcpy on it, which wouldn't work for I/O (should we change > > this check to pfn_is_map_memory() for arm64?). > > kern_addr_valid() checks that there is a direct map entry, and that the > mapped address has a valid mmap. (copied from x86-64) > > Would you expect to have a direct map for memory holes and similar (IOW, > !System RAM)? I don't see where will it bail out for an IOMEM mapping before doing the pfn_valid() check... -- Sincerely yours, Mike. _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel