From mboxrd@z Thu Jan 1 00:00:00 1970 From: Christoph Hellwig Subject: Re: Requirement to get BAR pci_bus_address in user space Date: Thu, 14 Jun 2018 16:59:42 +0200 Message-ID: <20180614145942.GA4885@lst.de> References: <20180614102001.GA20836@lst.de> <92a9eeced36f863458ca2fd029f17a20@codeaurora.org> <20180614085015.3f39b367@w520.home> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Srinath Mannam , Sinan Kaya , Christoph Hellwig , Bjorn Helgaas , Abhishek Shah , Vikram Prakash , linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org, linux-nvme@lists.infradead.org, kvm@vger.kernel.org, linux-pci-owner@vger.kernel.org To: Alex Williamson Return-path: Content-Disposition: inline In-Reply-To: <20180614085015.3f39b367@w520.home> Sender: linux-kernel-owner@vger.kernel.org List-Id: kvm.vger.kernel.org On Thu, Jun 14, 2018 at 08:50:15AM -0600, Alex Williamson wrote: > I don't understand the CQ vs CMB, but I think I gather that there's some > sort of buffer that's allocated from within the devices MMIO BAR and > some programming of the device needs to reference that buffer. > Wouldn't you therefore use the vfio type1 IOMMU MAP_DMA ioctl to map > the BAR into the IOVA address space and you can then use the IOVA + > offset into the BAR for the device to reference the buffer? It seems > this is the same way we'd setup a peer-to-peer mapping, but we're using > it for the device to reference itself effectively. Thanks, That's exactly what I meant..