Received: by 2002:a05:7412:e794:b0:fa:551:50a7 with SMTP id o20csp821109rdd; Tue, 9 Jan 2024 23:52:12 -0800 (PST) X-Google-Smtp-Source: AGHT+IF4k8V2zwcpivDormxoJAcbzyrgCucIrX/R+ybRB8OAel5/4sT3LQ+eKiPLQW0D0v3cLb29 X-Received: by 2002:a25:3628:0:b0:dbd:6741:1f97 with SMTP id d40-20020a253628000000b00dbd67411f97mr355432yba.80.1704873132197; Tue, 09 Jan 2024 23:52:12 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1704873132; cv=none; d=google.com; s=arc-20160816; b=OV8Cv4okLax5WYQUqKHvoM+/4Tj0GjCu4YQvnwQfdwXo0RxT31HY00javB3EH4QaW/ O5btNymMbI6bWX6HSm+9UvmoPabbSeIP9u++Etl3500TgF60JA/9JIb5i86c+/v9wuQX weAWNXD30bSFWCxoAE2qBpEg/w3/tjFA2aIq6zhi+NS/X6bWUJBtkRpMY4vlEgPfTw9F Ml1iQtriXNSNxEhec42TP5Qpst+eI1CmExbIIJ2qsOLv959DjrKgZdUdik5X7+SsuchJ lTEbm56dzQ/sKMGLTCXQBVWkGKNgGbelFFWRMtZF22dxfKjHRHfZIHYBzogdlzqRaMAU lkVw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:references:cc:to:subject :user-agent:mime-version:list-unsubscribe:list-subscribe:list-id :precedence:date:message-id:dkim-signature; bh=ZT0w10T7hrOkO8CB+iutlkwYBvlN1o5x05VdL+L4+oM=; fh=o21vhqUckBhZPB0tnLFE8x1jjJWz7Scm2klc6ZpXYNI=; b=gAzQorBElhPkTWD0RZplZNv3GTTIo3BmSwxWcUpPNWh+Kgp3c1KMNG4Oo229W/p2kv mvcxR2bI+KDrljtCFYyIDoIy+3/KbaOu11nRzTL8fGCcTcZTADegsewi45j8r3L5sMNG MMmMY2KhKXy60QP40eTD1q5T/QghdARmm19JwPvIAxdigRt4LWwFQQaCp4eWUAoW51f7 vHcddU/AWjBcuQ8fXx3O1LuCaDTdgCcCENm0vCEFKX2iwyT5BEfqn028KlvFAZE9JsnQ afjALh1rORcSeiC1aYzqCsy4NcGijcIS7i3OhOMRfhmpWx7/02pf8IH2z1arOdD3afL6 9AMQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=R3mFbeWh; spf=pass (google.com: domain of linux-kernel+bounces-21803-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-21803-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id bo8-20020a056a02038800b005c668a5a906si3221779pgb.282.2024.01.09.23.52.11 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 09 Jan 2024 23:52:12 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-21803-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=R3mFbeWh; spf=pass (google.com: domain of linux-kernel+bounces-21803-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-21803-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 8C642289C99 for ; Wed, 10 Jan 2024 07:52:10 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 9F1B43B790; Wed, 10 Jan 2024 07:52:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="R3mFbeWh" Received: from mgamail.intel.com (mgamail.intel.com [134.134.136.20]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8D7333E470; Wed, 10 Jan 2024 07:52:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=linux.intel.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1704873121; x=1736409121; h=message-id:date:mime-version:subject:to:cc:references: from:in-reply-to:content-transfer-encoding; bh=pDvYrmhpBlr6Ouka9BO91HIwFCHKwrpkfzJvRUkQeIU=; b=R3mFbeWhyfTUC4FatA/V4kS8eggkySaN2+0iDerTfS8nFdJNEOs59AW8 hnaLEjkpJdTpDgR2zVaA1hICj1jIitUkixP6hzv3RWv/6UNDQhdJDYgH6 P/i4FNdk0m8l03K5y2DSlKAt6mlphJCVBiJ780e4G2loW35W1clx47hO/ Q0YU3YnzNerzXK9kIAI3xEPRycpwXbjMZMuQyYbolWmh9vczdVWAbnvsn AXFlqJ7MJUDgk2I3TldgO68iIfeWzLRupx9O0r4uQkeN8nuNcYgP21CdQ 3Mh1ixQFhjmt9OywY0P/ZlHLqGSYBwlsFzvROvLiSl56DOAPfCyACHEDd g==; X-IronPort-AV: E=McAfee;i="6600,9927,10947"; a="388882588" X-IronPort-AV: E=Sophos;i="6.04,184,1695711600"; d="scan'208";a="388882588" Received: from orsmga005.jf.intel.com ([10.7.209.41]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 09 Jan 2024 23:52:00 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10947"; a="955281702" X-IronPort-AV: E=Sophos;i="6.04,184,1695711600"; d="scan'208";a="955281702" Received: from zhaohaif-mobl.ccr.corp.intel.com (HELO [10.93.11.157]) ([10.93.11.157]) by orsmga005-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 09 Jan 2024 23:51:57 -0800 Message-ID: <5de13afa-4079-467a-a7b1-badfb9ac95cc@linux.intel.com> Date: Wed, 10 Jan 2024 15:51:53 +0800 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [RFC PATCH v10 1/5] iommu/vt-d: add pci_dev parameter to qi_submit_sync and refactor callers To: Baolu Lu , kevin.tian@intel.com, bhelgaas@google.com, dwmw2@infradead.org, will@kernel.org, robin.murphy@arm.com, lukas@wunner.de Cc: linux-pci@vger.kernel.org, iommu@lists.linux.dev, linux-kernel@vger.kernel.org References: <20231228170206.720675-1-haifeng.zhao@linux.intel.com> <20231228170206.720675-2-haifeng.zhao@linux.intel.com> From: Ethan Zhao In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit On 1/10/2024 12:59 PM, Baolu Lu wrote: > On 12/29/23 1:02 AM, Ethan Zhao wrote: >> Signed-off-by: Ethan Zhao > > Please don't leave the message body empty. You should describe why do > you want to add the change in this patch. Seems the description part was lost, will append next version. > >> --- >>   drivers/iommu/intel/dmar.c          | 45 +++++++++++++++++++++-------- >>   drivers/iommu/intel/iommu.c         | 26 +++++------------ >>   drivers/iommu/intel/iommu.h         | 17 +++++------ >>   drivers/iommu/intel/irq_remapping.c |  2 +- >>   drivers/iommu/intel/pasid.c         | 11 ++----- >>   drivers/iommu/intel/svm.c           | 13 ++++----- >>   6 files changed, 58 insertions(+), 56 deletions(-) >> >> diff --git a/drivers/iommu/intel/dmar.c b/drivers/iommu/intel/dmar.c >> index 23cb80d62a9a..3d661f2b7946 100644 >> --- a/drivers/iommu/intel/dmar.c >> +++ b/drivers/iommu/intel/dmar.c >> @@ -1344,7 +1344,7 @@ static int qi_check_fault(struct intel_iommu >> *iommu, int index, int wait_index) >>    * can be part of the submission but it will not be polled for >> completion. >>    */ >>   int qi_submit_sync(struct intel_iommu *iommu, struct qi_desc *desc, >> -           unsigned int count, unsigned long options) >> +           unsigned int count, unsigned long options, struct pci_dev >> *pdev) > > How about adding a bit in options parameter to tell whether the @pdev is > valid? well, checking the option bit or checking pdev == NULL, use one parameter to describe another one is common function defination method if one parameter couldn't self-describe. This case, we always check pdev(one checking), and if we check option bit first, then have to check pdev again (one or two checking).  I prefer checking pdev only. Thanks, Ethan > > Best regards, > baolu