Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp1404192ybl; Thu, 5 Dec 2019 00:30:33 -0800 (PST) X-Google-Smtp-Source: APXvYqyjGxCvLT58DhyUOdLGxTceUi8Ez6DPs2YYbG+0yBw8nvpB8/jsDo7Qkq+fDDMtf0BSVz2j X-Received: by 2002:a05:6830:2116:: with SMTP id i22mr6069523otc.0.1575534633730; Thu, 05 Dec 2019 00:30:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1575534633; cv=none; d=google.com; s=arc-20160816; b=c1wFh5/WPY0qP0TvD+h+YYRbHH5knLl1O8wrSm3YOttrkFHUKnDvCdD6GfynePnXLj 2IynLA0maR3Nz8yeN2XkNddj3MI2V4lPnjQAc0rO2SWQKbdQymLY3y24ZV+xy9cjT2hb QC1x3uys24oADxwehnSYnuGfDJlTb5fu0bukoKSsJY50PIowWWhrdVEb5z3SyJqQj6fd HHacq28NcI5AkQGOzAT9T99TCz5sTL1cAxFF0/Mjr1TfwD5eu+QwkjvFNSBYS8S45Uc/ Arf0X71J9HWird54piXY44e5Ae0wOcBEDE/IbKpJ6Vx4Us8dd+Ytdo81UBhjsTeiKvU7 1RgQ== 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=/X87PHX/riL8P6MVWt6s7sbYiWDjmQTAQ1I2AyNE9K0=; b=ETju0wyISmGM0CkdZagUl/uQ367NoImElojvJW9/letHpDO4FQNvtuMBf1bFH+LQGY DWtwhiKLFc+i41KMDEy4NnDAu1PV2Fkj4N6Gh49CYqlFcI0yX9iW2NHP8EZatTMsrlLh 6GpCt+Tthou9X8H9WZVdwm9ZClyZNGYYotdxxnSMfN08J7+gr1DpGpZ9pXXEPt2yEQtO xsGWfeWYkT6uTVu3uv9JRmQPZ9pqKOoi6ni0kuhGHUlqtbAxE+EclG1uDt21/EEbTFrB gEr5qRGlAqVVf55HdtxpPR2nieDhNN7RmdpayCVUcF8lJNbX8d33mou4Pgo66li7+leb bLxQ== 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 r132si4341736oig.263.2019.12.05.00.30.21; Thu, 05 Dec 2019 00:30:33 -0800 (PST) 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 S1728921AbfLEI2p (ORCPT + 99 others); Thu, 5 Dec 2019 03:28:45 -0500 Received: from verein.lst.de ([213.95.11.211]:54012 "EHLO verein.lst.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726059AbfLEI2p (ORCPT ); Thu, 5 Dec 2019 03:28:45 -0500 Received: by verein.lst.de (Postfix, from userid 2407) id 4D04768C4E; Thu, 5 Dec 2019 09:28:38 +0100 (CET) Date: Thu, 5 Dec 2019 09:28:37 +0100 From: Christoph Hellwig To: Ram Pai Cc: David Gibson , Alexey Kardashevskiy , linuxppc-dev@lists.ozlabs.org, mpe@ellerman.id.au, benh@kernel.crashing.org, paulus@ozlabs.org, mdroth@linux.vnet.ibm.com, hch@lst.de, andmike@us.ibm.com, sukadev@linux.vnet.ibm.com, mst@redhat.com, ram.n.pai@gmail.com, cai@lca.pw, tglx@linutronix.de, bauerman@linux.ibm.com, linux-kernel@vger.kernel.org Subject: Re: [PATCH v4 1/2] powerpc/pseries/iommu: Share the per-cpu TCE page with the hypervisor. Message-ID: <20191205082837.GA20298@lst.de> References: <20191203020850.GA12354@oc0525413822.ibm.com> <0b56ce3e-6c32-5f3b-e7cc-0d419a61d71d@ozlabs.ru> <20191203040509.GB12354@oc0525413822.ibm.com> <20191203165204.GA5079@oc0525413822.ibm.com> <3a17372a-fcee-efbf-0a05-282ffb1adc90@ozlabs.ru> <20191204004958.GB5063@oc0525413822.ibm.com> <5963ff32-2119-be7c-d1e5-63457888a73b@ozlabs.ru> <20191204033618.GA5031@umbus.fritz.box> <20191204204232.GE5063@oc0525413822.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20191204204232.GE5063@oc0525413822.ibm.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 Wed, Dec 04, 2019 at 12:42:32PM -0800, Ram Pai wrote: > > The other approach we could use for that - which would still allow > > H_PUT_TCE_INDIRECT, would be to allocate the TCE buffer page from the > > same pool that we use for the bounce buffers. I assume there must > > already be some sort of allocator for that? > > The allocator for swiotlb is buried deep in the swiotlb code. It is > not exposed to the outside-swiotlb world. Will have to do major surgery > to expose it. I don't think it would require all that much changes, but I'd really hate the layering of calling into it directly. Do we have a struct device associated with the iommu that doesn't get iommu translations themselves? If we do a dma_alloc_coherent on that you'll get the memory pool for free.