From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 979DFC433EF for ; Fri, 6 May 2022 05:30:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346681AbiEFFeS (ORCPT ); Fri, 6 May 2022 01:34:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40240 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1347742AbiEFFeL (ORCPT ); Fri, 6 May 2022 01:34:11 -0400 Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5593819008 for ; Thu, 5 May 2022 22:30:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1651815027; x=1683351027; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=5UPUZjJVdMzrW2rShCCX+WFC3SvhnCk41EqWtRxsWIE=; b=JItjtE5h2SaXLKCLYHuxSb7eMMsfPGYba+keTLnWcYdCS9kbVSEWwwrr jYoldxBFF3VMuSwV5GpqqSKbD1YW9cEbilSzx//SXUGzytJkAma134QTk +kLQYU9cf2HU84Dy65l6fXzt1pDpQ22/WYBbE7NSm0eaavcDzNIQ2Fgsk BTE/bGwAUxouEjoADGWeKNvAXh2wSzjBlKUnK+CBQLUe9mXv1wwfz9r2c oqpX7YKaLSQO4zRJSVi/cp4FvATSfTfcSjiv7ptzcuAwFZeVM7Q+keXTs JaNtKxMyMW3Tr/TJ4/G3EEBVQqYvMoAV/6UzAPV2+XmW09iSuGpc83AXv A==; X-IronPort-AV: E=McAfee;i="6400,9594,10338"; a="255838457" X-IronPort-AV: E=Sophos;i="5.91,203,1647327600"; d="scan'208";a="255838457" Received: from orsmga004.jf.intel.com ([10.7.209.38]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 05 May 2022 22:30:26 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.91,203,1647327600"; d="scan'208";a="695011041" Received: from allen-box.sh.intel.com ([10.239.159.48]) by orsmga004.jf.intel.com with ESMTP; 05 May 2022 22:30:24 -0700 From: Lu Baolu To: Joerg Roedel , Jason Gunthorpe , Alex Williamson , Kevin Tian Cc: Jacob jun Pan , Liu Yi L , iommu@lists.linux-foundation.org, linux-kernel@vger.kernel.org, Lu Baolu Subject: [PATCH v3 0/4] iommu/vt-d: Force snooping improvement Date: Fri, 6 May 2022 13:27:23 +0800 Message-Id: <20220506052727.1689687-1-baolu.lu@linux.intel.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi folks, Previously, the IOMMU capability of enforcing cache coherency was queried through iommu_capable(IOMMU_CAP_CACHE_COHERENCY). This is a global capability, hence the IOMMU driver reports support for this capability only when all IOMMUs in the system has this support. Commit 6043257b1de06 ("iommu: Introduce the domain op enforce_cache_coherency()") converts this into a per-domain test-and-set option, and the previous iommu_capable(IOMMU_CAP_CACHE_COHERENCY) is deprecated. This is a follow-up series which improves the Intel IOMMU driver to support the per-domain scheme better. Best regards, baolu Change log: v3: - Hold the device_domain_lock when check and set force snooping. - Refind the commit messages. v2: - https://lore.kernel.org/linux-iommu/20220505010710.1477739-1-baolu.lu@linux.intel.com/ - Check whether force_snooping has already been set in intel_iommu_enforce_cache_coherency(). - Set PGSNP pasid bit field during domain attaching if forcing_snooping is set. - Remove redundant list_empty() checks. - Add dmar_domain->set_pte_snp and set it if force snooping is enforced on a domain with 2nd-level translation. v1: - https://lore.kernel.org/linux-iommu/20220501112434.874236-1-baolu.lu@linux.intel.com - Initial post. Lu Baolu (4): iommu/vt-d: Block force-snoop domain attaching if no SC support iommu/vt-d: Check domain force_snooping against attached devices iommu/vt-d: Remove domain_update_iommu_snooping() iommu/vt-d: Remove hard coding PGSNP bit in PASID entries include/linux/intel-iommu.h | 1 + drivers/iommu/intel/pasid.h | 2 + drivers/iommu/intel/iommu.c | 90 ++++++++++++++++++++++--------------- drivers/iommu/intel/pasid.c | 26 +++++++++-- 4 files changed, 80 insertions(+), 39 deletions(-) -- 2.25.1 From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from smtp2.osuosl.org (smtp2.osuosl.org [140.211.166.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id BC95DC433EF for ; Fri, 6 May 2022 05:30:32 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp2.osuosl.org (Postfix) with ESMTP id 5CF2840AC2; Fri, 6 May 2022 05:30:32 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp2.osuosl.org ([127.0.0.1]) by localhost (smtp2.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id epTIcRXRRW1s; Fri, 6 May 2022 05:30:31 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [IPv6:2605:bc80:3010:104::8cd3:938]) by smtp2.osuosl.org (Postfix) with ESMTPS id 0D9F540119; Fri, 6 May 2022 05:30:31 +0000 (UTC) Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id D88D8C0032; Fri, 6 May 2022 05:30:30 +0000 (UTC) Received: from smtp4.osuosl.org (smtp4.osuosl.org [IPv6:2605:bc80:3010::137]) by lists.linuxfoundation.org (Postfix) with ESMTP id 87956C002D for ; Fri, 6 May 2022 05:30:29 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp4.osuosl.org (Postfix) with ESMTP id 7C35B415A8 for ; Fri, 6 May 2022 05:30:29 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Authentication-Results: smtp4.osuosl.org (amavisd-new); dkim=pass (2048-bit key) header.d=intel.com Received: from smtp4.osuosl.org ([127.0.0.1]) by localhost (smtp4.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id rWMrzh-qgaBf for ; Fri, 6 May 2022 05:30:27 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.8.0 Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by smtp4.osuosl.org (Postfix) with ESMTPS id 732F34157F for ; Fri, 6 May 2022 05:30:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1651815027; x=1683351027; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=5UPUZjJVdMzrW2rShCCX+WFC3SvhnCk41EqWtRxsWIE=; b=JItjtE5h2SaXLKCLYHuxSb7eMMsfPGYba+keTLnWcYdCS9kbVSEWwwrr jYoldxBFF3VMuSwV5GpqqSKbD1YW9cEbilSzx//SXUGzytJkAma134QTk +kLQYU9cf2HU84Dy65l6fXzt1pDpQ22/WYBbE7NSm0eaavcDzNIQ2Fgsk BTE/bGwAUxouEjoADGWeKNvAXh2wSzjBlKUnK+CBQLUe9mXv1wwfz9r2c oqpX7YKaLSQO4zRJSVi/cp4FvATSfTfcSjiv7ptzcuAwFZeVM7Q+keXTs JaNtKxMyMW3Tr/TJ4/G3EEBVQqYvMoAV/6UzAPV2+XmW09iSuGpc83AXv A==; X-IronPort-AV: E=McAfee;i="6400,9594,10338"; a="354790934" X-IronPort-AV: E=Sophos;i="5.91,203,1647327600"; d="scan'208";a="354790934" Received: from orsmga004.jf.intel.com ([10.7.209.38]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 05 May 2022 22:30:26 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.91,203,1647327600"; d="scan'208";a="695011041" Received: from allen-box.sh.intel.com ([10.239.159.48]) by orsmga004.jf.intel.com with ESMTP; 05 May 2022 22:30:24 -0700 From: Lu Baolu To: Joerg Roedel , Jason Gunthorpe , Alex Williamson , Kevin Tian Subject: [PATCH v3 0/4] iommu/vt-d: Force snooping improvement Date: Fri, 6 May 2022 13:27:23 +0800 Message-Id: <20220506052727.1689687-1-baolu.lu@linux.intel.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Cc: iommu@lists.linux-foundation.org, Jacob jun Pan , linux-kernel@vger.kernel.org X-BeenThere: iommu@lists.linux-foundation.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: Development issues for Linux IOMMU support List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: iommu-bounces@lists.linux-foundation.org Sender: "iommu" Hi folks, Previously, the IOMMU capability of enforcing cache coherency was queried through iommu_capable(IOMMU_CAP_CACHE_COHERENCY). This is a global capability, hence the IOMMU driver reports support for this capability only when all IOMMUs in the system has this support. Commit 6043257b1de06 ("iommu: Introduce the domain op enforce_cache_coherency()") converts this into a per-domain test-and-set option, and the previous iommu_capable(IOMMU_CAP_CACHE_COHERENCY) is deprecated. This is a follow-up series which improves the Intel IOMMU driver to support the per-domain scheme better. Best regards, baolu Change log: v3: - Hold the device_domain_lock when check and set force snooping. - Refind the commit messages. v2: - https://lore.kernel.org/linux-iommu/20220505010710.1477739-1-baolu.lu@linux.intel.com/ - Check whether force_snooping has already been set in intel_iommu_enforce_cache_coherency(). - Set PGSNP pasid bit field during domain attaching if forcing_snooping is set. - Remove redundant list_empty() checks. - Add dmar_domain->set_pte_snp and set it if force snooping is enforced on a domain with 2nd-level translation. v1: - https://lore.kernel.org/linux-iommu/20220501112434.874236-1-baolu.lu@linux.intel.com - Initial post. Lu Baolu (4): iommu/vt-d: Block force-snoop domain attaching if no SC support iommu/vt-d: Check domain force_snooping against attached devices iommu/vt-d: Remove domain_update_iommu_snooping() iommu/vt-d: Remove hard coding PGSNP bit in PASID entries include/linux/intel-iommu.h | 1 + drivers/iommu/intel/pasid.h | 2 + drivers/iommu/intel/iommu.c | 90 ++++++++++++++++++++++--------------- drivers/iommu/intel/pasid.c | 26 +++++++++-- 4 files changed, 80 insertions(+), 39 deletions(-) -- 2.25.1 _______________________________________________ iommu mailing list iommu@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/iommu