Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp2597045ybl; Mon, 19 Aug 2019 04:46:34 -0700 (PDT) X-Google-Smtp-Source: APXvYqws7clKYCxSrg27p+MMIounQQ2e7qBrgyrWVxU8+s/HhuJu4RNAvGGy7yTDfBN+PhYJrIiH X-Received: by 2002:a63:e48:: with SMTP id 8mr19210724pgo.389.1566215193897; Mon, 19 Aug 2019 04:46:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1566215193; cv=none; d=google.com; s=arc-20160816; b=0kU6NFYik6P5pfSRznWeW5XHIyS6ixo+VLcpvo2TIyvaULLAoWjA8km/HPeoKVJd3m LYZJNKkWPs6H9tpmgpVk6zxqoBpxbFtfxL/4JzWmJoB1+VYEKSUNUfYYWBNu892rDWsW tBZfdRaaGsoqIw0yA9Jr8NxQO9mSS6qHve0OqeLkPOaOKxByZtxODa1yAnN/mR0cZrs1 pffS/k1SoU5xHE7scMNl2iVk4g/wwIkJMFjtyHHTdbYkr5lJ+1yRZGBk3B9ZtEh9zRFR wRYmsqOs5yoyqL1/qumkirnjQHxvApE3nDIfDKR1R392BxYuPDMMkdbgwPNf0pgoYwVm u2Zw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=aN6RNy2hogah6LiuCQIdCmqbhF8ycQ7Kc5qez5kJ2XI=; b=hD7JJGgOCzx6XW0X/Sr4YWXHVx6qFCAQG8eF+KL33+XnitS5HY4KrhhzqK8aMkgDX4 Vmw7uIR2rX8MRuyCpF56h6tzTIZ/OsmCJIX9Dcqe4s30Jt7Z9lAWbEoWbI+pynMBQdlh Ir6w0atPkToE622ZX7R2blGZRg6iqKR0ves6l6ikNHIEXavD44vbojg+SE6qWF4BLAIf QLkmYUaZzUMiAzzW2y2LdFBfhjZlPPG6iCJ49tjVKKbUn6bydsMm/n6YExLucIKahF3h oI9Pof/cIxHS+tjBrHeyiZF40vf6zSvw5RSiVvC5ioLKSo5M5mqeyWIES+ucTDHfNqJy emyg== 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 s10si8553327pjp.27.2019.08.19.04.46.18; Mon, 19 Aug 2019 04:46:33 -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 S1727445AbfHSLpV (ORCPT + 99 others); Mon, 19 Aug 2019 07:45:21 -0400 Received: from foss.arm.com ([217.140.110.172]:53144 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726703AbfHSLpU (ORCPT ); Mon, 19 Aug 2019 07:45:20 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 514ED28; Mon, 19 Aug 2019 04:45:20 -0700 (PDT) Received: from [10.37.12.162] (unknown [10.37.12.162]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id E2BA23F246; Mon, 19 Aug 2019 04:45:18 -0700 (PDT) Subject: Re: [Xen-devel] [PATCH 01/11] xen/arm: use dma-noncoherent.h calls for xen-swiotlb cache maintainance To: Christoph Hellwig , Stefano Stabellini , Konrad Rzeszutek Wilk Cc: xen-devel@lists.xenproject.org, iommu@lists.linux-foundation.org, x86@kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org References: <20190816130013.31154-1-hch@lst.de> <20190816130013.31154-2-hch@lst.de> From: Julien Grall Message-ID: <65248838-f273-6097-22f4-e5809078ddba@arm.com> Date: Mon, 19 Aug 2019 12:45:17 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 MIME-Version: 1.0 In-Reply-To: <20190816130013.31154-2-hch@lst.de> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Christoph, 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? > + if (local) > + dma_direct_map_page(hwdev, page, offset, size, dir, attrs); > + else > + __xen_dma_map_page(hwdev, page, dev_addr, offset, size, dir, attrs); > +} > + Cheers, -- Julien Grall