From mboxrd@z Thu Jan 1 00:00:00 1970 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 E3CDFCCA47F for ; Fri, 24 Jun 2022 05:39:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229715AbiFXFjM (ORCPT ); Fri, 24 Jun 2022 01:39:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60352 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229451AbiFXFjL (ORCPT ); Fri, 24 Jun 2022 01:39:11 -0400 Received: from mailgw01.mediatek.com (unknown [60.244.123.138]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 66D405DF19; Thu, 23 Jun 2022 22:39:05 -0700 (PDT) X-UUID: 8974fcc91cf4473f861aa31b1ed3be7e-20220624 X-CID-P-RULE: Release_Ham X-CID-O-INFO: VERSION:1.1.6,REQID:696aae49-583a-4e22-9975-bd4e6d524399,OB:0,LO B:0,IP:0,URL:0,TC:0,Content:0,EDM:0,RT:0,SF:0,FILE:0,RULE:Release_Ham,ACTI ON:release,TS:0 X-CID-META: VersionHash:b14ad71,CLOUDID:17d673d8-850a-491d-a127-60d9309b2b3e,C OID:IGNORED,Recheck:0,SF:nil,TC:nil,Content:0,EDM:-3,IP:nil,URL:1,File:nil ,QS:nil,BEC:nil,COL:0 X-UUID: 8974fcc91cf4473f861aa31b1ed3be7e-20220624 Received: from mtkmbs11n2.mediatek.inc [(172.21.101.187)] by mailgw01.mediatek.com (envelope-from ) (Generic MTA with TLSv1.2 ECDHE-RSA-AES256-GCM-SHA384 256/256) with ESMTP id 2041637942; Fri, 24 Jun 2022 13:39:01 +0800 Received: from mtkmbs07n1.mediatek.inc (172.21.101.16) by mtkmbs10n1.mediatek.inc (172.21.101.34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.2.792.15; Fri, 24 Jun 2022 13:39:00 +0800 Received: from mtkcas10.mediatek.inc (172.21.101.39) by mtkmbs07n1.mediatek.inc (172.21.101.16) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Fri, 24 Jun 2022 13:39:00 +0800 Received: from mhfsdcap04 (10.17.3.154) by mtkcas10.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Fri, 24 Jun 2022 13:38:58 +0800 Message-ID: <8a5e9c81ab1487154828af3ca21e62e39bcce18c.camel@mediatek.com> Subject: Re: [PATCH v3 1/5] iommu: Return -EMEDIUMTYPE for incompatible domain and device/group From: Yong Wu To: Nicolin Chen , Baolu Lu CC: , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , Date: Fri, 24 Jun 2022 13:38:58 +0800 In-Reply-To: References: <20220623200029.26007-1-nicolinc@nvidia.com> <20220623200029.26007-2-nicolinc@nvidia.com> <270eec00-8aee-2288-4069-d604e6da2925@linux.intel.com> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.28.5-0ubuntu0.18.04.2 MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-MTK: N Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org On Thu, 2022-06-23 at 19:44 -0700, Nicolin Chen wrote: > On Fri, Jun 24, 2022 at 09:35:49AM +0800, Baolu Lu wrote: > > External email: Use caution opening links or attachments > > > > > > On 2022/6/24 04:00, Nicolin Chen wrote: > > > diff --git a/drivers/iommu/mtk_iommu_v1.c > > > b/drivers/iommu/mtk_iommu_v1.c > > > index e1cb51b9866c..5386d889429d 100644 > > > --- a/drivers/iommu/mtk_iommu_v1.c > > > +++ b/drivers/iommu/mtk_iommu_v1.c > > > @@ -304,7 +304,7 @@ static int mtk_iommu_v1_attach_device(struct > > > iommu_domain *domain, struct device > > > /* Only allow the domain created internally. */ > > > mtk_mapping = data->mapping; > > > if (mtk_mapping->domain != domain) > > > - return 0; > > > + return -EMEDIUMTYPE; > > > > > > if (!data->m4u_dom) { > > > data->m4u_dom = dom; > > > > This change looks odd. It turns the return value from success to > > failure. Is it a bug? If so, it should go through a separated fix > > patch. Thanks for the review:) > > Makes sense. > > I read the commit log of the original change: > https://lore.kernel.org/r/1589530123-30240-1-git-send-email-yong.wu@mediatek.com > > It doesn't seem to allow devices to get attached to different > domains other than the shared mapping->domain, created in the > in the mtk_iommu_probe_device(). So it looks like returning 0 > is intentional. Though I am still very confused by this return > value here, I doubt it has ever been used in a VFIO context. It's not used in VFIO context. "return 0" just satisfy the iommu framework to go ahead. and yes, here we only allow the shared "mapping- >domain" (All the devices share a domain created internally). thus I think we should still keep "return 0" here. Thanks:) > > Young, would you please give us some input? > > Overall, I feel it's better to play it safe here by dropping > this part. If we later confirm there is a need to fix it, we > will do that in a separate patch anyway. > > Thanks > Nic From mboxrd@z Thu Jan 1 00:00:00 1970 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 smtp3.osuosl.org (smtp3.osuosl.org [140.211.166.136]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 963B5C43334 for ; Fri, 24 Jun 2022 05:39:17 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp3.osuosl.org (Postfix) with ESMTP id 219F7611D3; Fri, 24 Jun 2022 05:39:17 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp3.osuosl.org 219F7611D3 X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp3.osuosl.org ([127.0.0.1]) by localhost (smtp3.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id aPXoTZFoDIJ8; Fri, 24 Jun 2022 05:39:16 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [140.211.9.56]) by smtp3.osuosl.org (Postfix) with ESMTPS id B94ED60B9A; Fri, 24 Jun 2022 05:39:15 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp3.osuosl.org B94ED60B9A Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id 70FC1C0039; Fri, 24 Jun 2022 05:39:15 +0000 (UTC) Received: from smtp1.osuosl.org (smtp1.osuosl.org [140.211.166.138]) by lists.linuxfoundation.org (Postfix) with ESMTP id 8167BC002D; Fri, 24 Jun 2022 05:39:14 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp1.osuosl.org (Postfix) with ESMTP id 4612C84848; Fri, 24 Jun 2022 05:39:14 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp1.osuosl.org 4612C84848 X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp1.osuosl.org ([127.0.0.1]) by localhost (smtp1.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id cPz_BvAbCV52; Fri, 24 Jun 2022 05:39:07 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.8.0 DKIM-Filter: OpenDKIM Filter v2.11.0 smtp1.osuosl.org 254A4847AA X-Greylist: domain auto-whitelisted by SQLgrey-1.8.0 Received: from mailgw01.mediatek.com (unknown [60.244.123.138]) by smtp1.osuosl.org (Postfix) with ESMTPS id 254A4847AA; Fri, 24 Jun 2022 05:39:06 +0000 (UTC) X-UUID: 8974fcc91cf4473f861aa31b1ed3be7e-20220624 X-CID-P-RULE: Release_Ham X-CID-O-INFO: VERSION:1.1.6, REQID:696aae49-583a-4e22-9975-bd4e6d524399, OB:0, LO B:0,IP:0,URL:0,TC:0,Content:0,EDM:0,RT:0,SF:0,FILE:0,RULE:Release_Ham,ACTI ON:release,TS:0 X-CID-META: VersionHash:b14ad71, CLOUDID:17d673d8-850a-491d-a127-60d9309b2b3e, C OID:IGNORED,Recheck:0,SF:nil,TC:nil,Content:0,EDM:-3,IP:nil,URL:1,File:nil ,QS:nil,BEC:nil,COL:0 X-UUID: 8974fcc91cf4473f861aa31b1ed3be7e-20220624 Received: from mtkmbs11n2.mediatek.inc [(172.21.101.187)] by mailgw01.mediatek.com (envelope-from ) (Generic MTA with TLSv1.2 ECDHE-RSA-AES256-GCM-SHA384 256/256) with ESMTP id 2041637942; Fri, 24 Jun 2022 13:39:01 +0800 Received: from mtkmbs07n1.mediatek.inc (172.21.101.16) by mtkmbs10n1.mediatek.inc (172.21.101.34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.2.792.15; Fri, 24 Jun 2022 13:39:00 +0800 Received: from mtkcas10.mediatek.inc (172.21.101.39) by mtkmbs07n1.mediatek.inc (172.21.101.16) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Fri, 24 Jun 2022 13:39:00 +0800 Received: from mhfsdcap04 (10.17.3.154) by mtkcas10.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Fri, 24 Jun 2022 13:38:58 +0800 Message-ID: <8a5e9c81ab1487154828af3ca21e62e39bcce18c.camel@mediatek.com> Subject: Re: [PATCH v3 1/5] iommu: Return -EMEDIUMTYPE for incompatible domain and device/group To: Nicolin Chen , Baolu Lu Date: Fri, 24 Jun 2022 13:38:58 +0800 In-Reply-To: References: <20220623200029.26007-1-nicolinc@nvidia.com> <20220623200029.26007-2-nicolinc@nvidia.com> <270eec00-8aee-2288-4069-d604e6da2925@linux.intel.com> X-Mailer: Evolution 3.28.5-0ubuntu0.18.04.2 MIME-Version: 1.0 X-MTK: N Cc: linux-s390@vger.kernel.org, cohuck@redhat.com, jordan@cosmicpenguin.net, linux-tegra@vger.kernel.org, thierry.reding@gmail.com, will@kernel.org, alyssa@rosenzweig.io, jean-philippe@linaro.org, kvm@vger.kernel.org, zhang.lyra@gmail.com, iommu@lists.linux-foundation.org, jonathanh@nvidia.com, jgg@nvidia.com, yangyingliang@huawei.com, orsonzhai@gmail.com, gerald.schaefer@linux.ibm.com, kevin.tian@intel.com, linux-arm-msm@vger.kernel.org, alex.williamson@redhat.com, christophe.jaillet@wanadoo.fr, matthias.bgg@gmail.com, tglx@linutronix.de, virtualization@lists.linux-foundation.org, linux-arm-kernel@lists.infradead.org, dwmw2@infradead.org, marcan@marcan.st, linux-kernel@vger.kernel.org, baolin.wang7@gmail.com, linux-mediatek@lists.infradead.org, robin.murphy@arm.com X-BeenThere: iommu@lists.linux-foundation.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: Development issues for Linux IOMMU support List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Yong Wu via iommu Reply-To: Yong Wu Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: iommu-bounces@lists.linux-foundation.org Sender: "iommu" On Thu, 2022-06-23 at 19:44 -0700, Nicolin Chen wrote: > On Fri, Jun 24, 2022 at 09:35:49AM +0800, Baolu Lu wrote: > > External email: Use caution opening links or attachments > > > > > > On 2022/6/24 04:00, Nicolin Chen wrote: > > > diff --git a/drivers/iommu/mtk_iommu_v1.c > > > b/drivers/iommu/mtk_iommu_v1.c > > > index e1cb51b9866c..5386d889429d 100644 > > > --- a/drivers/iommu/mtk_iommu_v1.c > > > +++ b/drivers/iommu/mtk_iommu_v1.c > > > @@ -304,7 +304,7 @@ static int mtk_iommu_v1_attach_device(struct > > > iommu_domain *domain, struct device > > > /* Only allow the domain created internally. */ > > > mtk_mapping = data->mapping; > > > if (mtk_mapping->domain != domain) > > > - return 0; > > > + return -EMEDIUMTYPE; > > > > > > if (!data->m4u_dom) { > > > data->m4u_dom = dom; > > > > This change looks odd. It turns the return value from success to > > failure. Is it a bug? If so, it should go through a separated fix > > patch. Thanks for the review:) > > Makes sense. > > I read the commit log of the original change: > https://lore.kernel.org/r/1589530123-30240-1-git-send-email-yong.wu@mediatek.com > > It doesn't seem to allow devices to get attached to different > domains other than the shared mapping->domain, created in the > in the mtk_iommu_probe_device(). So it looks like returning 0 > is intentional. Though I am still very confused by this return > value here, I doubt it has ever been used in a VFIO context. It's not used in VFIO context. "return 0" just satisfy the iommu framework to go ahead. and yes, here we only allow the shared "mapping- >domain" (All the devices share a domain created internally). thus I think we should still keep "return 0" here. Thanks:) > > Young, would you please give us some input? > > Overall, I feel it's better to play it safe here by dropping > this part. If we later confirm there is a need to fix it, we > will do that in a separate patch anyway. > > Thanks > Nic _______________________________________________ iommu mailing list iommu@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/iommu From mboxrd@z Thu Jan 1 00:00:00 1970 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 1FD83C433EF for ; Fri, 24 Jun 2022 05:40:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Date:To:From:Subject:Message-ID:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=AG/rXbRCgPaayywHfLVH6PXwuV41/VWAsmFV1Mz91ok=; b=tgwGsVLMyDDC1n AGVcY/VTYHFS/zqToCmaDqy+UYPA4XDomsiMgB7brT7VgJklI8yKAQfbMTbGNS1RkZS7168wIe0PW EA8lViIoJIUKRTAXQxXYXtC2PFwyd631SOBNL5n4+PxGzIg4903zAPsutjTsyyErrWdMqzAGbF2FI j7ExQUMLarkFgoUStpqKJwhGL7jRT9NRXkxC8GYxWNRtYQos6mwX8swsSRZXYwPD0yL7L11WWVnoI M+qQDFYaU966rexyM6LAowEXbAgTO3A5hwD1e9Gw/wFkc3Rv2rOVu/Rulv7tKC4SeBdkfxhmV93C/ YPBI4fu06yvgiaX8KaQg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1o4c2J-000fkK-Ai; Fri, 24 Jun 2022 05:39:20 +0000 Received: from mailgw01.mediatek.com ([216.200.240.184]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1o4c2C-000ffd-6y; Fri, 24 Jun 2022 05:39:13 +0000 X-UUID: 75765a9b001b46889ba13663dd846426-20220623 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mediatek.com; s=dk; h=Content-Transfer-Encoding:MIME-Version:Content-Type:References:In-Reply-To:Date:CC:To:From:Subject:Message-ID; bh=kdVipdiWBd+Z9DOtHVXmI/fn4Mj+LbqmJlWncRaZEH4=; b=gUOvIPz5lZh5OAxV813gOt2tJnafJladAwbD6kc7U6tLAc1Hl2OI292MRaAdLHBwysBL7s16SqbTwYksl7cYbpqA9wFoL+zV7azFq3ZI0NZKBZAO3+hGzZBQrkK6qnyAoAbp4l6SYMkt188YufkNaDFtJUyCQ5zznCu139nGbq0=; X-CID-P-RULE: Release_Ham X-CID-O-INFO: VERSION:1.1.6,REQID:ed8d98ba-f4ff-42c4-8288-c6848d53f692,OB:0,LO B:0,IP:0,URL:0,TC:0,Content:0,EDM:0,RT:0,SF:0,FILE:0,RULE:Release_Ham,ACTI ON:release,TS:0 X-CID-META: VersionHash:b14ad71,CLOUDID:5a8365ea-f7af-4e69-92ee-0fd74a0c286c,C OID:IGNORED,Recheck:0,SF:nil,TC:nil,Content:0,EDM:-3,IP:nil,URL:1,File:nil ,QS:nil,BEC:nil,COL:0 X-UUID: 75765a9b001b46889ba13663dd846426-20220623 Received: from mtkcas67.mediatek.inc [(172.29.193.45)] by mailgw01.mediatek.com (envelope-from ) (musrelay.mediatek.com ESMTP with TLSv1.2 ECDHE-RSA-AES256-SHA384 256/256) with ESMTP id 1209477585; Thu, 23 Jun 2022 22:39:03 -0700 Received: from mtkmbs07n1.mediatek.inc (172.21.101.16) by MTKMBS62N1.mediatek.inc (172.29.193.41) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Thu, 23 Jun 2022 22:39:01 -0700 Received: from mtkcas10.mediatek.inc (172.21.101.39) by mtkmbs07n1.mediatek.inc (172.21.101.16) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Fri, 24 Jun 2022 13:39:00 +0800 Received: from mhfsdcap04 (10.17.3.154) by mtkcas10.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Fri, 24 Jun 2022 13:38:58 +0800 Message-ID: <8a5e9c81ab1487154828af3ca21e62e39bcce18c.camel@mediatek.com> Subject: Re: [PATCH v3 1/5] iommu: Return -EMEDIUMTYPE for incompatible domain and device/group From: Yong Wu To: Nicolin Chen , Baolu Lu Date: Fri, 24 Jun 2022 13:38:58 +0800 In-Reply-To: References: <20220623200029.26007-1-nicolinc@nvidia.com> <20220623200029.26007-2-nicolinc@nvidia.com> <270eec00-8aee-2288-4069-d604e6da2925@linux.intel.com> X-Mailer: Evolution 3.28.5-0ubuntu0.18.04.2 MIME-Version: 1.0 X-MTK: N X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220623_223912_348166_9CE68A39 X-CRM114-Status: GOOD ( 28.06 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-s390@vger.kernel.org, cohuck@redhat.com, mjrosato@linux.ibm.com, jordan@cosmicpenguin.net, linux-tegra@vger.kernel.org, thierry.reding@gmail.com, will@kernel.org, alyssa@rosenzweig.io, jean-philippe@linaro.org, kvm@vger.kernel.org, zhang.lyra@gmail.com, joro@8bytes.org, iommu@lists.linux-foundation.org, jonathanh@nvidia.com, jgg@nvidia.com, yangyingliang@huawei.com, orsonzhai@gmail.com, gerald.schaefer@linux.ibm.com, kevin.tian@intel.com, sven@svenpeter.dev, linux-arm-msm@vger.kernel.org, john.garry@huawei.com, alex.williamson@redhat.com, christophe.jaillet@wanadoo.fr, thunder.leizhen@huawei.com, matthias.bgg@gmail.com, tglx@linutronix.de, virtualization@lists.linux-foundation.org, linux-arm-kernel@lists.infradead.org, chenxiang66@hisilicon.com, dwmw2@infradead.org, marcan@marcan.st, linux-kernel@vger.kernel.org, robdclark@gmail.com, suravee.suthikulpanit@amd.com, baolin.wang7@gmail.com, linux-mediatek@lists.infradead.org, robin.murphy@arm.com Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Thu, 2022-06-23 at 19:44 -0700, Nicolin Chen wrote: > On Fri, Jun 24, 2022 at 09:35:49AM +0800, Baolu Lu wrote: > > External email: Use caution opening links or attachments > > > > > > On 2022/6/24 04:00, Nicolin Chen wrote: > > > diff --git a/drivers/iommu/mtk_iommu_v1.c > > > b/drivers/iommu/mtk_iommu_v1.c > > > index e1cb51b9866c..5386d889429d 100644 > > > --- a/drivers/iommu/mtk_iommu_v1.c > > > +++ b/drivers/iommu/mtk_iommu_v1.c > > > @@ -304,7 +304,7 @@ static int mtk_iommu_v1_attach_device(struct > > > iommu_domain *domain, struct device > > > /* Only allow the domain created internally. */ > > > mtk_mapping = data->mapping; > > > if (mtk_mapping->domain != domain) > > > - return 0; > > > + return -EMEDIUMTYPE; > > > > > > if (!data->m4u_dom) { > > > data->m4u_dom = dom; > > > > This change looks odd. It turns the return value from success to > > failure. Is it a bug? If so, it should go through a separated fix > > patch. Thanks for the review:) > > Makes sense. > > I read the commit log of the original change: > https://lore.kernel.org/r/1589530123-30240-1-git-send-email-yong.wu@mediatek.com > > It doesn't seem to allow devices to get attached to different > domains other than the shared mapping->domain, created in the > in the mtk_iommu_probe_device(). So it looks like returning 0 > is intentional. Though I am still very confused by this return > value here, I doubt it has ever been used in a VFIO context. It's not used in VFIO context. "return 0" just satisfy the iommu framework to go ahead. and yes, here we only allow the shared "mapping- >domain" (All the devices share a domain created internally). thus I think we should still keep "return 0" here. Thanks:) > > Young, would you please give us some input? > > Overall, I feel it's better to play it safe here by dropping > this part. If we later confirm there is a need to fix it, we > will do that in a separate patch anyway. > > Thanks > Nic _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel