Received: by 2002:a25:23cc:0:0:0:0:0 with SMTP id j195csp1362448ybj; Tue, 5 May 2020 19:05:31 -0700 (PDT) X-Google-Smtp-Source: APiQypL0GkW2X9AxqgorTqTG7BRpJjnZZm7kEwuWLiejr2r9uYDMuCdaZLFXeSKG1bmLS7H7gtRT X-Received: by 2002:a05:6402:17f1:: with SMTP id t17mr5158895edy.239.1588730731773; Tue, 05 May 2020 19:05:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1588730731; cv=none; d=google.com; s=arc-20160816; b=kEZnNweA8SBNVPE5GSRNfryAQUM/QhMEfR1uD053y8xsXi78xr3VGEqBtnORalUS4O K/KU/LV66I/AAWfGFlnIYDoXTFwenFdAE/LViFF8KEscxCPpjFM5Gk6+2+b2s0Vif/n1 nS7v5R6sxKzEM7dbRhKdQJ3RqRDvxl1JVSKrtPGxv3gTs0RNcYrXdhn6nkA6ExCPBWSw pkW5H3nwLkYj+OZFD8BKa2xp/iQ0Dyx5G+65L4b4/6SNhhxNbE6QM9OgfHS4B4DvWtK8 czCUi+k0Ws7dvt5Wlusa+HJODgV54HHNPqlGtoEkELFMunfVy0xRDOmaewA3YRMf+EFi 08zQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :ironport-sdr:ironport-sdr; bh=wcQtYvv9biIYqNtdsSWiqpHZp90kZCeCSmQCRZli0TE=; b=tKe5YI5C7E+++Gy+IiBw5105RSYNKMqrO9CNUT6CsXOv7N6AEPtl6oq5r1Ws93FrwC YNm0IN/kB4GAPtfx4zhulgWEWxgpVX7dcFSwE34SvsONuY9XIPxuXYJcIQwu7IJrqYOW MvpZDQhxZoLCh5fEtU9wHYkNRZ7ZXMhYOuEA5bE9/0fr6s7uuG9fJgCx5ri3GPyMHjNP y4bHhchOmNvE74l6alcsh9kIx/MVV5L1Qirmw7jBO6khWLV4vvQKvrA81rvIEdB70q8m e9ZQo3y5Ll6uD+xmm4Tf8oa35yh8gITFnidGNFDuT32D6W9VL6k282tjuA3tnldFBUz+ ra7w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id di2si254545edb.117.2020.05.05.19.05.09; Tue, 05 May 2020 19:05:31 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729768AbgEFCDN (ORCPT + 99 others); Tue, 5 May 2020 22:03:13 -0400 Received: from mga04.intel.com ([192.55.52.120]:39086 "EHLO mga04.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727986AbgEFCDN (ORCPT ); Tue, 5 May 2020 22:03:13 -0400 IronPort-SDR: EHMDYK9SA0tAO3jOEB9kgtT7ndAPGBMYCuXNttR912vRTNvc8j1PWp27Uf2FB0UhahCDnY/0bZ f0wyCymTNtuQ== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 05 May 2020 19:03:11 -0700 IronPort-SDR: EYAQbLoNwp3XOKfPvss+uAsi4T3AQA8oKDTXzARQK2Q7Pz/yFy6xL0UxT0Tn0+l5p7SFL0V+nt bOQXjH65zT6Q== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.73,357,1583222400"; d="scan'208";a="369645032" Received: from allen-box.sh.intel.com ([10.239.159.139]) by fmsmga001.fm.intel.com with ESMTP; 05 May 2020 19:03:07 -0700 From: Lu Baolu To: Joerg Roedel Cc: ashok.raj@intel.com, jacob.jun.pan@linux.intel.com, kevin.tian@intel.com, Sai Praneeth Prakhya , iommu@lists.linux-foundation.org, linux-kernel@vger.kernel.org, Daniel Drake , Derrick Jonathan , Jerry Snitselaar , Robin Murphy , Christoph Hellwig , Lu Baolu Subject: [PATCH v4 0/3] Replace private domain with per-group default domain Date: Wed, 6 May 2020 09:59:44 +0800 Message-Id: <20200506015947.28662-1-baolu.lu@linux.intel.com> X-Mailer: git-send-email 2.17.1 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Some devices are required to use a specific type (identity or dma) of default domain when they are used with a vendor iommu. When the system level default domain type is different from it, the vendor iommu driver has to request a new default domain with either iommu_request_dma_domain_for_dev() or iommu_request_dm_for_dev() in the add_dev() callback. Unfortunately, these two helpers only work when the group hasn't been assigned to any other devices, hence, some vendor iommu driver has to use a private domain if it fails to request a new default one. Joerg proposed an on-going proposal which makes the default domain framework to support configuring per-group default domain during boot process. https://lkml.org/lkml/2020/4/14/616 [This has been applied in iommu/next.] Hence, there is no need to keep the private domain implementation in the Intel IOMMU driver. This patch series aims to remove it. Best regards, baolu Change log: v3->v4: - Make the commit message of the first patch more comprehensive. v2->v3: - Port necessary patches on the top of Joerg's new proposal. https://lkml.org/lkml/2020/4/14/616 The per-group default domain proposed previously in this series will be deprecated due to a race concern between domain switching and device driver probing. v1->v2: - Rename the iommu ops callback to def_domain_type Lu Baolu (3): iommu/vt-d: Allow 32bit devices to uses DMA domain iommu/vt-d: Allow PCI sub-hierarchy to use DMA domain iommu/vt-d: Apply per-device dma_ops drivers/iommu/intel-iommu.c | 396 +++--------------------------------- 1 file changed, 26 insertions(+), 370 deletions(-) -- 2.17.1