Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp699975iob; Wed, 4 May 2022 06:20:21 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyuOnpA/m2+CHP/Y8gioKY2cOgr2Abri3hqF9uFij/NXdU/H4AQWqLdsjRSQAgwNXffWQTN X-Received: by 2002:a63:8949:0:b0:3ab:4cc7:9a8 with SMTP id v70-20020a638949000000b003ab4cc709a8mr18001878pgd.250.1651670421395; Wed, 04 May 2022 06:20:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1651670421; cv=none; d=google.com; s=arc-20160816; b=wxGdj4B4kzIGK4D9+ZGkx9ySEXNiA1GhXGwY/8BN5il74nSjyOjo1lGOJ2v2tI4aEM 9K7f25dYO4Oi9gmBLthkj05BqEs9FfVnZEv1lIw1x5IDqZ7M6O0WwHaA5FYP2Vtzvj4f ujX9iIoaKoFSpEcOYMZuzodKHgnLT0W6LGggAyjRqZ7A64AqBUyFmRg5dAacqXgxh4+m YXR6dPwoeYfllqM4bGHBu7sv1q/+mWLeLHUFrhaa55KLJWLcLZm4AdEmjupGWjjrgDCb k5eIT9O7HHnBf0Gxap1rsKFGLAlVsj5r+jkJGtP5xC5YRqRJtZ2qD5Ci0UYUBhonlYQz s9pg== 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=NdbnvnUPlxFtOUGISwk/0af2IdpT3zSDWxCFjQqA3Uw=; b=M2gBFOhvEl+ttYpwnVthop/QWH6nVcK4sr9+aCsg+ENXu+aRUOjUTUwoVM8UUB/XZz XQ6VXNwoBylBVkZIOOXAV/X+oKeMtgwzbt+HfDl+GGebjW4vRY6qWLX6wX3eiGxq4uVD +vVWsmoP1o29gk4YX+YykbvaCvRbi1bNQQ7W3b18s30opMFTyOiy2WESxOi+BJYEXL0X b13vGdjzqHAXHW+Sg/577GAd3ZpPaOzp4drdWhA91Hzj5mcF1eAaqcLR3EeiNMdhQD1M Gh8ZWhRaVAtxw+I1QGDN+hvmlSFn5tC62hdiU7HrlVzU8lFlKpbzEjN1nqsoURdZ1cdY K7xQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=DrSMerry; 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 l5-20020a63ea45000000b003a2211d2604si20123896pgk.320.2022.05.04.06.20.06; Wed, 04 May 2022 06:20:21 -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=DrSMerry; 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 S1346616AbiEDIvh (ORCPT + 99 others); Wed, 4 May 2022 04:51:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50760 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1346594AbiEDIve (ORCPT ); Wed, 4 May 2022 04:51:34 -0400 Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8D80024BE0 for ; Wed, 4 May 2022 01:47:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1651654079; x=1683190079; h=message-id:date:mime-version:subject:to:cc:references: from:in-reply-to:content-transfer-encoding; bh=kRAxXFRDE1RfRdjz1uNhLBx4H2p9vLqfF7AlX0j83pA=; b=DrSMerryL8rWbY641mejVxI7h+4eyvGVPkdqNYIPoYdpBvZJtMqoe0pg I5y+jiHMIUOH3h8GkIf+E6gZw3HNaouCQbhAT8gh3q/CAfroL1gwffvqd 1fPF8shO6Rt6qf0rNxIp9kQBaPi3KvpoyAHN5R1Aa8atPJ1y6xakXMnI4 UdIlCOh/iO8JOjAUVIVKXUxZAnVIwpXJeddqYU+oCI10rGyrvCcFIPprY 0QP78pTxB22c6hr/z10OHXOaTdrqA20AahSWmKUBxfnICjCNgh20dNC8c pGxUsUzaLssVPYnhjtXSNsOC/wOD6zuMWcz3PqudW5IUKVoHarMFuYlVI g==; X-IronPort-AV: E=McAfee;i="6400,9594,10336"; a="354141673" X-IronPort-AV: E=Sophos;i="5.91,197,1647327600"; d="scan'208";a="354141673" Received: from orsmga005.jf.intel.com ([10.7.209.41]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 May 2022 01:47:59 -0700 X-IronPort-AV: E=Sophos;i="5.91,197,1647327600"; d="scan'208";a="734304227" Received: from yanc1-mobl.ccr.corp.intel.com (HELO [10.255.30.223]) ([10.255.30.223]) by orsmga005-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 May 2022 01:47:56 -0700 Message-ID: Date: Wed, 4 May 2022 16:47:54 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.8.1 Subject: Re: [PATCH 4/5] iommu/vt-d: Remove domain_update_iommu_snooping() Content-Language: en-US To: Jacob Pan Cc: Joerg Roedel , Jason Gunthorpe , Alex Williamson , Kevin Tian , Liu Yi L , iommu@lists.linux-foundation.org, linux-kernel@vger.kernel.org References: <20220501112434.874236-1-baolu.lu@linux.intel.com> <20220501112434.874236-5-baolu.lu@linux.intel.com> <20220502143603.4143dd66@jacob-builder> From: Baolu Lu In-Reply-To: <20220502143603.4143dd66@jacob-builder> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-7.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,NICE_REPLY_A,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 On 2022/5/3 05:36, Jacob Pan wrote: > 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 */ It has been cleaned up by below commit: 71cfafda9c9b vfio: Move the Intel no-snoop control off of IOMMU_CACHE > >> 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 Best regards, baolu