Received: by 2002:a05:7412:8521:b0:e2:908c:2ebd with SMTP id t33csp636746rdf; Fri, 3 Nov 2023 10:19:12 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHgEmm2uhsOY9jyei4MpdsEtdQ01HI0iDHRjPygnrr1zV90UAcnO016QmER6+WHNkzdhb9M X-Received: by 2002:a17:90b:3b88:b0:280:94e8:99f8 with SMTP id pc8-20020a17090b3b8800b0028094e899f8mr4642452pjb.10.1699031952139; Fri, 03 Nov 2023 10:19:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1699031952; cv=none; d=google.com; s=arc-20160816; b=IVZ1Vmz1EfjlWXMs5gd0XaIc5Wq8i+8/SFNOkc7s7ZEEfGHOxfsPvVgiN9+MLwdrQz sSQZ0HkSQPmSiaekWistc1PtogEP2YDRzxP3trSGPZL8suwhxC+ty9ER6ywgPvyDOJOZ tD552vtuiMN5WfzrT1kQF0tQOq+7LKs1GUbHWZreKB+wRjBzJPoyJ0W5oq0KvdxSr1HU Ptqd8gT8r34puWw8GKxcHV4ylLBjln2cg2i47KhNWgpf0zCE/Oi4DcnXYFRjObz4TUwG luN2djNrbg87Fo4b1Idx5Jd6PKiCStNwziaa6ydB3Com9o5mJEQQenxi2s9Y/pJC2S6o 5ifQ== 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 :references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=aCTB8Gg9xttEfEVtECz9fqwzez2GQHqNSW6hXp3Vsbk=; fh=xiBZnYthZkU72K3VlivZH8ewgfrUkWRaBxXhAGtxMAw=; b=zTNNiWtudFTrLTM4zhlXzlgz+kxVxp12Y+2yzi9zZ7V2HapRH9kR42QM6cmAzSN4RZ ILp85ixfBf/ysnu/klobHWoacakIFMlwTarc1MOOqdzNCIgXnoMryCccAatzAK+ZSnA1 8GbYFyD/78786bNTO4uB1vLQupFJoO+d1rNMtWNIhqtYZawj2lJOTtA4Sl59PRT0etBt 54fZbiNytaDUCSV2kwUtzOA+tZFO4wC4l7F2yxzx3iJkvYLAyjiD+eJ1JoAkSuXssyRp /tjtaBAvsX6ivnL05D8wv+HJqiD54Dy5OZbUln2SSnn8UqrqkSrEDNIzYcbl3jxdnz1I b5uw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=CncPKdss; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from fry.vger.email (fry.vger.email. [2620:137:e000::3:8]) by mx.google.com with ESMTPS id h16-20020a17090acf1000b002680f00f8f3si1945188pju.17.2023.11.03.10.19.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 03 Nov 2023 10:19:12 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) client-ip=2620:137:e000::3:8; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=CncPKdss; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by fry.vger.email (Postfix) with ESMTP id A100F81BDB9A; Fri, 3 Nov 2023 10:19:09 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at fry.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1376991AbjKCRTA (ORCPT + 99 others); Fri, 3 Nov 2023 13:19:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45978 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230202AbjKCRS7 (ORCPT ); Fri, 3 Nov 2023 13:18:59 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 17BF810C4 for ; Fri, 3 Nov 2023 10:18:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1699031885; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=aCTB8Gg9xttEfEVtECz9fqwzez2GQHqNSW6hXp3Vsbk=; b=CncPKdsswMVl/lCkDzCSPz8NMM0ddK5mJGhnm6h4Ifs22e2h5RJCxw2EIu3CVAYrcaWIbC YZmIhr+aZYjuOZPeQjvz5Nyt74dqlugLRp+l2FHdAem9zxhynEnHqY0GbnmOhSOIXu9/XT qEhsJkkRjrD1U134h9n0HlGbj1z0w+o= Received: from mimecast-mx02.redhat.com (mx-ext.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-161-HmhpnDUUNMKaWArsODPEXQ-1; Fri, 03 Nov 2023 13:18:02 -0400 X-MC-Unique: HmhpnDUUNMKaWArsODPEXQ-1 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 902D33C16DDC; Fri, 3 Nov 2023 17:18:01 +0000 (UTC) Received: from server.redhat.com (unknown [10.72.112.41]) by smtp.corp.redhat.com (Postfix) with ESMTP id 63D381121309; Fri, 3 Nov 2023 17:17:58 +0000 (UTC) From: Cindy Lu To: lulu@redhat.com, jasowang@redhat.com, mst@redhat.com, yi.l.liu@intel.com, jgg@nvidia.com, linux-kernel@vger.kernel.org, virtualization@lists.linux-foundation.org, netdev@vger.kernel.org Subject: [RFC v1 8/8] iommu: expose the function iommu_device_use_default_domain Date: Sat, 4 Nov 2023 01:16:41 +0800 Message-Id: <20231103171641.1703146-9-lulu@redhat.com> In-Reply-To: <20231103171641.1703146-1-lulu@redhat.com> References: <20231103171641.1703146-1-lulu@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.3 X-Spam-Status: No, score=-1.3 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,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 fry.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (fry.vger.email [0.0.0.0]); Fri, 03 Nov 2023 10:19:10 -0700 (PDT) Expose the function iommu_device_use_default_domain() and iommu_device_unuse_default_domain(), While vdpa bind the iommufd device and detach the iommu device, vdpa need to call the function iommu_device_unuse_default_domain() to release the owner Signed-off-by: Cindy Lu --- drivers/iommu/iommu.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/iommu/iommu.c b/drivers/iommu/iommu.c index 3bfc56df4f78..987cbf8c9a87 100644 --- a/drivers/iommu/iommu.c +++ b/drivers/iommu/iommu.c @@ -3164,6 +3164,7 @@ int iommu_device_use_default_domain(struct device *dev) return ret; } +EXPORT_SYMBOL_GPL(iommu_device_use_default_domain); /** * iommu_device_unuse_default_domain() - Device driver stops handling device @@ -3187,6 +3188,7 @@ void iommu_device_unuse_default_domain(struct device *dev) mutex_unlock(&group->mutex); iommu_group_put(group); } +EXPORT_SYMBOL_GPL(iommu_device_unuse_default_domain); static int __iommu_group_alloc_blocking_domain(struct iommu_group *group) { -- 2.34.3