From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Matwey V. Kornilov" Subject: IOMMU, DMA and legacy PCI board Date: Fri, 15 Jan 2016 18:41:49 +0300 Message-ID: Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit To: kvm@vger.kernel.org Return-path: Received: from plane.gmane.org ([80.91.229.3]:56241 "EHLO plane.gmane.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750779AbcAOPl7 (ORCPT ); Fri, 15 Jan 2016 10:41:59 -0500 Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1aK6Vh-0005JA-HB for kvm@vger.kernel.org; Fri, 15 Jan 2016 16:41:57 +0100 Received: from 92.243.181.209 ([92.243.181.209]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 15 Jan 2016 16:41:57 +0100 Received: from matwey.kornilov by 92.243.181.209 with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 15 Jan 2016 16:41:57 +0100 Sender: kvm-owner@vger.kernel.org List-ID: Hello, I am sorry, if I am asking this in a wrong place. I have an legacy custom PCI board, which requires contiguous DMA memory region (about 4 MB) and does not support scatter/gather. As contiguous DMA region cannot be allocated with the guaranty, currently, the issue is solved by using mem= kernel command line argument and using 'hidden memory' within first 3GB of RAM. Happily, I have the kernel module source codes. I am not quite familiar with the internals of IOMMU. The question is the following. Is it possible to use IOMMU to emulate contiguous DMA region consisted of smaller chunks on the other side? If it is possible in theory, how could my PCI device driver use existing kernel API to implement this? Thank you.