Received: by 2002:a05:7412:8521:b0:e2:908c:2ebd with SMTP id t33csp636381rdf; Fri, 3 Nov 2023 10:18:39 -0700 (PDT) X-Google-Smtp-Source: AGHT+IG7UXhbYdzm4TiXYnfRrz0mgOxWVUqVdVFmgtjvVlSnHyVtCcuAWVR98bxaeaSY/4MjVDfz X-Received: by 2002:a05:6a00:3a0e:b0:6c3:402a:d54d with SMTP id fj14-20020a056a003a0e00b006c3402ad54dmr4680347pfb.11.1699031919271; Fri, 03 Nov 2023 10:18:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1699031919; cv=none; d=google.com; s=arc-20160816; b=L/BOwfCqn+m+n3/eCcohmAzYDFbJ1a4RPe0VSUE/VV3nX9jvutWMc1Mt8ZoNc1RP1O 993cBks4VTi+03eUSqlvm7P+sVH6YfgKvKE8Jp4iELdAFgLDrcFolAGRFy7U7USzlhw1 HxvzDFedztXrBMhUOvqIeRgxmVxUy+Vg4t4VvnEZTHe6qK7v96a6FUq7S7ny4kmXtMcq fqs9Z6BDeiGKaLxcarpcYxh/7zJ1+Zt5VR6VmSO6QTrqRRugpajxnnteD3O6U6DAiWnd BmNNY6OvVY6rMTBtXKhVHihV9nBgBiG2w3b8rlcRBjq8C5gsTcpPQOa2lHwwDtxbBY7e O7Bw== 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=qZcijrBkenJpJgKIh5nn77fb44ksEJ9Uwp/HPtluVaY=; fh=xiBZnYthZkU72K3VlivZH8ewgfrUkWRaBxXhAGtxMAw=; b=oeqerJJZ4icYPufTXI3lFQ3hKU/nO/aCQhLOG+TWWaoVAK515KsxDKphbt5QWdqdpJ vthkBSDD8MNrqIug8k1BFRiwY6tjItAzfrc5mrhGDPhORbAD6QwbBQIrfofYj4KnuDy7 L+v6knLwxxY77jMTe5IIEPKr1wogAKic+mAXA4CEGNDQyUm2GZK4o/DX4tsPvoh78o2K g+p5k6Qm+ZRbX+OP9gF0TpHORFBjwO6THplOMKhUk6pBNOxOzPaY9x5w0ocPojqPbktc /xWfuBWF/9mmm7x0pEFO1AKJKtINdE2CTZCg3076rWsGP5Y1kCRWbTSTd1h3BKUCTrDB LTCA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=FLhpaRJ4; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 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 lipwig.vger.email (lipwig.vger.email. [2620:137:e000::3:3]) by mx.google.com with ESMTPS id l189-20020a633ec6000000b005b999968b85si1892502pga.666.2023.11.03.10.18.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 03 Nov 2023 10:18:39 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) client-ip=2620:137:e000::3:3; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=FLhpaRJ4; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 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 lipwig.vger.email (Postfix) with ESMTP id 95661832F66D; Fri, 3 Nov 2023 10:18:35 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1376478AbjKCRSZ (ORCPT + 99 others); Fri, 3 Nov 2023 13:18:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40166 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1377249AbjKCRSX (ORCPT ); Fri, 3 Nov 2023 13:18:23 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 05517D48 for ; Fri, 3 Nov 2023 10:17:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1699031859; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=qZcijrBkenJpJgKIh5nn77fb44ksEJ9Uwp/HPtluVaY=; b=FLhpaRJ43evcLk4oVC0416wghzrtz+4oiTFODPMtRG8iQfwyB7zPuQfxnyy6KYi+SSeWyI zbSz3P9jRVj1Iv5pMknBHfBdWwkudzpl1DDdNJW3zanzRTbPmCCLsgdrXVFORxp1v1Rl1P 4fuvJo33hpdky5V1MDBmAnLphGI+uhI= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-396-WVF19FtuOU6EB2xsKppuQQ-1; Fri, 03 Nov 2023 13:17:34 -0400 X-MC-Unique: WVF19FtuOU6EB2xsKppuQQ-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.rdu2.redhat.com [10.11.54.8]) (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 B31B6101389C; Fri, 3 Nov 2023 17:17:28 +0000 (UTC) Received: from server.redhat.com (unknown [10.72.112.41]) by smtp.corp.redhat.com (Postfix) with ESMTP id 8A0CFC15983; Fri, 3 Nov 2023 17:17:25 +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 5/8] vdpa_sim :Add support for iommufd Date: Sat, 4 Nov 2023 01:16:38 +0800 Message-Id: <20231103171641.1703146-6-lulu@redhat.com> In-Reply-To: <20231103171641.1703146-1-lulu@redhat.com> References: <20231103171641.1703146-1-lulu@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.8 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 lipwig.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 (lipwig.vger.email [0.0.0.0]); Fri, 03 Nov 2023 10:18:35 -0700 (PDT) Add new vdpa_config_ops function to support iommufd Signed-off-by: Cindy Lu --- drivers/vdpa/vdpa_sim/vdpa_sim.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/drivers/vdpa/vdpa_sim/vdpa_sim.c b/drivers/vdpa/vdpa_sim/vdpa_sim.c index 76d41058add9..9400ec32ec41 100644 --- a/drivers/vdpa/vdpa_sim/vdpa_sim.c +++ b/drivers/vdpa/vdpa_sim/vdpa_sim.c @@ -762,6 +762,10 @@ static const struct vdpa_config_ops vdpasim_config_ops = { .bind_mm = vdpasim_bind_mm, .unbind_mm = vdpasim_unbind_mm, .free = vdpasim_free, + .bind_iommufd = vdpa_iommufd_emulated_bind, + .unbind_iommufd = vdpa_iommufd_emulated_unbind, + .attach_ioas = vdpa_iommufd_emulated_attach_ioas, + .detach_ioas = vdpa_iommufd_emulated_detach_ioas, }; static const struct vdpa_config_ops vdpasim_batch_config_ops = { @@ -799,6 +803,10 @@ static const struct vdpa_config_ops vdpasim_batch_config_ops = { .bind_mm = vdpasim_bind_mm, .unbind_mm = vdpasim_unbind_mm, .free = vdpasim_free, + .bind_iommufd = vdpa_iommufd_emulated_bind, + .unbind_iommufd = vdpa_iommufd_emulated_unbind, + .attach_ioas = vdpa_iommufd_emulated_attach_ioas, + .detach_ioas = vdpa_iommufd_emulated_detach_ioas, }; MODULE_VERSION(DRV_VERSION); -- 2.34.3