Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp5049105rdb; Tue, 12 Dec 2023 18:18:55 -0800 (PST) X-Google-Smtp-Source: AGHT+IHxQm37Om5goIyOZubKPANC0pgqdMzeRpDXSbqLsgpiQJfdC+MHBxwYKqMZdqypi8ZDe7dw X-Received: by 2002:a17:90a:7781:b0:28a:d2e8:6ccc with SMTP id v1-20020a17090a778100b0028ad2e86cccmr1042123pjk.95.1702433935549; Tue, 12 Dec 2023 18:18:55 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702433935; cv=none; d=google.com; s=arc-20160816; b=VQzF/vijHHbarXjTOkr7FYT67P5xRONf2vWXbbk8MRs8WQWJCsqx8xpfyaUoalmXai Asv0R3HzkOzXhYJsNuv5xcW2HC8+BXFg/OTYG83RzzEmck9nnpzIaZyt1ZXlw2SHzLI2 Hl67iX9fycy66rBVB3JJJMV+XYy13F6XVie57tFIIUIZeP5LMD3n9ezWHlx7z1POSWQ7 L4H0GaDWW9dqhoHlMKx7AItb/b3peyZReuE+RazK0wloeeNUxZk4qQhdJrS9My4e1xB+ o6gt7GyrOJOruG5R7xeMbTOngqyoKhgAYJGG+tjw5crbFseFKrtFGf5u29EDNFbrQefL uC5w== 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=abwU7EBoC2bZNXCu2ewCq6vfIbtXglsb2ERlHKGjWj0=; fh=uzznn7J+IYAjVbPHItJO5zuzOqyiZAy1PaNe6S3d3bk=; b=KEI2rzykZU+Qoo+LZn3ohulvbnzkLTD/oWhYsvvc4RF66ATAiBK7lhCIFceWhWw9dp tF59xbGU5D9oe2U8A1KiSE3BMgrTzALl+url//lVPG6WEPQDvfcUokGYfYq1Z8wpYRRw uTg07+zS4Y4KSLqCyjZ2kT744SHibvrfFs1giaKXpD4eTcRMx0wNEYQIwwid8RZDmdK/ 6CfZa5eAMbgYui1xuXRG70n6NUMk5VoB/RIIl6dwWW8qYiRNipO6XnB/M7IPhmikXeTu htMnmOsd/fAXrJAUt43y5XUMXRhG73rsnynDmVkgEmC6C5FqUrxDUrLjljLb4R7gYwRY sLyg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=YbvCQSiA; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 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 pete.vger.email (pete.vger.email. [2620:137:e000::3:6]) by mx.google.com with ESMTPS id n4-20020a170902e54400b001d000c817e2si8847361plf.398.2023.12.12.18.18.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Dec 2023 18:18:55 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) client-ip=2620:137:e000::3:6; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=YbvCQSiA; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by pete.vger.email (Postfix) with ESMTP id 0965E801D9F7; Tue, 12 Dec 2023 18:18:53 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at pete.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1378272AbjLMCSj (ORCPT + 99 others); Tue, 12 Dec 2023 21:18:39 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42006 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1378226AbjLMCSi (ORCPT ); Tue, 12 Dec 2023 21:18:38 -0500 Received: from mgamail.intel.com (mgamail.intel.com [134.134.136.100]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 52744AF; Tue, 12 Dec 2023 18:18:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1702433925; x=1733969925; h=message-id:date:mime-version:cc:subject:to:references: from:in-reply-to:content-transfer-encoding; bh=9NrtGXpCILFoIwZ2JfsOrOGHmtAmNMQVqNtQuAv4cBM=; b=YbvCQSiAtqK7VmWvRP1h5WCXdmmt4+ewLyq7QTQbM5tiN5pUucIdVT0M Oe+abJRWYWXaWF09UJie8j17JUkfEWxbl3dQptdKHYvD/ahU+5kFJB4tX WtmjjLVAUArOEUpHlCP7CAVnNxzi8+Yrb+mVP77H45rT1GTfb7c1F2CnJ YXt7jsXuWPHgtzntsv/BWI0KKG4rs9eQkjCnGVqQCfPn8kNHvDJF/NGnm mpbYAx5eWzoVlIXKnU+tTNX9oPYmJ8v7zy0pTZkC9xlkOgtqhAGAZ6lb/ bDC/HYtLKeuFLTlTvgGt1iyHbAFrcz/RRXsMHMMFTRXD3WM4t2tFFmWZz A==; X-IronPort-AV: E=McAfee;i="6600,9927,10922"; a="461376941" X-IronPort-AV: E=Sophos;i="6.04,271,1695711600"; d="scan'208";a="461376941" Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 Dec 2023 18:18:44 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10922"; a="723466699" X-IronPort-AV: E=Sophos;i="6.04,271,1695711600"; d="scan'208";a="723466699" Received: from allen-box.sh.intel.com (HELO [10.239.159.127]) ([10.239.159.127]) by orsmga003.jf.intel.com with ESMTP; 12 Dec 2023 18:18:40 -0800 Message-ID: <6334aaf3-ed7c-4ded-827d-423b861a0b28@linux.intel.com> Date: Wed, 13 Dec 2023 10:14:00 +0800 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Cc: baolu.lu@linux.intel.com, Joerg Roedel , Will Deacon , Robin Murphy , Kevin Tian , Jean-Philippe Brucker , Nicolin Chen , Yi Liu , Jacob Pan , Longfang Liu , Yan Zhao , iommu@lists.linux.dev, kvm@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v8 12/12] iommu: Use refcount for fault data access Content-Language: en-US To: Jason Gunthorpe References: <20231207064308.313316-1-baolu.lu@linux.intel.com> <20231207064308.313316-13-baolu.lu@linux.intel.com> <20231211152456.GB1489931@ziepe.ca> <416b6639-8904-4b31-973c-d5522e2731d8@linux.intel.com> <20231212151447.GC3013885@ziepe.ca> From: Baolu Lu In-Reply-To: <20231212151447.GC3013885@ziepe.ca> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on pete.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (pete.vger.email [0.0.0.0]); Tue, 12 Dec 2023 18:18:53 -0800 (PST) On 12/12/23 11:14 PM, Jason Gunthorpe wrote: > On Tue, Dec 12, 2023 at 01:17:47PM +0800, Baolu Lu wrote: >> On 12/11/23 11:24 PM, Jason Gunthorpe wrote: >>> Also iopf_queue_remove_device() is messed up - it returns an error >>> code but nothing ever does anything with it ???? Remove functions like >>> this should never fail. >> Yes, agreed. >> >>> Removal should be like I explained earlier: >>> - Disable new PRI reception >> This could be done by >> >> rcu_assign_pointer(param->fault_param, NULL); >> >> ? > Not without a synchronize_rcu > > disable new PRI reception should be done by the driver - it should > turn off PRI generation in the IOMMU HW and flush any HW PRI queues. Yeah! Get you now. Best regards, baolu