Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp3833853iog; Tue, 28 Jun 2022 03:52:11 -0700 (PDT) X-Google-Smtp-Source: AGRyM1u6TJBwbcmz7RgaCsT9pFzrMNFfQN84EmBZSu86rahRFAohB2D6rjd0ErcDbDt0vx1CCQtN X-Received: by 2002:a17:907:7747:b0:6f3:ead4:abcb with SMTP id kx7-20020a170907774700b006f3ead4abcbmr17293971ejc.296.1656413530786; Tue, 28 Jun 2022 03:52:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1656413530; cv=none; d=google.com; s=arc-20160816; b=IasV80n+J2MPOlp+1njfRhEqMOFWyn+RhyElxjUKcCKqU+EOX+MgvkI2d6IYcK4z6Y aNxQ3chld9GPy1of2UzZX+FlYJF54NoJw8+fwjusZc0ggYtocBonBW3kFjefSOeDMr16 dN+Wcq0cMoZoCh8sP1RWqVScKpbMNcZOgKewNpgOehi6Ufq3/UTcnFPuF9B/Ade8l9r3 KQJgB+82s/3d18LcrOligKzbZp1gVuwQi0DjxVt5lgEljnse43+U9+UfNc1VXT7qqdiV UHfMW+0tk2vFzqTrcy7uTREjNDJjIAtk5faVhfrUEVrEqWHAfmvvz9uPAjS6R/bV+sUN b+DQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:to:content-language:subject:cc:user-agent:mime-version :date:message-id:dkim-signature; bh=TKEZo/BuNAY05Ks2YcCS0C3KEyeTOJWg1P9x5Ykqgm4=; b=Mfoansa6W+hZ73QaeLOSTAq1ZGnZ3M6AmCjsI8It9egfnQ+BbMtlUhoE1zrEAa+Nu8 sjdKWvCbpW0uyNzcOURg2t6E2ep5W+0wh6azWdtOOlWxrkliB7AlsJ3eJWfupeUIxptF 4EPmKgYluvPa2cfzv4nofwVgpY2MBbdbwOgGSEilZLwXv45d1pEM8q4Tih+/7MS0gXgY HOdkFG/PvePdGhwkG/7ysIfypH8stEAIKHvhoz89bBluUjgBoDnJ+z/OCQ8uFr6f00aS xLsWfDsdv9UXVCiviyP44sBErh3DIb/EKjeBnc5jUswjtK14gYcuQJ5WjRnvqbMJbcXJ u/Bw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=WavxV4n3; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id hv20-20020a17090760d400b007120a60b38asi3351881ejc.1001.2022.06.28.03.51.41; Tue, 28 Jun 2022 03:52:10 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=WavxV4n3; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345079AbiF1Ktf (ORCPT + 99 others); Tue, 28 Jun 2022 06:49:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49232 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345086AbiF1Ktd (ORCPT ); Tue, 28 Jun 2022 06:49:33 -0400 Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1D5A3DFF8 for ; Tue, 28 Jun 2022 03:49:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1656413372; x=1687949372; h=message-id:date:mime-version:cc:subject:to:references: from:in-reply-to:content-transfer-encoding; bh=ozYJ2T8okmfO8Th4y6FGXh53KS7mtcLx/ds3l3ySpzI=; b=WavxV4n3h4Ns9F3p0BzezRxJuhXIvx/GC+aqZ74AT11+T9nZaAU5MCAM 0kEY0cRZSiSqPXjMBzfnZQxwxeMG4Cv9vxrjMLXHekDJG5QmkWurFEVky SEZNsLcqOXpt4w6w5ATyN2pVE0/ycy38nrpfHEuMTQ4D6CPbdUrGQUQo7 s/lGPFvX1k6vRfjS3OykhRKlXujBLPX9KaxZ5HycmS9zHxXe/+58deA8A dvGp7NbvXXblxD9GJtKXh3jWdijKJxFzErtO53GEUq3ra8bFkA6sEl9w0 84mZ+Lpuqp/b37mZ2Vdfzsb3/WIsEcgS84YzNge+gpzQMSnpm6kEVdiyi Q==; X-IronPort-AV: E=McAfee;i="6400,9594,10391"; a="279253155" X-IronPort-AV: E=Sophos;i="5.92,227,1650956400"; d="scan'208";a="279253155" Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 Jun 2022 03:49:31 -0700 X-IronPort-AV: E=Sophos;i="5.92,227,1650956400"; d="scan'208";a="646863531" Received: from ltang11-mobl1.ccr.corp.intel.com (HELO [10.249.169.64]) ([10.249.169.64]) by fmsmga008-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 Jun 2022 03:49:27 -0700 Message-ID: <2d516d37-960f-ed88-4395-6f5d58aa0009@linux.intel.com> Date: Tue, 28 Jun 2022 18:49:25 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.9.1 Cc: baolu.lu@linux.intel.com, Eric Auger , "Liu, Yi L" , "Pan, Jacob jun" , "iommu@lists.linux-foundation.org" , "iommu@lists.linux.dev" , "linux-kernel@vger.kernel.org" , Jean-Philippe Brucker Subject: Re: [PATCH v9 09/11] iommu: Prepare IOMMU domain for IOPF Content-Language: en-US To: "Tian, Kevin" , Joerg Roedel , Jason Gunthorpe , Christoph Hellwig , "Raj, Ashok" , Will Deacon , Robin Murphy , Jean-Philippe Brucker , "Jiang, Dave" , Vinod Koul References: <20220621144353.17547-1-baolu.lu@linux.intel.com> <20220621144353.17547-10-baolu.lu@linux.intel.com> From: Baolu Lu In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-7.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2022/6/28 16:29, Tian, Kevin wrote: >> From: Lu Baolu >> Sent: Tuesday, June 21, 2022 10:44 PM >> +/* >> + * I/O page fault handler for SVA >> + */ >> +enum iommu_page_response_code >> +iommu_sva_handle_iopf(struct iommu_fault *fault, void *data) >> +{ >> + vm_fault_t ret; >> + struct mm_struct *mm; >> + struct vm_area_struct *vma; >> + unsigned int access_flags = 0; >> + struct iommu_domain *domain = data; >> + unsigned int fault_flags = FAULT_FLAG_REMOTE; >> + struct iommu_fault_page_request *prm = &fault->prm; >> + enum iommu_page_response_code status = >> IOMMU_PAGE_RESP_INVALID; >> + >> + if (!(prm->flags & IOMMU_FAULT_PAGE_REQUEST_PASID_VALID)) >> + return status; >> + >> + mm = domain->mm; > > What about directly passing domain->mm in as the fault data? > > The entire logic here is only about mm instead of domain. Yes. Updated. Best regards, baolu