Received: by 10.192.165.148 with SMTP id m20csp186672imm; Wed, 9 May 2018 10:52:54 -0700 (PDT) X-Google-Smtp-Source: AB8JxZopKsa8LxO71o4Kpm2084XoAxQhWZpHJ1F7yOuc1HG446hUpZIcJITJ5Ga+7cKJO2Qn4qLD X-Received: by 2002:a65:590e:: with SMTP id f14-v6mr36788633pgu.282.1525888374668; Wed, 09 May 2018 10:52:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1525888374; cv=none; d=google.com; s=arc-20160816; b=pFtjFNRYEZ2bhzgY/3IkGmLHlaYXt/WjYrNbpb3+2t15hS33tNP4M9uoF6/wakiZNk clFt5CcXdNP8BTQCw5pwEOq5aJ2hpGgJM4cujqbTYhdU/w52qNYAOpIqeafR3LP08/OU RFgawUlQuONGGBR76Q7D5FK+3S2eP6OJtCfcAfB0JPuvMut1XiB+1PPQEwkjzxFIUPVV ifVt5f++VYCirOTAECPJFAfHDlc1+vYdz7N1BajXZdsH5/dQ/hnezQIaY7Xu0eZCM+XI XbjwfiQ77KZUP0Mw64J6kY230kkFmUT2uQkUcBZq8wJ7rPHinhPNh4otJeweoV7gz+Vj rG8A== 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-transfer-encoding:content-disposition:mime-version :references:message-id:subject:cc:to:from:date :arc-authentication-results; bh=a7XuuqwMuBD4SUjPKiurzG9snM1gdQcFTWL7AfFq8HU=; b=n9Qr9GVzr5dsVHzAsuWKYgYwbmY2SsjnAt1Osb1p/Dopl192XlWPcFm7iovceQ52wr fCUSsIdn/1lTgJvivgHr02eMsG5jxoARKNrnB/++VQH7OQrnwC6EM/mDRWXDr6ngauSF VY29CraolGc20VQt6egpJuOl8dthrIQu2xiQJQKm2UX4fyV88RMOxLJ4Ctn/lmHfcGQq 2rTGoEZdgNfENLhi4OE+4iaxysMoDgmHjXU20HHGGhDpHUc+qGfFoFkkDymHOT8zt2Js PoYBOA/qzU+iEHsJH0HaEBw4meeYtT1bIs/Ndq2LK9LhbCQQmAZeCWdvIfLvethrt84S qAoA== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 89si27176484pfs.362.2018.05.09.10.52.40; Wed, 09 May 2018 10:52:54 -0700 (PDT) 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S935339AbeEIRuC (ORCPT + 99 others); Wed, 9 May 2018 13:50:02 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:50730 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S933555AbeEIRuA (ORCPT ); Wed, 9 May 2018 13:50:00 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 2ABE14029860; Wed, 9 May 2018 17:49:59 +0000 (UTC) Received: from redhat.com (ovpn-124-119.rdu2.redhat.com [10.10.124.119]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 91E5AD74DB; Wed, 9 May 2018 17:49:54 +0000 (UTC) Date: Wed, 9 May 2018 13:49:53 -0400 From: Jerome Glisse To: Stephen Bates Cc: Christian =?iso-8859-1?Q?K=F6nig?= , Logan Gunthorpe , Alex Williamson , Bjorn Helgaas , "linux-kernel@vger.kernel.org" , "linux-pci@vger.kernel.org" , "linux-nvme@lists.infradead.org" , "linux-rdma@vger.kernel.org" , "linux-nvdimm@lists.01.org" , "linux-block@vger.kernel.org" , Christoph Hellwig , Jens Axboe , Keith Busch , Sagi Grimberg , Bjorn Helgaas , Jason Gunthorpe , Max Gurtovoy , Dan Williams , Benjamin Herrenschmidt Subject: Re: [PATCH v4 04/14] PCI/P2PDMA: Clear ACS P2P flags for all devices behind switches Message-ID: <20180509174952.GC4140@redhat.com> References: <20180508133407.57a46902@w520.home> <5fc9b1c1-9208-06cc-0ec5-1f54c2520494@deltatee.com> <20180508141331.7cd737cb@w520.home> <20180508205005.GC15608@redhat.com> <7FFB9603-DF9F-4441-82E9-46037CB6C0DE@raithlin.com> <1775CC56-4651-422F-953A-18E024D3717C@raithlin.com> <20180509160722.GB4140@redhat.com> <366A8132-B88A-40F7-BDE3-DA542E45FC0C@raithlin.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <366A8132-B88A-40F7-BDE3-DA542E45FC0C@raithlin.com> User-Agent: Mutt/1.9.2 (2017-12-15) X-Scanned-By: MIMEDefang 2.79 on 10.11.54.5 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.6]); Wed, 09 May 2018 17:49:59 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.6]); Wed, 09 May 2018 17:49:59 +0000 (UTC) for IP:'10.11.54.5' DOMAIN:'int-mx05.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'jglisse@redhat.com' RCPT:'' Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, May 09, 2018 at 04:30:32PM +0000, Stephen Bates wrote: > Hi Jerome > > > Now inside that page table you can point GPU virtual address > > to use GPU memory or use system memory. Those system memory entry can > > also be mark as ATS against a given PASID. > > Thanks. This all makes sense. > > But do you have examples of this in a kernel driver (if so can you point me too it) or is this all done via user-space? Based on my grepping of the kernel code I see zero EP drivers using in-kernel ATS functionality right now... > As it is tie to PASID this is done using IOMMU so looks for caller of amd_iommu_bind_pasid() or intel_svm_bind_mm() in GPU the existing user is the AMD GPU driver see: drivers/gpu/drm/amd/ drivers/gpu/drm/amd/amdkfd/ drivers/gpu/drm/amd/amdgpu/ Lot of codes there. The GPU code details do not really matter for this discussions thought. You do not need to do much to use PASID. Cheers, J?r?me