Received: by 2002:a05:6358:7058:b0:131:369:b2a3 with SMTP id 24csp644378rwp; Wed, 12 Jul 2023 21:09:30 -0700 (PDT) X-Google-Smtp-Source: APBJJlG6HVlYJNBi3oGjK9Ij6g8hfUPkyngQUFojjntyx4ycJ+aWAg0dAvGYnECOwA2AP8cE8Esv X-Received: by 2002:a17:90a:4ce5:b0:263:41ae:8163 with SMTP id k92-20020a17090a4ce500b0026341ae8163mr104443pjh.12.1689221370484; Wed, 12 Jul 2023 21:09:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689221370; cv=none; d=google.com; s=arc-20160816; b=r1lN2FHopR7l9h/Yff4xcLRdjJzUiwJyT36WDReNNgMalghwstb3kkjni0mFbvHxU8 ofjAJon1wQpraKSwxy0GUCElWt/aZziJvU0wz5oWJcvOA/vDMLCot7Ee1xplDT2VKLeV B4LCXM8lmgJqEhg7r2Aas6LG7vNuNUKggkDdvSu2uvjPjbQTnyoSnp3L9jtFsfiOpnQg 7dqcFu2B1FIdZgHMTlnPUaNL0LaVdzQYwGD83rMTSD8UxZ4UZW3h9n1UFKLoMelmshG/ ELGY5wo0up8gRCkfYKz36GXfNZPyiBgMl22VvIYIW0UkmYmnCEgBwq+pBWDNS5fFclSK LTvA== 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 :content-language:references:to:subject:cc:user-agent:mime-version :date:message-id:dkim-signature; bh=bJOn9b5uXj4gaH5E3RAqqVb6NM2xLlO8ib0FobfeJh0=; fh=KsTO535+ho9t6EXXctiD8s+tsEf6kZd4XYO4oH9mtwQ=; b=iduvFDwR97BmTLZ5g03zp5T9IxglWlCUFaYDn/LWWh0hUYJehPP3iSZfSXoazhM5+w gZ4Vr5+6lFiwYuR01sdBJGOFgCrWLGMHVDSP5LZwBXf+3ywauAGPliB4kWwPhfLZqzFr 2Ml4mFBFBh3Nmvykg6vYFgPOkMHw/JKEzin0WF44rh3wrc0FYrr2cYh0W+MkaKCZhzyJ MKVvwXZ6GahsqPbMGHvVa9NMMuSfOa4c2XQtL80l9yCq6Y7V3kzLMexF+OWHpvHLdAJ9 eai5XsHaXvUeyEPi840uTsi7E9pODIP3VnJA7zUfF3Ab/GqlIstZCvQfHxZKz+Pzj0oP fuEw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=d95wZkD1; 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 h15-20020a17090a648f00b0025c0784b6f4si4638987pjj.144.2023.07.12.21.09.18; Wed, 12 Jul 2023 21:09:30 -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=d95wZkD1; 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 S233703AbjGMDo1 (ORCPT + 99 others); Wed, 12 Jul 2023 23:44:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49474 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233698AbjGMDoO (ORCPT ); Wed, 12 Jul 2023 23:44:14 -0400 Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2D9B42113; Wed, 12 Jul 2023 20:44:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1689219848; x=1720755848; h=message-id:date:mime-version:cc:subject:to:references: from:in-reply-to:content-transfer-encoding; bh=dSMjRg8ZP7ic8vMjHznYMQB4EEK/y11162LRsTfQBE4=; b=d95wZkD1PVhxrb/Xlxtfbs70t17pHIH1H+Kw8kkMmIZDz1cy7kJtfnai 1ja+dC22l7KeLTHKHT0zRUuez8Xo6lGlclqQmiAA8QjYmIoymhRCrcei5 0C2iVArJeCobdOdQkVx6sikI6aPp9MpgZI1MgDRr0heSPreuVXKVTdcjl Rd8EXjcJjAYRFUdO/DM5urmeI+1buGvuAT1OmL0Yszy3LZR5pH/5FL0Dk LuA11X3Xpa8qVufSaL+tvrRVGoLFRtam4usE1Rpiw7/XgY/ww9FMSxvM6 a/L0lUIzzlwkbVvdSFdnzrQGetk60P5/V0f97LT95rSmjHWwaRjirMyb4 w==; X-IronPort-AV: E=McAfee;i="6600,9927,10769"; a="363945261" X-IronPort-AV: E=Sophos;i="6.01,201,1684825200"; d="scan'208";a="363945261" Received: from orsmga007.jf.intel.com ([10.7.209.58]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 Jul 2023 20:44:03 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10769"; a="715788445" X-IronPort-AV: E=Sophos;i="6.01,201,1684825200"; d="scan'208";a="715788445" Received: from blu2-mobl.ccr.corp.intel.com (HELO [10.252.187.96]) ([10.252.187.96]) by orsmga007-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 Jul 2023 20:43:58 -0700 Message-ID: Date: Thu, 13 Jul 2023 11:43:55 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.13.0 Cc: baolu.lu@linux.intel.com, Joerg Roedel , Will Deacon , Robin Murphy , Jason Gunthorpe , Jean-Philippe Brucker , Nicolin Chen , "Liu, Yi L" , "iommu@lists.linux.dev" , "kvm@vger.kernel.org" , "linux-kernel@vger.kernel.org" Subject: Re: [PATCH 9/9] iommu: Use fault cookie to store iopf_param To: "Tian, Kevin" , Jacob Pan References: <20230711010642.19707-1-baolu.lu@linux.intel.com> <20230711010642.19707-10-baolu.lu@linux.intel.com> <20230711150249.62917dad@jacob-builder> Content-Language: en-US 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.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,NICE_REPLY_A, RCVD_IN_DNSWL_BLOCKED,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 2023/7/13 11:24, Tian, Kevin wrote: >> From: Baolu Lu >> Sent: Wednesday, July 12, 2023 11:13 AM >> >> On 2023/7/12 6:02, Jacob Pan wrote: >>> On Tue, 11 Jul 2023 09:06:42 +0800, Lu Baolu >>> wrote: >>> >>>> @@ -158,7 +158,7 @@ int iommu_queue_iopf(struct iommu_fault *fault, >>>> struct device *dev) >>>> * As long as we're holding param->lock, the queue can't be >>>> unlinked >>>> * from the device and therefore cannot disappear. >>>> */ >>>> - iopf_param = param->iopf_param; >>>> + iopf_param = iommu_get_device_fault_cookie(dev, 0); >>> I am not sure I understand how does it know the cookie type is iopf_param >>> for PASID 0? >>> >>> Between IOPF and IOMMUFD use of the cookie, cookie types are different, >>> right? >>> >> >> The fault cookie is managed by the code that delivers or handles the >> faults. The sva and IOMMUFD paths are exclusive. >> > > what about siov? A siov-capable device can support sva and iommufd > simultaneously. For siov case, the pasid should be global. RID and each pasid are still exclusive, so I don't see any problem. Did I overlook anything? Best regards, baolu