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=-0.6 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, 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 A192AC83001 for ; Wed, 29 Apr 2020 01:54:32 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 621B320737 for ; Wed, 29 Apr 2020 01:54:32 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="j6ViSTNO" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 621B320737 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id E7B2D8E0005; Tue, 28 Apr 2020 21:54:31 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id E03FB8E0001; Tue, 28 Apr 2020 21:54:31 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id CD4358E0005; Tue, 28 Apr 2020 21:54:31 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0062.hostedemail.com [216.40.44.62]) by kanga.kvack.org (Postfix) with ESMTP id B2A108E0001 for ; Tue, 28 Apr 2020 21:54:31 -0400 (EDT) Received: from smtpin16.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id 7D0A68248D52 for ; Wed, 29 Apr 2020 01:54:31 +0000 (UTC) X-FDA: 76759223142.16.roll13_27751be74d244 X-HE-Tag: roll13_27751be74d244 X-Filterd-Recvd-Size: 3210 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) by imf47.hostedemail.com (Postfix) with ESMTP for ; Wed, 29 Apr 2020 01:54:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=In-Reply-To:Content-Type:MIME-Version :References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=jY0wjklF6SswnoOtnaHaRYY82tksyHsmPYoz5b7AlCo=; b=j6ViSTNOlrtt5ENsDEtQgXZ/zR 4+qOOLR4pUCwuVDfeKLrc82h1NAPdcZltjT8WH0mzAGdwj7Kaxps4/thC/B2QobCzfeqDFvv+XYBx 8+IqVPBoPLef2xfy6ylSUw6faafETYMIgPHg42+3LclkrBDRZudyACN3miRK0naDhcALp7JFbjb8M Q118XbXZVPEckJDm82SO9ZrmergkPGpa9W5akT3wD2+lCZFo49ORC17zrWq84L1j5kgbkast+DgeT Pih7xzD/0RV7g/YtapfSZSBnvdP6PH4CCVCHEr96XwuiLBCyNio0j01I4rDP0J7UweArfeYNhrgwW frVisnLQ==; Received: from willy by bombadil.infradead.org with local (Exim 4.92.3 #3 (Red Hat Linux)) id 1jTbva-0000FA-If; Wed, 29 Apr 2020 01:54:22 +0000 Date: Tue, 28 Apr 2020 18:54:22 -0700 From: Matthew Wilcox To: "Kirill A. Shutemov" Cc: Jesper Dangaard Brouer , netdev@vger.kernel.org, linux-mm@kvack.org, Toke =?iso-8859-1?Q?H=F8iland-J=F8rgensen?= , Ilias Apalodimas , Saeed Mahameed , Alexander Duyck , Andrew Morton , mgorman@techsingularity.net, "David S. Miller" , Tariq Toukan Subject: Re: [net-next PATCH V3 1/3] mm: add dma_addr_t to struct page Message-ID: <20200429015422.GQ29705@bombadil.infradead.org> References: <155002290134.5597.6544755780651689517.stgit@firesoul> <155002294008.5597.13759027075590385810.stgit@firesoul> <20200429003843.rh2pasek7v5o3h63@box> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200429003843.rh2pasek7v5o3h63@box> X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Wed, Apr 29, 2020 at 03:38:43AM +0300, Kirill A. Shutemov wrote: > On Wed, Feb 13, 2019 at 02:55:40AM +0100, Jesper Dangaard Brouer wrote: > > The page_pool API is using page->private to store DMA addresses. > > As pointed out by David Miller we can't use that on 32-bit architectures > > with 64-bit DMA > > + struct { /* page_pool used by netstack */ > > + /** > > + * @dma_addr: might require a 64-bit value even on > > + * 32-bit architectures. > > + */ > > + dma_addr_t dma_addr; > > + }; > > [ I'm slow, but I've just noticed this change into struct page. ] > > Is there a change that the dma_addr would have bit 0 set? If yes it may > lead to false-positive PageTail() and really strange behaviour. No. It's the DMA address of the page, so it's going to be page aligned and have the bottom 12 (or so) bits cleared. It's not feasible for some wacky IOMMU to use the bottom N bits for its own purposes because you can, say, add three to the DMA address of the page and expect the device to DMA to the third byte within the page. Wacky IOMMUs use the top bits for storing "interesting" information.