Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp3957350ybl; Mon, 26 Aug 2019 03:16:07 -0700 (PDT) X-Google-Smtp-Source: APXvYqz5VOacIfCvEXK57NckA/6wDW+n50m63zB6xEAVIdXOvEQEsthR1+L9O78djdtd/+EQYOmG X-Received: by 2002:a17:902:9b94:: with SMTP id y20mr6051503plp.260.1566814567846; Mon, 26 Aug 2019 03:16:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1566814567; cv=none; d=google.com; s=arc-20160816; b=hUwFQcPvtK3yQAD4yo4NYFeAUsC+ThrV69ai+wZ1v9cIcXI77p1ojOhNxVehxMp/Nz ODWasyjLkLyuQajJc2cd260vh8hE7n3UjEvJJz0MeTCVzO3Fyj8z7q7W7ib7laYDgX0P lNjgISVM8/3sUpcvUwp15ZvKwZduARN26u/pNsnyDhPadVHdOCgDygHCejIAUvTorVgT wwPgusN/B2Gc2TBf5nniG/3E27SK2ZaE43Ps28MDgbShZ+jC3oGwY02MRdIs/KhZ15xL GSMt6HFnj2oHP2aRrzQ0dD0fd+zaOgOWgaxGkFmJLQ+04kuPXvRor7egdNuEoB1bXlbw 8dVw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=8vU/KbiaQNsB1hAKJPSu8Dh1j8SXWyRnMrZa2u828Bg=; b=iS9XEqOsl7MBKaftSYrWGEcxO1aZ0NsTqfqHCm/Uf/tCvYef5vstDCaSUVpS/fatyX RD23yzUWyZzSPDyC4Mv5cGvBFyW9D7qDNSYHSgQ1trL8pBd9P9f8fgzfUHOqd1XKkevk sLcDty17dJmo+289n48YZ90frumjynu4oPFqxF09YLRt3U/blXNvho9t6emeqiPMAGjm EHOtSzJsP46r38Kps1pFClzw09SN+oap466X9X3Gwq9CWfAqCDZWgmwPnj2tmPvchGiT kFnhi05DhOMG+pd4YxCUEDa81+upeJzXPZy8Cb2cFmPZid6gGfFP3oES8qVAyQZOFOKQ arhA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a17si8513975pgi.430.2019.08.26.03.15.52; Mon, 26 Aug 2019 03:16:07 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730873AbfHZJUG (ORCPT + 99 others); Mon, 26 Aug 2019 05:20:06 -0400 Received: from verein.lst.de ([213.95.11.211]:47254 "EHLO verein.lst.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726354AbfHZJUG (ORCPT ); Mon, 26 Aug 2019 05:20:06 -0400 Received: by verein.lst.de (Postfix, from userid 2407) id 46384227A81; Mon, 26 Aug 2019 11:20:01 +0200 (CEST) Date: Mon, 26 Aug 2019 11:20:01 +0200 From: Christoph Hellwig To: Julien Grall Cc: Christoph Hellwig , Stefano Stabellini , Konrad Rzeszutek Wilk , xen-devel@lists.xenproject.org, iommu@lists.linux-foundation.org, x86@kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: Re: [Xen-devel] [PATCH 01/11] xen/arm: use dma-noncoherent.h calls for xen-swiotlb cache maintainance Message-ID: <20190826092001.GA13476@lst.de> References: <20190816130013.31154-1-hch@lst.de> <20190816130013.31154-2-hch@lst.de> <65248838-f273-6097-22f4-e5809078ddba@arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <65248838-f273-6097-22f4-e5809078ddba@arm.com> User-Agent: Mutt/1.5.17 (2007-11-01) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Aug 19, 2019 at 12:45:17PM +0100, Julien Grall wrote: > On 8/16/19 2:00 PM, Christoph Hellwig wrote: >> +static inline void xen_dma_map_page(struct device *hwdev, struct page *page, >> + dma_addr_t dev_addr, unsigned long offset, size_t size, >> + enum dma_data_direction dir, unsigned long attrs) >> +{ >> + unsigned long page_pfn = page_to_xen_pfn(page); >> + unsigned long dev_pfn = XEN_PFN_DOWN(dev_addr); >> + unsigned long compound_pages = >> + (1<> + bool local = (page_pfn <= dev_pfn) && >> + (dev_pfn - page_pfn < compound_pages); >> + > > The Arm version as a comment here. Could we retain it? I've added it in this patch, altough the rewrites later on mean it will go away in favour of a new comment elsewhere anyway.