Received: by 2002:a25:683:0:0:0:0:0 with SMTP id 125csp243564ybg; Mon, 8 Jun 2020 22:35:06 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwqDLotHNC1L5Mj4oi0Nr2PQbym37blQ2DB7bjh9SI4rB+FWtppUWf0nchQ2+h6ebvR3xL+ X-Received: by 2002:a05:6402:393:: with SMTP id o19mr25751486edv.28.1591680906090; Mon, 08 Jun 2020 22:35:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1591680906; cv=none; d=google.com; s=arc-20160816; b=kS6eUOUWYZ0MzZ3+Ii0Q+jafsDmDY9ZRbB0Yb0kkMB5HV9wMePvi1mqRXo3hixyBkc qmyMjQKfvwXxhEWS6NsSW68mYB48kAconOF6OjYdeY6KkrqyjOwVivKEz1GtNff+2uXf gQwcYxY746MMaIjPevdFLsIiPQTBI9IIjQW85VNBjqFKtahBJ9zE5OAth8RsZ9uWFXqU rT4msu2jVeXJ7xs1kzS/qd3PsxWMxPVt0Ibvg8PZqAvx7Yw4NdUoH6rxIfCiWGqVwWa6 1w7P96XSae7QxtLxA7VhvcJatIJQI50Uy5c+f9xQ51HylIgu6fHooy/PGpaPq3JsQZdk Aexg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=FL0M/QWy7eJQyyMOSmjXi3woft307nJ4/y9AHPp9mF4=; b=QOxqsDmTx+tqH6fKAIb7wFHlHrc9fkLAUyasluPIYZse9zfwiHZG/KOBGtfgV19onD yon1Vuj1ksohBkk2MFi/bZXn8dXhiMG9NWmRu3bHdPDdESnKbKliHHfmfT2jrGCdGFH+ MYW2HTZgVBwKZUZae/bNA20AXlU2reGqYe+6XZcAdNtcFbv+3yoNcCHPve6BOdnAgJKv JRjHEijfPsbLgbcoB7QQZW0AiEIvhCnK7RLs212WMDuo9IafTmltUmLgc+x2RSJ3RKYR 2BuMaHU6j9bqQEk6pu2vZvoeHmy5WA38Ct36CImBUYMy7felZligaOK4JLnOdDHTP0WQ K3Fw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=HP3EJZHs; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id m4si10070657edq.159.2020.06.08.22.34.42; Mon, 08 Jun 2020 22:35:06 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=HP3EJZHs; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726937AbgFIFcz (ORCPT + 99 others); Tue, 9 Jun 2020 01:32:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40446 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725770AbgFIFcy (ORCPT ); Tue, 9 Jun 2020 01:32:54 -0400 Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A007DC03E969 for ; Mon, 8 Jun 2020 22:32:54 -0700 (PDT) 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=FL0M/QWy7eJQyyMOSmjXi3woft307nJ4/y9AHPp9mF4=; b=HP3EJZHs4fnGFlTQdX6LMz/GIa bSfR+JET4LFjuYGuWG9qBSm5opYzFLVYxCRL6EvujYiT9fQwNi5kKC+kle9gcTXgtAGwKtSiU7oTo y7oatcw9RVnoMIZk9Gsia2dCXJnkDuLUghD5k8mi1PYCujFitvknMSBBTJRA6AYfQQoTKtA9vn9Kk hUBdwJs9JLAScnD2/NsMsz54emEsj+DllsCn9H1MprXIHKnmphYIKih3JtNRnP7ZvOsvp5ttJAKUw fcxmZBTL3GYqVCckLgHUFdous+H9PxIHzrbo1stVXGLSmcBzfhlcdf1v2Mfosc3sfJfA+B8k0Ej++ +N7zU+nA==; Received: from hch by bombadil.infradead.org with local (Exim 4.92.3 #3 (Red Hat Linux)) id 1jiWsK-0003vo-EC; Tue, 09 Jun 2020 05:32:40 +0000 Date: Mon, 8 Jun 2020 22:32:40 -0700 From: Christoph Hellwig To: Stefano Stabellini Cc: Christoph Hellwig , jgross@suse.com, boris.ostrovsky@oracle.com, konrad.wilk@oracle.com, xen-devel@lists.xenproject.org, linux-kernel@vger.kernel.org, tamas@tklengyel.com, roman@zededa.com, Stefano Stabellini Subject: Re: [PATCH v2 08/11] swiotlb-xen: introduce phys_to_dma/dma_to_phys translations Message-ID: <20200609053240.GA3015@infradead.org> References: <20200603222247.11681-8-sstabellini@kernel.org> <20200608070850.GD15742@infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jun 08, 2020 at 04:06:57PM -0700, Stefano Stabellini wrote: > I understand what you are suggesting about having something like: > > xen_phys_to_dma(...) > { > phys_addr_t phys = xen_phys_to_bus(dev, paddr) > return phys_to_dma(phys); > } > > I thought about it myself. I'll do it. "something", yes. Except that I think the bus is a little confusing, isn't it? What is the Xen term for these addresses? Also we probably don't need the extra local variable. > But I don't think I understood the comment about XEN_PFN_PHYS. There is a comment above xen_phys_to_bus that it avoids using XEN_PFN_PHYS because XEN_PFN_PHYS of the phys_addr_t vs dma_addr_t mismatch. But XEN_PFN_PHYS could just use a u64 instead of the phys_addr_t and then we could use it. Especially as XEN_PFN_PHYS isn't actually used anywhere except in swiotlb-xen.c. Or we could remove XEN_PFN_PHYS enirely, as it isn't all that useful to start with.