Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp1506241iob; Fri, 29 Apr 2022 06:54:35 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxF4Buqn3MrYWp93LB0OreUrRK3fWnChaZ5Hd48ZdKwAInUHBwagIJx1gPh6UrvfEC2r1es X-Received: by 2002:a05:6a00:10d0:b0:4f7:5af4:47b6 with SMTP id d16-20020a056a0010d000b004f75af447b6mr39858735pfu.6.1651240474906; Fri, 29 Apr 2022 06:54:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1651240474; cv=none; d=google.com; s=arc-20160816; b=w+ptwypIx1eJB2+RqyxFqtmBJBh1SDTunl/xVatWCPGzouJrRl8DZv23eSoxlYI6WT LzsoAJscPQNTJGu0sOiJH85jWmuNaPTJcOGVX1m0lzNA5Wv0/uN2o4ttq9cmVtpY8Vn8 Xaj5d9JRcaFSSs7K+tJlGuN3TvSHihVyivB4swCXwgfiPnpXEpoxpPbB5Jd53j1iXygh aAQOL4mOUkdzpa2lUDkvsdH0tn5JE3kRoUaGBJcVxk+wViSMEY3r3aiynAh+v02oA49y knxcNYpMVuE7bA4Vr45CazeXbt2jsv0V295it06ioySzCw7tufNwaIq7zoSmVqYLcHj3 Sl0A== 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:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=W84OdRvQ92Nm1DlzWQrzJZ/Z3+7aN2Eij1nEnFRnnFc=; b=DkU0MVu+/1od6gp3PPC1pPgd9k6f8NkZ3SSFaGXc2st8wXwSya9GGzhFcgNinJTAS1 8K8Q1spNKtVPmoMdy8SwtbhLJscWHgaXLkzMSJOj2ohfql5dJdsGpd74/8tCjK1WFOkR zYVe+BU4YLxt24gni4T00r5fjrDWeCthXIFut++S8xPO5rdyQxBBl8ciUDMdPn0gru7y 1pW5J9dDPV1O3lQF0HhhzF76/nsDa4UqtXM+rKXu2IqvwlVAgjmFDT0DR97tMDOY8ZNm bB1gcZHh0/KVQhbwNDjV7bb9QW0QIvIXn3owqOSD9PkXoQZm+0ISSZrncDcAHJrCkBIq cbXQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=i6sr6lWc; 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 c11-20020a170902aa4b00b00158951ab217si6219112plr.342.2022.04.29.06.54.17; Fri, 29 Apr 2022 06:54:34 -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=i6sr6lWc; 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 S238386AbiD2GjB (ORCPT + 99 others); Fri, 29 Apr 2022 02:39:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35682 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232281AbiD2Gi7 (ORCPT ); Fri, 29 Apr 2022 02:38:59 -0400 Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 04A2A81199 for ; Thu, 28 Apr 2022 23:35:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1651214142; x=1682750142; h=message-id:date:mime-version:subject:to:cc:references: from:in-reply-to:content-transfer-encoding; bh=73uaYpqAPQn+8U/LuREycvqXt3Sws/vKsehS795EZBw=; b=i6sr6lWcYEJH+55IyX+dFV5fWFsBuhSNF2bcnbhQNivfYnnqYQSyNwxf jsvOYRug62qq/YL31uQddm55oFv+ERVHsNIzEHO7Ost9KeFC4l0coeJiB TY5HBrGda5IeHwewcVOZvo8K9x5R272yGZ8thK4xCoR8IPB67OLrcJiJP zKaN9yLOI/yXroGrXFrvFUNJgOH4JDfUXJtT3Rat6hAm9m4B0wWH+3S2c gv+PnYbMfarw1jTuLxl3Rhxk8WW+8MhlbMTEDtjxEfjz7yIM9vWVfUmTK AsirKV1fqsoFcbFU3o1YFsQ3zUbP51Uv28Ev34U1chY7SPNoV1rKwkv1y A==; X-IronPort-AV: E=McAfee;i="6400,9594,10331"; a="248479529" X-IronPort-AV: E=Sophos;i="5.91,297,1647327600"; d="scan'208";a="248479529" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 Apr 2022 23:35:42 -0700 X-IronPort-AV: E=Sophos;i="5.91,297,1647327600"; d="scan'208";a="581924572" Received: from lye4-mobl.ccr.corp.intel.com (HELO [10.249.170.95]) ([10.249.170.95]) by orsmga008-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 Apr 2022 23:35:39 -0700 Message-ID: Date: Fri, 29 Apr 2022 14:35:36 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.7.0 Subject: Re: [PATCH v4 11/12] iommu: Per-domain I/O page fault handling Content-Language: en-US To: Jean-Philippe Brucker Cc: Joerg Roedel , Jason Gunthorpe , Christoph Hellwig , Kevin Tian , Ashok Raj , Will Deacon , Robin Murphy , Jean-Philippe Brucker , Eric Auger , Liu Yi L , Jacob jun Pan , iommu@lists.linux-foundation.org, linux-kernel@vger.kernel.org References: <20220421052121.3464100-1-baolu.lu@linux.intel.com> <20220421052121.3464100-12-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=-2.6 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,NICE_REPLY_A,SPF_HELO_NONE, SPF_NONE 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/4/28 22:57, Jean-Philippe Brucker wrote: > On Thu, Apr 21, 2022 at 01:21:20PM +0800, Lu Baolu wrote: >> static void iopf_handle_group(struct work_struct *work) >> { >> struct iopf_group *group; >> @@ -134,12 +78,23 @@ static void iopf_handle_group(struct work_struct *work) >> group = container_of(work, struct iopf_group, work); >> >> list_for_each_entry_safe(iopf, next, &group->faults, list) { >> + struct iommu_domain *domain; >> + >> + domain = iommu_get_domain_for_dev_pasid_async(group->dev, >> + iopf->fault.prm.pasid); > Reading the PCIe spec again (v6.0 10.4.1.1 PASID Usage), all faults within > the group have the same PASID so we could move the domain fetch out of the > loop. It does deviate from the old behavior, though, so we could change > it later. Perhaps we can add a pasid member in the struct iopf_group and do a sanity check when a new iopf is added to the group? Here, we just fetch the domain with group->pasid. Best regards, baolu