From nobody Fri Feb 13 15:41:31 2026 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 0DFA8CE7A88 for ; Sat, 23 Sep 2023 17:07:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232143AbjIWRHj (ORCPT ); Sat, 23 Sep 2023 13:07:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55238 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232136AbjIWRH3 (ORCPT ); Sat, 23 Sep 2023 13:07:29 -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 1D2C01A6 for ; Sat, 23 Sep 2023 10:06:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1695488798; 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=0foaQUJDnKYeTXBZ0CfBrMz9PTwxeVPI+eHRfhl6x0E=; b=dGUVrAL5d4NpzoT6GUVK0GkW69itdIgNIqfaCJYB7OGBC/f2oS9QoIfJcDqybwYmidtcym 7Btp33n+sYI7KXekR2QR+MU0M5OrA+yexkoaaXCVs9rqnM+cTIht/lY2iqKt9ARW+bJfIH SSLie/RqvvfXcdhDqAKkMDwkxgaaUh4= Received: from mimecast-mx02.redhat.com (mx-ext.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-561-0ElBDspMNB2imCymtZ9AEQ-1; Sat, 23 Sep 2023 13:06:35 -0400 X-MC-Unique: 0ElBDspMNB2imCymtZ9AEQ-1 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id CB3111C05135; Sat, 23 Sep 2023 17:06:34 +0000 (UTC) Received: from server.redhat.com (unknown [10.72.112.11]) by smtp.corp.redhat.com (Postfix) with ESMTP id A474F2156701; Sat, 23 Sep 2023 17:06:31 +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 7/7] iommufd: Skip the CACHE_COHERENCY and iommu group check Date: Sun, 24 Sep 2023 01:05:40 +0800 Message-Id: <20230923170540.1447301-8-lulu@redhat.com> In-Reply-To: <20230923170540.1447301-1-lulu@redhat.com> References: <20230923170540.1447301-1-lulu@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.1 on 10.11.54.6 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" This is just the work arround for vdpa, I Will fix these problems in the next version. Skip these 2 checks: 1.IOMMU_CAP_CACHE_COHERENCY check 2.iommu_group_get check Signed-off-by: Cindy Lu --- drivers/iommu/iommufd/device.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/iommu/iommufd/device.c b/drivers/iommu/iommufd/device.c index f7cb353fd9c7..0224d751f503 100644 --- a/drivers/iommu/iommufd/device.c +++ b/drivers/iommu/iommufd/device.c @@ -71,8 +71,8 @@ struct iommufd_device *iommufd_device_bind(struct iommufd= _ctx *ictx, * to restore cache coherency. */ if (!device_iommu_capable(dev, IOMMU_CAP_CACHE_COHERENCY)) - return ERR_PTR(-EINVAL); - + //return ERR_PTR(-EINVAL); +#if 0 group =3D iommu_group_get(dev); if (!group) return ERR_PTR(-ENODEV); @@ -80,7 +80,7 @@ struct iommufd_device *iommufd_device_bind(struct iommufd= _ctx *ictx, rc =3D iommu_device_claim_dma_owner(dev, ictx); if (rc) goto out_group_put; - +#endif idev =3D iommufd_object_alloc(ictx, idev, IOMMUFD_OBJ_DEVICE); if (IS_ERR(idev)) { rc =3D PTR_ERR(idev); --=20 2.34.3