Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp154574iob; Mon, 2 May 2022 15:44:53 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzdWEcRoMvd5SpXJAB8qrghkuxiwXymt8gKROkBYbgiPCjA5Di1FnmjbGD+m/wfnNC6gp43 X-Received: by 2002:a05:6512:3f0b:b0:450:aba7:850b with SMTP id y11-20020a0565123f0b00b00450aba7850bmr10013059lfa.78.1651531493090; Mon, 02 May 2022 15:44:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1651531493; cv=none; d=google.com; s=arc-20160816; b=jp0oowCBMr+IJrqpuXcSkaLBfLfQwAk8MuQ3yDnnoJn9oBpIDIVf04ENLnZI7GYVoP HSxV2BKEI4o/Ns/jhxcTn8Iyrcuop3j4LnAk8juxpb1tgG9WBtJOuyf7XASWC6EZ5IUZ P+vXqAXQSJG7nXOHEwaMl6uBaqV6JPwFf3Fe77B6xXWfJC+H1bU2ZDYZCP9ZG3bqnnO5 xvuLhwfoTpzl7qNVm8xmOEzPlPhW+/i/T3YiIT36j5UaI0/4wfhV/Tt7x8ZldncZw+xw baowx6AZLNnYrScQsZYsHg/5a2SlUFnF0LWnTn+OscjFA6gAPudC0/9XsrQ0XmIghyVr vi+g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :organization:references:in-reply-to:message-id:subject:cc:to:from :date:dkim-signature; bh=26R2XAtOHB1Pdzah3rSqGcj0UMtzwoY6HvsQR7jhXkA=; b=Zgk5t1cNCdG3JIMIn7fyUGUFrC+pLplnDbGhw/Jn4GQYpzBtihKmCw1bOBogx8yDtH Y7R8AYdXBBYu2fODy9EiAf3CTkiV5Mv2v1TpsK3J4kr1iwLFyQyQFzidQgjligbi7Qjn 04Kxm2rnEQlcmkEm4bo7II4G8ICCpK+j1OaH2J7h5CSOm4wJxDIADxB3QkfdslIC3fln mcBgwuNXFTp3hYxqlsY5OdRzJvz2V5zXxj4Ga0sNCsAMg+aEn2fhhSu44pMIolS0shK3 NooOyU9kd5ECDA+Tai7dm9Yg3JzSa27CpCn/hqKCWrCLeN80OKG/qwodvUADL92J9u1Q A46A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=dz7We7e+; 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 m10-20020a2ea58a000000b002505c31ee00si3244553ljp.441.2022.05.02.15.44.26; Mon, 02 May 2022 15:44:53 -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=dz7We7e+; 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 S1387675AbiEBVfy (ORCPT + 99 others); Mon, 2 May 2022 17:35:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33646 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239512AbiEBVfw (ORCPT ); Mon, 2 May 2022 17:35:52 -0400 Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 30F52E09E for ; Mon, 2 May 2022 14:32:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1651527143; x=1683063143; h=date:from:to:cc:subject:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=G0FF9i1jLHjZ/yzasx+agtmTQl9xoAQw3ixOJN2ci8o=; b=dz7We7e+kF/k31RFE3cuiz4z2jAyl+enLi/JHSTbhc6Psyiw9m80sx+O HoCpmCrdJdCJAaPdB2NhhOxB5YpFbf4yuM0HKEOIHEwbgXm9XpIq68vub L8ZpYBhGOaDIF4XPAo6r5TG/BVWvwrQnxTHlcHXy8UEeOEpWgdIMMLoWg phtDGyUz9eOvWDjwe0QFMTSJnknHyTKH4sFfR4+W8gcRnqCUbW49jWfFH TJqKlDIprExlNAln8diHsOkcAwPh4vzPBxqxnRWRxjerY6fbC9kVJjTQt 6GaktZ3hpQQvmAoOQglCrtPf6C++u3/TpnWKaCkwMe3187PNHTyTtil83 A==; X-IronPort-AV: E=McAfee;i="6400,9594,10335"; a="353769373" X-IronPort-AV: E=Sophos;i="5.91,193,1647327600"; d="scan'208";a="353769373" Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 May 2022 14:32:23 -0700 X-IronPort-AV: E=Sophos;i="5.91,193,1647327600"; d="scan'208";a="652997307" Received: from jacob-builder.jf.intel.com (HELO jacob-builder) ([10.7.198.157]) by fmsmga003-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 May 2022 14:32:22 -0700 Date: Mon, 2 May 2022 14:36:03 -0700 From: Jacob Pan To: Lu Baolu Cc: Joerg Roedel , Jason Gunthorpe , "Alex Williamson" , Kevin Tian , Liu Yi L , , , jacob.jun.pan@intel.com Subject: Re: [PATCH 4/5] iommu/vt-d: Remove domain_update_iommu_snooping() Message-ID: <20220502143603.4143dd66@jacob-builder> In-Reply-To: <20220501112434.874236-5-baolu.lu@linux.intel.com> References: <20220501112434.874236-1-baolu.lu@linux.intel.com> <20220501112434.874236-5-baolu.lu@linux.intel.com> Organization: OTC X-Mailer: Claws Mail 3.17.5 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-5.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, 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 Hi BaoLu, On Sun, 1 May 2022 19:24:33 +0800, Lu Baolu wrote: > The IOMMU force snooping capability is not required to be consistent > among all the IOMMUs anymore. Remove force snooping capability check > in the IOMMU hot-add path and domain_update_iommu_snooping() becomes > a dead code now. > > Signed-off-by: Lu Baolu > --- > drivers/iommu/intel/iommu.c | 34 +--------------------------------- > 1 file changed, 1 insertion(+), 33 deletions(-) > > diff --git a/drivers/iommu/intel/iommu.c b/drivers/iommu/intel/iommu.c > index 3c1c228f9031..d5808495eb64 100644 > --- a/drivers/iommu/intel/iommu.c > +++ b/drivers/iommu/intel/iommu.c > @@ -533,33 +533,6 @@ static void domain_update_iommu_coherency(struct > dmar_domain *domain) rcu_read_unlock(); > } > > -static bool domain_update_iommu_snooping(struct intel_iommu *skip) > -{ > - struct dmar_drhd_unit *drhd; > - struct intel_iommu *iommu; > - bool ret = true; > - > - rcu_read_lock(); > - for_each_active_iommu(iommu, drhd) { > - if (iommu != skip) { > - /* > - * If the hardware is operating in the scalable > mode, > - * the snooping control is always supported > since we > - * always set PASID-table-entry.PGSNP bit if the > domain > - * is managed outside (UNMANAGED). > - */ > - if (!sm_supported(iommu) && > - !ecap_sc_support(iommu->ecap)) { > - ret = false; > - break; > - } > - } > - } > - rcu_read_unlock(); > - > - return ret; > -} > - > static int domain_update_iommu_superpage(struct dmar_domain *domain, > struct intel_iommu *skip) > { > @@ -3593,12 +3566,7 @@ static int intel_iommu_add(struct dmar_drhd_unit > *dmaru) iommu->name); > return -ENXIO; > } > - if (!ecap_sc_support(iommu->ecap) && > - domain_update_iommu_snooping(iommu)) { > - pr_warn("%s: Doesn't support snooping.\n", > - iommu->name); > - return -ENXIO; > - } > + Maybe I missed earlier patches, so this bit can also be deleted? struct dmar_domain { u8 iommu_snooping: 1; /* indicate snooping control feature */ > sp = domain_update_iommu_superpage(NULL, iommu) - 1; > if (sp >= 0 && !(cap_super_page_val(iommu->cap) & (1 << sp))) { > pr_warn("%s: Doesn't support large page.\n", Thanks, Jacob