From mboxrd@z Thu Jan 1 00:00:00 1970 From: Robin Murphy Subject: Re: How to ensure that different peripherals getting different IOVA address in kernel? Date: Wed, 23 Sep 2015 13:08:28 +0100 Message-ID: <5602963C.8030601@arm.com> References: <5600AF72.2000106@hisilicon.com> <560206AE.4020608@hisilicon.com> Mime-Version: 1.0 Content-Type: text/plain; charset="utf-8"; Format="flowed" Content-Transfer-Encoding: base64 Return-path: In-Reply-To: <560206AE.4020608-C8/M+/jPZTeaMJb+Lgu22Q@public.gmane.org> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: iommu-bounces-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org Errors-To: iommu-bounces-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org To: chenfeng , "joro-zLv9SwRftAIdnm+yROfE0A@public.gmane.org" , "iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org" , "linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org" , "rcallicotte-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org" , "jiang.liu-VuQAYsv1563Yd54FQh9/CA@public.gmane.org" Cc: Dan zhao , "Wangfei (William, Euler)" , Suzhuangluan , qijiwen , Peter Panshilin List-Id: iommu@lists.linux-foundation.org T24gMjMvMDkvMTUgMDI6NTUsIGNoZW5mZW5nIHdyb3RlOgo+IEhpIGFsbCwKPgo+IEluIElPTU1V IGFyY2hpdGVjdHVyZSAsIGhvdyB0byBtYWtlIHR3byBkaWZmZXJlbnQgcGVyaXBoZXJhbHMgc2hh cmUgdGhlIHNhbWUgcGFnZSB0YWJsZSA/Cj4KPiBJbiBvdGhlciB3b3JkcyAsIGlzIHRoZXJlIGEg bWVjaGFuaXNtIG9yIHN0cnVjdHVyZSB0byBtYWtlIHR3byBwZXJpcGhlcmFscyBnZXQgY29tcGxl dGVseSBkaWZmZXJlbnQgYWRkcmVzcy4KPgo+IGVnOgo+Cj4gcGVyaS1B44CBcGVyaS1CIGFuZCBw ZXJpLUMgc2hhcmUgdGhlIHNhbWUgaW92YSBhZGRyZXNzIDAtMUcgZm9yIHNvbWUgcGVyZm9ybWFu Y2UgcmVxdWVzdHMuCj4KPiBTbyB0aGUgQSxCLEMgbmVlZCB0byB1c2UgdGhlIHNhbWUgSU9WQSBn ZW5lcmF0b3IgdG8gZW5zdXJlIHRoaXMsYnV0IEkgZG9uJ3QgZmluZCBhbiBhcmNoaXRlY3R1cmUg dG8gbWFrZSB0aGlzLgoKVGhpcyBpcyB3aGF0IElPTU1VIGRvbWFpbnMgYXJlIGFsbCBhYm91dDog ZGV2aWNlcyBpbiBvbmUgZG9tYWluIGFyZSAKaXNvbGF0ZWQgZnJvbSBkZXZpY2VzIGluIGRpZmZl cmVudCBkb21haW5zLCBzbyBhbGwgeW91IG5lZWQgdG8gZG8gaXMgCm1ha2Ugc3VyZSBhbGwgZGV2 aWNlcyB0aGF0IHdhbnQgdG8gc2hhcmUgYnVmZmVycyBhcmUgYXR0YWNoZWQgdG8gdGhlIApzYW1l IGRvbWFpbiwgdGhlbiB0aGV5IHdpbGwgYWxsIHNoYXJlIHRoYXQgZG9tYWluJ3MgSU9WQSBzcGFj ZS4KClJvYmluLgoKPgo+IEFueSBoZWxwIHdpbGwgYmUgYXBwcmVjaWF0ZWQuCj4KPiBQdWNrCj4K PgoKX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX18KaW9tbXUg bWFpbGluZyBsaXN0CmlvbW11QGxpc3RzLmxpbnV4LWZvdW5kYXRpb24ub3JnCmh0dHBzOi8vbGlz dHMubGludXhmb3VuZGF0aW9uLm9yZy9tYWlsbWFuL2xpc3RpbmZvL2lvbW11 From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754462AbbIWMId (ORCPT ); Wed, 23 Sep 2015 08:08:33 -0400 Received: from eu-smtp-delivery-143.mimecast.com ([207.82.80.143]:56185 "EHLO eu-smtp-delivery-143.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753467AbbIWMIb convert rfc822-to-8bit (ORCPT ); Wed, 23 Sep 2015 08:08:31 -0400 Subject: Re: How to ensure that different peripherals getting different IOVA address in kernel? To: chenfeng , "joro@8bytes.org" , "iommu@lists.linux-foundation.org" , "linux-kernel@vger.kernel.org" , "rcallicotte@gmail.com" , "jiang.liu@linux.intel.com" References: <5600AF72.2000106@hisilicon.com> <560206AE.4020608@hisilicon.com> Cc: Dan zhao , qijiwen , Peter Panshilin , Suzhuangluan , Yiping Xu , "Wangfei (William, Euler)" From: Robin Murphy Message-ID: <5602963C.8030601@arm.com> Date: Wed, 23 Sep 2015 13:08:28 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.2.0 MIME-Version: 1.0 In-Reply-To: <560206AE.4020608@hisilicon.com> X-OriginalArrivalTime: 23 Sep 2015 12:08:28.0711 (UTC) FILETIME=[8E9D4370:01D0F5F8] X-MC-Unique: IEot0qb_SMW6eOZ4BdvIcA-1 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8BIT Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 23/09/15 02:55, chenfeng wrote: > Hi all, > > In IOMMU architecture , how to make two different peripherals share the same page table ? > > In other words , is there a mechanism or structure to make two peripherals get completely different address. > > eg: > > peri-A、peri-B and peri-C share the same iova address 0-1G for some performance requests. > > So the A,B,C need to use the same IOVA generator to ensure this,but I don't find an architecture to make this. This is what IOMMU domains are all about: devices in one domain are isolated from devices in different domains, so all you need to do is make sure all devices that want to share buffers are attached to the same domain, then they will all share that domain's IOVA space. Robin. > > Any help will be appreciated. > > Puck > >