From nobody Wed May 15 14:56:27 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1643313412; cv=none; d=zohomail.com; s=zohoarc; b=hD2XC5OyJfwwzFAy9OVSIAHi3J6yveGv8EMtQEeINP+j4U2U3j4Xc6Iuq6i7GCr6umrWGjA4fHscKwZVKeheP0om/+cRGxkrJDIv+w42MV/Ag04/W3DJOeArNe45o/8fDFL0Dsw0zwdE33Pmj9+LlhahZu2YXGcj8nkGZ1lzyoE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1643313412; h=Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:Message-ID:References:Sender:Subject:To; bh=eo+OIjpWTXwwmP6Pj09KcPNoGuASdj6ZBH9bhBu2VCw=; b=iqu9Ht0utIiRkBR1gEaXAFaUJeNdFYqA4f9SJaxWCyQMZHJeWe0E/VSgVVIH+RR3yTZqHR1bCJQFi5OQ+FBg4QAyIjCqO52oSx8x7pmyfioU1KGl7CRpL99qDLSr0+rkKSXbhuYVYdfz4ZOCiMzsbrqwSJi5QV6SC9bLdGCzYe4= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 164331341211517.941582688358153; Thu, 27 Jan 2022 11:56:52 -0800 (PST) Received: from list by lists.xenproject.org with outflank-mailman.261720.453390 (Exim 4.92) (envelope-from ) id 1nDAsg-00026G-S3; Thu, 27 Jan 2022 19:56:30 +0000 Received: by outflank-mailman (output) from mailman id 261720.453390; Thu, 27 Jan 2022 19:56:30 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1nDAsg-000269-PB; Thu, 27 Jan 2022 19:56:30 +0000 Received: by outflank-mailman (input) for mailman id 261720; Thu, 27 Jan 2022 19:56:29 +0000 Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50] helo=se1-gles-flk1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1nDAsf-0001qT-84 for xen-devel@lists.xenproject.org; Thu, 27 Jan 2022 19:56:29 +0000 Received: from mail-lj1-x22b.google.com (mail-lj1-x22b.google.com [2a00:1450:4864:20::22b]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id 36c40072-7fab-11ec-8f75-fffcc8bd4f1a; Thu, 27 Jan 2022 20:56:27 +0100 (CET) Received: by mail-lj1-x22b.google.com with SMTP id c7so5392215ljr.13 for ; Thu, 27 Jan 2022 11:56:28 -0800 (PST) Received: from otyshchenko.router ([212.22.223.21]) by smtp.gmail.com with ESMTPSA id j18sm897631lja.26.2022.01.27.11.56.26 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 27 Jan 2022 11:56:27 -0800 (PST) X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 36c40072-7fab-11ec-8f75-fffcc8bd4f1a DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=eo+OIjpWTXwwmP6Pj09KcPNoGuASdj6ZBH9bhBu2VCw=; b=iDUfuS+F3RXhOl1S+NtxvwmywXVfdpg/1suc17SJauTt31SRjVBqOSPkY8HPRZ3yht V5rDuJcBddF2xl3DbceoNuYAQUUSF5qiU0E52+J/aACS257yTq1T6Nn+iPxdZdaE9kDL hf2T1BPiO/T3Sa86kIZztllTb4j+uouEzdxgh0tu6ZzNjiEgvtVjlw7zn91CzZZFcjz7 Sc3dQrctP6ihBiQKEFE7e8XdNr9NhI0fceClfyLTbSsdSxuC0UT5saRMxGnNvELm1Jad QjtHBIJJlYfR5e8F03PVzrDbj4OQvKjuaXZsyB+YTvqlJ8GtE0X8NwZyY5ixxO3wH5XY E68g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=eo+OIjpWTXwwmP6Pj09KcPNoGuASdj6ZBH9bhBu2VCw=; b=LTtVdKlzLSCs+4OXazw/x2pcIVG3MmA420q+U6x3tvugG2ngkekTTnD4kwigxvaFxA 6kVGCJb5FlUEJnuRYcp8HHnxxtB9WCckOj3G/e3fsDV+uZti8WjHLg8YSZGC19jYy5eI LK2/nYBeAK+O1K1SECCDDlrkQd3L+M3CnW6pB7OaPQzlJUZHMqnHXh4/+OPmgxtADkwl UsrTobqukwEiN9lAO4ujOXwNgP2T9JBpAye7sOc7M4hEIEBhM6gm/vC7VpU+/eYTNpN7 DSjycmtkPiZJba6CKTv+eWpR5AzutOXaP3mj2D7WnYPvmGAvyK9tZjPT3pktMbDzVIdX 1HXw== X-Gm-Message-State: AOAM532KGCYVmToaa67mwl3PT/bK82mP+yh9oqbeqyz/4rBuWNKRBKnP lxhT7eqixU7o7bLS2r0K2WA1ARnN9Vk= X-Google-Smtp-Source: ABdhPJyd1lR2ZBeKpiYRAK/LysWfxNy0vopwBbbkjjazDv5ZCPLS4hfEdTurAUDwwUCv2rBBBlQH1Q== X-Received: by 2002:a2e:a786:: with SMTP id c6mr3545836ljf.385.1643313387620; Thu, 27 Jan 2022 11:56:27 -0800 (PST) From: Oleksandr Tyshchenko To: xen-devel@lists.xenproject.org Cc: Oleksandr Tyshchenko , Stefano Stabellini , Julien Grall , Volodymyr Babchuk , Bertrand Marquis , Yoshihiro Shimoda , Oleksandr Andrushchenko Subject: [PATCH V3 1/2] iommu/ipmmu-vmsa: Use refcount for the micro-TLBs Date: Thu, 27 Jan 2022 21:55:51 +0200 Message-Id: <1643313352-29940-2-git-send-email-olekstysh@gmail.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1643313352-29940-1-git-send-email-olekstysh@gmail.com> References: <1643313352-29940-1-git-send-email-olekstysh@gmail.com> X-ZohoMail-DKIM: pass (identity @gmail.com) X-ZM-MESSAGEID: 1643313413411100001 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Oleksandr Tyshchenko Reference-count the micro-TLBs as several bus masters can be connected to the same micro-TLB (and drop TODO comment). This wasn't an issue so far, since the platform devices (this driver deals with) get assigned/deassigned together during domain creation/destruction. But, in order to support PCI devices (which are hot-pluggable) in the near future we will need to take care of. Signed-off-by: Oleksandr Tyshchenko Reviewed-by: Yoshihiro Shimoda --- Changes V1 -> V2: - add R-b - add ASSERT() in ipmmu_utlb_disable() Changes V2 -> V3: - add comment to the code --- xen/drivers/passthrough/arm/ipmmu-vmsa.c | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/xen/drivers/passthrough/arm/ipmmu-vmsa.c b/xen/drivers/passthr= ough/arm/ipmmu-vmsa.c index 649b9f6..c912120 100644 --- a/xen/drivers/passthrough/arm/ipmmu-vmsa.c +++ b/xen/drivers/passthrough/arm/ipmmu-vmsa.c @@ -127,6 +127,7 @@ struct ipmmu_vmsa_device { spinlock_t lock; /* Protects ctx and domains[] */ DECLARE_BITMAP(ctx, IPMMU_CTX_MAX); struct ipmmu_vmsa_domain *domains[IPMMU_CTX_MAX]; + unsigned int utlb_refcount[IPMMU_UTLB_MAX]; const struct ipmmu_features *features; }; =20 @@ -468,12 +469,17 @@ static int ipmmu_utlb_enable(struct ipmmu_vmsa_domain= *domain, } =20 /* - * TODO: Reference-count the micro-TLB as several bus masters can be - * connected to the same micro-TLB. + * Reference-count the micro-TLBs as several bus masters can be connec= ted + * to the same micro-TLB. The platform devices get assigned/deassigned + * together during domain creation/destruction. The PCI devices which = use + * the same micro-TLB must also be hot-(un)plugged together. */ - ipmmu_imuasid_write(mmu, utlb, 0); - ipmmu_imuctr_write(mmu, utlb, imuctr | - IMUCTR_TTSEL_MMU(domain->context_id) | IMUCTR_MMUEN= ); + if ( mmu->utlb_refcount[utlb]++ =3D=3D 0 ) + { + ipmmu_imuasid_write(mmu, utlb, 0); + ipmmu_imuctr_write(mmu, utlb, imuctr | + IMUCTR_TTSEL_MMU(domain->context_id) | IMUCTR_M= MUEN); + } =20 return 0; } @@ -484,7 +490,10 @@ static void ipmmu_utlb_disable(struct ipmmu_vmsa_domai= n *domain, { struct ipmmu_vmsa_device *mmu =3D domain->mmu; =20 - ipmmu_imuctr_write(mmu, utlb, 0); + ASSERT(mmu->utlb_refcount[utlb] > 0); + + if ( --mmu->utlb_refcount[utlb] =3D=3D 0 ) + ipmmu_imuctr_write(mmu, utlb, 0); } =20 /* Domain/Context Management */ --=20 2.7.4 From nobody Wed May 15 14:56:27 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1643313412; cv=none; d=zohomail.com; s=zohoarc; b=Z0BUL/kI3Ttj07vICciUsf+17Oyc2P624ilEL9rCMIcvFN/KTdJj3jGNyjUDA7SfOnzNObwEtkraB8fGP43BghHthTwjMXBZ+KXonepunvjulYH2KHCV1zlHwEMLpMLZoFmpIkWRuyYk3mTcL7tXOKCuu3mNieM+41tBSnwlnFU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1643313412; h=Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:Message-ID:References:Sender:Subject:To; bh=9x3Unk7KT3XMe8edi/04ny0Op6Yqm01LPkdhOdEqFH8=; b=fc4yOAaPz0r5cPh2j3TLlRxkAFtMyhyXEj0fBiwH7gB05PVrk9zXrVJup85f8HJqEjPtte0qqrViETFrCHbsSDpjTOcZ/n7goCtmFPAu/FOzDJlPHdsWazYiddptEBD2bYcsYUejonT9YPcfXatxxjhxGvEfp5BkU8hroJHpJuw= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1643313412353677.7261143850362; Thu, 27 Jan 2022 11:56:52 -0800 (PST) Received: from list by lists.xenproject.org with outflank-mailman.261721.453401 (Exim 4.92) (envelope-from ) id 1nDAsi-0002M5-57; Thu, 27 Jan 2022 19:56:32 +0000 Received: by outflank-mailman (output) from mailman id 261721.453401; Thu, 27 Jan 2022 19:56:32 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1nDAsi-0002Lu-1d; Thu, 27 Jan 2022 19:56:32 +0000 Received: by outflank-mailman (input) for mailman id 261721; Thu, 27 Jan 2022 19:56:30 +0000 Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254] helo=se1-gles-sth1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1nDAsf-0001qN-Tx for xen-devel@lists.xenproject.org; Thu, 27 Jan 2022 19:56:30 +0000 Received: from mail-lf1-x133.google.com (mail-lf1-x133.google.com [2a00:1450:4864:20::133]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id 379aabe7-7fab-11ec-8eb8-a37418f5ba1a; Thu, 27 Jan 2022 20:56:29 +0100 (CET) Received: by mail-lf1-x133.google.com with SMTP id u6so7420582lfm.10 for ; Thu, 27 Jan 2022 11:56:29 -0800 (PST) Received: from otyshchenko.router ([212.22.223.21]) by smtp.gmail.com with ESMTPSA id j18sm897631lja.26.2022.01.27.11.56.27 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 27 Jan 2022 11:56:28 -0800 (PST) X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 379aabe7-7fab-11ec-8eb8-a37418f5ba1a DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=9x3Unk7KT3XMe8edi/04ny0Op6Yqm01LPkdhOdEqFH8=; b=nItGuj/k8uxRgN8VTCw9s0qR1Fbpu7B1F7RuxhrBsjHIryfVgsBTWu9hCspadqILtT 3N+ijPeqKmSLiZqJVIMVOPU2Ut9cgG8fQZ9PG5ZW7bUkHtc6P86L1IJOKEPOMdxBzdbH R9VxIEFSdFnuhzEoYw8A49N1qOwYp7hYEj+vGwXMNEOW1S3qxfQ+gQj5GNVECYGhWYfb E7koa63MAAG3EOs5moEoV8afkX1IQTpReZQSyhuX8gWfPI2LnwrGXnikvceUUFRZnliI IL+F06aCyzk19Ko0PkvEEZZYL2xsAsGDf5eZf5W54hnhQZtHSxz+2c0Szr4GY0iS1f/5 Eh/g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=9x3Unk7KT3XMe8edi/04ny0Op6Yqm01LPkdhOdEqFH8=; b=WXre7v3PHXCGSh15G9QtjdZoKjoUAzXd93lherOmPZQWN2U3ixVkdyfYnxwefryKsE 95c+ycePP+5xSx0waH8R+PpW2KnOkWySnOiq1h/DsPbdHwQdjYtT1lSjpDkv/OlFIJlJ ivuFE7jJupPreZVI4uU5h0yHnj9H/sNIqN3OdApNFY+p1FMw3xXNot7TMxGhpAgyUbjB BEZWcl1diShWmwwBIP2jOS4vC+SuNJUw2YDaYX9Q7flaxQBw5YlHrkWSsQCESfGt+Eym bYn/rV/qtDI4TGHv4H+pqhRsN404/DL8wdTWHj+aospZTSx6QpWc1tWgKi1cIAl838mt YYjQ== X-Gm-Message-State: AOAM532dshYAbIVJeB6nn9U0DgNN0wiDDUJe63mB0jL044to9mcrCVXJ 1vO8BCLjqmmeTHeVHBtb8fwFpDw1SKw= X-Google-Smtp-Source: ABdhPJwvCtFrFAerya6ye4MW9mbvSwPBeHBGZp6QwFtTmX3fBdWqDyVFbVqQNr6c+go6DbE3Ik1ffA== X-Received: by 2002:a19:4f4a:: with SMTP id a10mr3726025lfk.397.1643313388555; Thu, 27 Jan 2022 11:56:28 -0800 (PST) From: Oleksandr Tyshchenko To: xen-devel@lists.xenproject.org Cc: Oleksandr Tyshchenko , Stefano Stabellini , Julien Grall , Volodymyr Babchuk , Bertrand Marquis , Rahul Singh , Yoshihiro Shimoda , Oleksandr Andrushchenko Subject: [PATCH V3 2/2] iommu/arm: Remove code duplication in all IOMMU drivers Date: Thu, 27 Jan 2022 21:55:52 +0200 Message-Id: <1643313352-29940-3-git-send-email-olekstysh@gmail.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1643313352-29940-1-git-send-email-olekstysh@gmail.com> References: <1643313352-29940-1-git-send-email-olekstysh@gmail.com> X-ZohoMail-DKIM: pass (identity @gmail.com) X-ZM-MESSAGEID: 1643313413793100004 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Oleksandr Tyshchenko All IOMMU drivers on Arm perform almost the same generic actions in hwdom_init callback. Move this code to common arch_iommu_hwdom_init() in order to get rid of code duplication. Signed-off-by: Oleksandr Tyshchenko Reviewed-by: Volodymyr Babchuk Reviewed-by: Yoshihiro Shimoda Acked-by:: Rahul Singh --- Changes V1 -> V2: - add R-b Changes V2 -> V3: - drop platform specific *_iommu_hwdom_init(), make .hwdom_init to directly point to the common arch_iommu_hwdom_init() --- xen/drivers/passthrough/arm/iommu.c | 7 +++++++ xen/drivers/passthrough/arm/ipmmu-vmsa.c | 15 +-------------- xen/drivers/passthrough/arm/smmu-v3.c | 17 +---------------- xen/drivers/passthrough/arm/smmu.c | 17 +---------------- 4 files changed, 10 insertions(+), 46 deletions(-) diff --git a/xen/drivers/passthrough/arm/iommu.c b/xen/drivers/passthrough/= arm/iommu.c index ee653a9..fc45318 100644 --- a/xen/drivers/passthrough/arm/iommu.c +++ b/xen/drivers/passthrough/arm/iommu.c @@ -134,6 +134,13 @@ void arch_iommu_domain_destroy(struct domain *d) =20 void __hwdom_init arch_iommu_hwdom_init(struct domain *d) { + /* Set to false options not supported on ARM. */ + if ( iommu_hwdom_inclusive ) + printk(XENLOG_WARNING "map-inclusive dom0-iommu option is not supp= orted on ARM\n"); + iommu_hwdom_inclusive =3D false; + if ( iommu_hwdom_reserved =3D=3D 1 ) + printk(XENLOG_WARNING "map-reserved dom0-iommu option is not suppo= rted on ARM\n"); + iommu_hwdom_reserved =3D 0; } =20 /* diff --git a/xen/drivers/passthrough/arm/ipmmu-vmsa.c b/xen/drivers/passthr= ough/arm/ipmmu-vmsa.c index c912120..d2572bc 100644 --- a/xen/drivers/passthrough/arm/ipmmu-vmsa.c +++ b/xen/drivers/passthrough/arm/ipmmu-vmsa.c @@ -1329,19 +1329,6 @@ static int ipmmu_iommu_domain_init(struct domain *d) return 0; } =20 -static void __hwdom_init ipmmu_iommu_hwdom_init(struct domain *d) -{ - /* Set to false options not supported on ARM. */ - if ( iommu_hwdom_inclusive ) - printk(XENLOG_WARNING "ipmmu: map-inclusive dom0-iommu option is n= ot supported on ARM\n"); - iommu_hwdom_inclusive =3D false; - if ( iommu_hwdom_reserved =3D=3D 1 ) - printk(XENLOG_WARNING "ipmmu: map-reserved dom0-iommu option is no= t supported on ARM\n"); - iommu_hwdom_reserved =3D 0; - - arch_iommu_hwdom_init(d); -} - static void ipmmu_iommu_domain_teardown(struct domain *d) { struct ipmmu_vmsa_xen_domain *xen_domain =3D dom_iommu(d)->arch.priv; @@ -1369,7 +1356,7 @@ static void ipmmu_iommu_domain_teardown(struct domain= *d) static const struct iommu_ops ipmmu_iommu_ops =3D { .init =3D ipmmu_iommu_domain_init, - .hwdom_init =3D ipmmu_iommu_hwdom_init, + .hwdom_init =3D arch_iommu_hwdom_init, .teardown =3D ipmmu_iommu_domain_teardown, .iotlb_flush =3D ipmmu_iotlb_flush, .iotlb_flush_all =3D ipmmu_iotlb_flush_all, diff --git a/xen/drivers/passthrough/arm/smmu-v3.c b/xen/drivers/passthroug= h/arm/smmu-v3.c index d115df7..71b022f 100644 --- a/xen/drivers/passthrough/arm/smmu-v3.c +++ b/xen/drivers/passthrough/arm/smmu-v3.c @@ -3402,21 +3402,6 @@ static int arm_smmu_iommu_xen_domain_init(struct dom= ain *d) =20 } =20 -static void __hwdom_init arm_smmu_iommu_hwdom_init(struct domain *d) -{ - /* Set to false options not supported on ARM. */ - if (iommu_hwdom_inclusive) - printk(XENLOG_WARNING - "map-inclusive dom0-iommu option is not supported on ARM\n"); - iommu_hwdom_inclusive =3D false; - if (iommu_hwdom_reserved =3D=3D 1) - printk(XENLOG_WARNING - "map-reserved dom0-iommu option is not supported on ARM\n"); - iommu_hwdom_reserved =3D 0; - - arch_iommu_hwdom_init(d); -} - static void arm_smmu_iommu_xen_domain_teardown(struct domain *d) { struct arm_smmu_xen_domain *xen_domain =3D dom_iommu(d)->arch.priv; @@ -3427,7 +3412,7 @@ static void arm_smmu_iommu_xen_domain_teardown(struct= domain *d) =20 static const struct iommu_ops arm_smmu_iommu_ops =3D { .init =3D arm_smmu_iommu_xen_domain_init, - .hwdom_init =3D arm_smmu_iommu_hwdom_init, + .hwdom_init =3D arch_iommu_hwdom_init, .teardown =3D arm_smmu_iommu_xen_domain_teardown, .iotlb_flush =3D arm_smmu_iotlb_flush, .iotlb_flush_all =3D arm_smmu_iotlb_flush_all, diff --git a/xen/drivers/passthrough/arm/smmu.c b/xen/drivers/passthrough/a= rm/smmu.c index c9dfc4c..b186c28 100644 --- a/xen/drivers/passthrough/arm/smmu.c +++ b/xen/drivers/passthrough/arm/smmu.c @@ -2849,21 +2849,6 @@ static int arm_smmu_iommu_domain_init(struct domain = *d) return 0; } =20 -static void __hwdom_init arm_smmu_iommu_hwdom_init(struct domain *d) -{ - /* Set to false options not supported on ARM. */ - if ( iommu_hwdom_inclusive ) - printk(XENLOG_WARNING - "map-inclusive dom0-iommu option is not supported on ARM\n"); - iommu_hwdom_inclusive =3D false; - if ( iommu_hwdom_reserved =3D=3D 1 ) - printk(XENLOG_WARNING - "map-reserved dom0-iommu option is not supported on ARM\n"); - iommu_hwdom_reserved =3D 0; - - arch_iommu_hwdom_init(d); -} - static void arm_smmu_iommu_domain_teardown(struct domain *d) { struct arm_smmu_xen_domain *xen_domain =3D dom_iommu(d)->arch.priv; @@ -2874,7 +2859,7 @@ static void arm_smmu_iommu_domain_teardown(struct dom= ain *d) =20 static const struct iommu_ops arm_smmu_iommu_ops =3D { .init =3D arm_smmu_iommu_domain_init, - .hwdom_init =3D arm_smmu_iommu_hwdom_init, + .hwdom_init =3D arch_iommu_hwdom_init, .add_device =3D arm_smmu_dt_add_device_generic, .teardown =3D arm_smmu_iommu_domain_teardown, .iotlb_flush =3D arm_smmu_iotlb_flush, --=20 2.7.4