Received: by 2002:ac2:464d:0:0:0:0:0 with SMTP id s13csp3270257lfo; Mon, 23 May 2022 00:22:36 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyOZ9ml/FPC3nbdNiFlAILkpMKr9JDFdowZTFUEz6C5cX8XPsyk3WzSG4Zc6VcXkDyBYmN2 X-Received: by 2002:a17:902:be01:b0:15e:fb07:ba85 with SMTP id r1-20020a170902be0100b0015efb07ba85mr21915463pls.85.1653290556318; Mon, 23 May 2022 00:22:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1653290556; cv=none; d=google.com; s=arc-20160816; b=ZYHTYcPTGeVC7CBV8QTfuu7sMHe6WCmhAzhpXve7r8EVXbdhDJR90NtQp0iGPcs6Da M/awmYd4TmBoe1iL1aExWY1uKDutvGkGZ38d0TW9/OKnM1UBl3N8sfLuV/LDmUpL5Ne/ vWG66DlDGtUHJgXS2gWJRui59ji3bafResFB8LdHkXkElf+eQAdBs4eKuJXQwXcyjcIn HowPdhjL31aCUT1Apx953Xib2QRCbxW8baTV9UrofqWyCveZQjkAnpKdxUvryesiU2SG NkW/p9KAHhOy/h6ccy/sSTte8/YRzToQ/XcycwX/hJA9KE2FB3ju9kZZmU4CbxB+X07R fZeQ== 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:to:content-language:subject:cc:user-agent:mime-version :date:message-id:dkim-signature; bh=yGGFztD8CnLIgRg0Sbmn+tB1cYEQKGV4O9+7aSt4vWU=; b=bjjpdf2OFHoYaaUEa8rChWroKrgfDHeu5wDzhrGryU5jpdA8jMe3sdgiqIRK3Wu0gH YXGFt1XNKoYy8xE+/iyMWIZG7fYx3U8pYKP0KFN0lgeF0yYSjjmOVkmyXMafVdbsKGRh BTNJ1MgofrXkbnpZjnVBUXoFXe+r74r8nk+hF4K401PVq1TJRNaa9cCtNcyHrnX5Dhh1 gzNkIOoyautA5foKrfZbX5+p0MzUkoOLhpMEdyCst6cskmjHJaihHruCqSS+0r5QJiMe 2DfSeGZRD7oyBr9Ec67SDbUux6n8GGJhufGwjo7wRYtCjJZ6IgWDH2UGtOfQ/R2N61Ny cpeg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b="KfAhV/Zr"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 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 lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id y16-20020a170902b49000b0015d52457704si9853688plr.475.2022.05.23.00.22.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 May 2022 00:22:36 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b="KfAhV/Zr"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 48BD4A0D16; Sun, 22 May 2022 23:37:44 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1348328AbiETLDK (ORCPT + 99 others); Fri, 20 May 2022 07:03:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33080 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1348312AbiETLDJ (ORCPT ); Fri, 20 May 2022 07:03:09 -0400 Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1B4A91498DC for ; Fri, 20 May 2022 04:03:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1653044588; x=1684580588; h=message-id:date:mime-version:cc:subject:to:references: from:in-reply-to:content-transfer-encoding; bh=64uK/wIWiSqexpwgngQnIl6DO+Ru93LCQrKFKwJZoRk=; b=KfAhV/ZrgZDAepWxRu41zxNeMcsjIA80VnbBjm96VSh+17JBVnKcv38q 7Vy2AKhfGIjc1SPPWiYac1Ay47tt+UosNnc7zJTeDYhjieKHSj6cHN/az 4pU7QG7JU2QKuk6hdb29fsAumNHp6aMApg9lQkEqNWUZ0YDIxboTvMyM4 Tw08WZkY9ctx+9h98Dqj14kQe5WGNLQ9H37BMSaVYb4paSCxLogoPgHPT 0ueWSjMiR1ZfmfalU8HFiZoSKXEynQsCboTg1uSGMqYSxVC4ZdKwh1QBs 8ywTS6cfrImYHCLbO6gttN5wzPDsmNbbCy86rNuLLERNnYSi9TzKib55K w==; X-IronPort-AV: E=McAfee;i="6400,9594,10352"; a="260157077" X-IronPort-AV: E=Sophos;i="5.91,239,1647327600"; d="scan'208";a="260157077" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 20 May 2022 04:03:07 -0700 X-IronPort-AV: E=Sophos;i="5.91,239,1647327600"; d="scan'208";a="599166968" Received: from wangyu5-mobl.ccr.corp.intel.com (HELO [10.249.172.121]) ([10.249.172.121]) by orsmga008-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 20 May 2022 04:03:04 -0700 Message-ID: <9e786a91-6239-1fa5-cad9-f319794b6055@linux.intel.com> Date: Fri, 20 May 2022 19:03:02 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.8.1 Cc: baolu.lu@linux.intel.com, Jason Gunthorpe , Christoph Hellwig , Kevin Tian , Ashok Raj , Will Deacon , Robin Murphy , Jean-Philippe Brucker , Eric Auger , Liu Yi L , Jacob jun Pan , iommu@lists.linux-foundation.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 2/5] iommu: Add blocking_domain_ops field in iommu_ops Content-Language: en-US To: Joerg Roedel References: <20220516015759.2952771-1-baolu.lu@linux.intel.com> <20220516015759.2952771-3-baolu.lu@linux.intel.com> From: Baolu Lu In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-3.6 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,NICE_REPLY_A,RDNS_NONE,SPF_HELO_NONE, T_SCC_BODY_TEXT_LINE autolearn=unavailable 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/20 16:45, Joerg Roedel wrote: > On Mon, May 16, 2022 at 09:57:56AM +0800, Lu Baolu wrote: >> const struct iommu_domain_ops *default_domain_ops; >> + const struct iommu_domain_ops *blocking_domain_ops; > > I don't understand why extra domain-ops are needed for this. I think it > would be more straight-forward to implement allocation of > IOMMU_DOMAIN_BLOCKED domains in each driver and let the details be > handled in the set_dev() call-back. The IOMMU driver can make sure DMA > is blocked for a device when it encounters a IOMMU_DOMAIN_BLOCKED > domain. > > For IOMMUs that have no explicit way to block DMA could just use an > unmanaged domain with an empty page-table. Yes, this is what will go. Best regards, baolu