From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jean-Philippe Brucker Subject: Re: [PATCH 04/37] iommu/sva: Add a mm_exit callback for device drivers Date: Tue, 13 Feb 2018 12:57:56 +0000 Message-ID: <7c4e5d24-6560-44a8-2bdc-890cd06603b3@arm.com> References: <20180212183352.22730-1-jean-philippe.brucker@arm.com> <20180212183352.22730-5-jean-philippe.brucker@arm.com> Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Return-path: Received: from usa-sjc-mx-foss1.foss.arm.com ([217.140.101.70]:56812 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S935111AbeBMMyR (ORCPT ); Tue, 13 Feb 2018 07:54:17 -0500 In-Reply-To: Content-Language: en-US Sender: linux-acpi-owner@vger.kernel.org List-Id: linux-acpi@vger.kernel.org To: "Tian, Kevin" , "linux-arm-kernel@lists.infradead.org" , "linux-pci@vger.kernel.org" , "linux-acpi@vger.kernel.org" , "devicetree@vger.kernel.org" , "iommu@lists.linux-foundation.org" , "kvm@vger.kernel.org" Cc: "joro@8bytes.org" , "robh+dt@kernel.org" , Mark Rutland , Catalin Marinas , Will Deacon , Lorenzo Pieralisi , "hanjun.guo@linaro.org" , Sudeep Holla , "rjw@rjwysocki.net" , "lenb@kernel.org" , Robin Murphy , "bhelgaas@google.com" , "alex.williamson@redhat.com" , "tn@semihalf.com" , "liubo95@huawei.com" , "thunder.leizhen@huawei.com" , "xieyisheng1@huawei.com" "xuzaibo@huawei.com" On 13/02/18 08:11, Tian, Kevin wrote: >> From: Jean-Philippe Brucker >> Sent: Tuesday, February 13, 2018 2:33 AM >> >> When an mm exits, devices that were bound to it must stop performing >> DMA >> on its PASID. Let device drivers register a callback to be notified on mm >> exit. Add the callback to the iommu_param structure attached to struct >> device. > > what about registering the callback in sva_device_init? I don't have a preference. This way it look like iommu_register_device_fault_handler, but adding the callback to sva_device_init makes sense too. Thanks, Jean From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Return-Path: Subject: Re: [PATCH 04/37] iommu/sva: Add a mm_exit callback for device drivers To: "Tian, Kevin" , "linux-arm-kernel@lists.infradead.org" , "linux-pci@vger.kernel.org" , "linux-acpi@vger.kernel.org" , "devicetree@vger.kernel.org" , "iommu@lists.linux-foundation.org" , "kvm@vger.kernel.org" References: <20180212183352.22730-1-jean-philippe.brucker@arm.com> <20180212183352.22730-5-jean-philippe.brucker@arm.com> From: Jean-Philippe Brucker Message-ID: <7c4e5d24-6560-44a8-2bdc-890cd06603b3@arm.com> Date: Tue, 13 Feb 2018 12:57:56 +0000 MIME-Version: 1.0 In-Reply-To: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Mark Rutland , "xieyisheng1@huawei.com" , "ilias.apalodimas@linaro.org" , Catalin Marinas , "xuzaibo@huawei.com" , "jonathan.cameron@huawei.com" , Will Deacon , "okaya@codeaurora.org" , "Liu, Yi L" , Lorenzo Pieralisi , "Raj, Ashok" , "tn@semihalf.com" , "joro@8bytes.org" , "bharatku@xilinx.com" , "rfranz@cavium.com" , "lenb@kernel.org" , "jacob.jun.pan@linux.intel.com" , "alex.williamson@redhat.com" , "robh+dt@kernel.org" , "thunder.leizhen@huawei.com" , "bhelgaas@google.com" , "shunyong.yang@hxt-semitech.com" , "dwmw2@infradead.org" , "liubo95@huawei.com" , "rjw@rjwysocki.net" , "jcrouse@codeaurora.org" , "robdclark@gmail.com" , "hanjun.guo@linaro.org" , Sudeep Holla , Robin Murphy , "christian.koenig@amd.com" , "nwatters@codeaurora.org" Content-Type: text/plain; charset="us-ascii" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+bjorn=helgaas.com@lists.infradead.org List-ID: On 13/02/18 08:11, Tian, Kevin wrote: >> From: Jean-Philippe Brucker >> Sent: Tuesday, February 13, 2018 2:33 AM >> >> When an mm exits, devices that were bound to it must stop performing >> DMA >> on its PASID. Let device drivers register a callback to be notified on mm >> exit. Add the callback to the iommu_param structure attached to struct >> device. > > what about registering the callback in sva_device_init? I don't have a preference. This way it look like iommu_register_device_fault_handler, but adding the callback to sva_device_init makes sense too. Thanks, Jean _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jean-Philippe Brucker Subject: Re: [PATCH 04/37] iommu/sva: Add a mm_exit callback for device drivers Date: Tue, 13 Feb 2018 12:57:56 +0000 Message-ID: <7c4e5d24-6560-44a8-2bdc-890cd06603b3@arm.com> References: <20180212183352.22730-1-jean-philippe.brucker@arm.com> <20180212183352.22730-5-jean-philippe.brucker@arm.com> Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Cc: "joro@8bytes.org" , "robh+dt@kernel.org" , Mark Rutland , Catalin Marinas , Will Deacon , Lorenzo Pieralisi , "hanjun.guo@linaro.org" , Sudeep Holla , "rjw@rjwysocki.net" , "lenb@kernel.org" , Robin Murphy , "bhelgaas@google.com" , "alex.williamson@redhat.com" , "tn@semihalf.com" , "liubo95@huawei.com" , "thunder.leizhen@huawei.com" , "xieyisheng1@huawei.com" , "xuzaibo@huawei.com" , "linux-arm-kernel@lists.infradead.org" , "linux-pci@vger.kernel.org" , "linux-acpi@vger.kernel.org" , "devicetree@vger.kernel.org" , "iommu@lists.linux-foundation.org" , "kvm@vger.kernel.org" Return-path: In-Reply-To: Content-Language: en-US Sender: linux-acpi-owner@vger.kernel.org List-Id: kvm.vger.kernel.org On 13/02/18 08:11, Tian, Kevin wrote: >> From: Jean-Philippe Brucker >> Sent: Tuesday, February 13, 2018 2:33 AM >> >> When an mm exits, devices that were bound to it must stop performing >> DMA >> on its PASID. Let device drivers register a callback to be notified on mm >> exit. Add the callback to the iommu_param structure attached to struct >> device. > > what about registering the callback in sva_device_init? I don't have a preference. This way it look like iommu_register_device_fault_handler, but adding the callback to sva_device_init makes sense too. Thanks, Jean From mboxrd@z Thu Jan 1 00:00:00 1970 From: jean-philippe.brucker@arm.com (Jean-Philippe Brucker) Date: Tue, 13 Feb 2018 12:57:56 +0000 Subject: [PATCH 04/37] iommu/sva: Add a mm_exit callback for device drivers In-Reply-To: References: <20180212183352.22730-1-jean-philippe.brucker@arm.com> <20180212183352.22730-5-jean-philippe.brucker@arm.com> Message-ID: <7c4e5d24-6560-44a8-2bdc-890cd06603b3@arm.com> To: linux-arm-kernel@lists.infradead.org List-Id: linux-arm-kernel.lists.infradead.org On 13/02/18 08:11, Tian, Kevin wrote: >> From: Jean-Philippe Brucker >> Sent: Tuesday, February 13, 2018 2:33 AM >> >> When an mm exits, devices that were bound to it must stop performing >> DMA >> on its PASID. Let device drivers register a callback to be notified on mm >> exit. Add the callback to the iommu_param structure attached to struct >> device. > > what about registering the callback in sva_device_init? I don't have a preference. This way it look like iommu_register_device_fault_handler, but adding the callback to sva_device_init makes sense too. Thanks, Jean