From patchwork Thu Aug 8 10:53:23 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Oleksandr Tyshchenko X-Patchwork-Id: 11084021 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 0BA381709 for ; Thu, 8 Aug 2019 10:55:20 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E882B28AAE for ; Thu, 8 Aug 2019 10:55:19 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D538C28AC8; Thu, 8 Aug 2019 10:55:19 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.0 required=2.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_INVALID,DKIM_SIGNED,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 76A4028AAE for ; Thu, 8 Aug 2019 10:55:19 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1hvg35-0004kU-Go; Thu, 08 Aug 2019 10:53:35 +0000 Received: from us1-rack-dfw2.inumbo.com ([104.130.134.6]) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1hvg34-0004kP-7q for xen-devel@lists.xenproject.org; Thu, 08 Aug 2019 10:53:34 +0000 X-Inumbo-ID: c33b47e5-b9ca-11e9-8980-bc764e045a96 Received: from mail-lf1-x144.google.com (unknown [2a00:1450:4864:20::144]) by us1-rack-dfw2.inumbo.com (Halon) with ESMTPS id c33b47e5-b9ca-11e9-8980-bc764e045a96; Thu, 08 Aug 2019 10:53:33 +0000 (UTC) Received: by mail-lf1-x144.google.com with SMTP id b17so66497315lff.7 for ; Thu, 08 Aug 2019 03:53:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=uvOnSc3Xt5y6r2YY3KMXL1DgVa0dZrUp/NOg5YZRDIY=; b=BeJ8eS7HF26NWaXJMuNJI0ltnipA5/9wAf1NOyMAmqwF/wevnNkIe5kxX8hg3wO+4O gutVjQ6T62axg1eAcEs4bBm9Yu3XYD1gTMywoLGbsTcPSDbWs+p2Xq6dFumFiZvNYGls OLkL3x2kCyiO6kvr+jG1Km4XXbudCh3pPxH9GkzRlaDY2YGPSB75zbUvj2LTJdeXmG0A /tOiPvJASzs6sI7DZ9MZ6uIbWcL97SQZv+8AOpdyOw8gmzDt0qc7uo3tPecvsu29Kfi0 yFzTlirq/dImGNk1E1a9JEpInbiKM847a0n0TDrpi/23sxookHXywPFleBnW+Cs2ny/K 5jkg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=uvOnSc3Xt5y6r2YY3KMXL1DgVa0dZrUp/NOg5YZRDIY=; b=cegtXkCRtYfidXNP6usEVBQp+WntF4pREKXkCN57pAAiHlmLxJfOe9b6ybhnuD+Wp9 Y0+uQ8WYs7k0wwrm8+bPX3fm2oRiW2x8ZA/+KtQWexrszYEWL2dXNWUZw5vMhiwtwU1A BCMqbIDT063kAK0dtKUOhgN0MuAqPRrm78WPkHx/6x/qEhWjTOLl1h5jE+Nsea88rP82 lkIetLxWAE/ezaemhmURquDoCjAEGLjLdpQB7hxTyQylhpY3iQo61AK5ec7ytA133lt3 zDdqLhRjaCqVOJALhKpAILshj9KmjkdCs4WPWHJCFqswjecqNeU2BV5DFe2shBR4T3w+ 2A/Q== X-Gm-Message-State: APjAAAURsp09jPbyAc9E7G1fysVxWyrsDBPOZI1j96jMC/ZvwXqYNIn+ JpPAr3CFk9b/64Guw+awmYBM0fayOC4= X-Google-Smtp-Source: APXvYqwfx7Ky9kleMP+qFT4llxMthzmKBM3pt9K0658ye/SDfidOpgJ0NK/Z5VttCzVHPpFFLY2wiw== X-Received: by 2002:ac2:44ac:: with SMTP id c12mr205631lfm.33.1565261611568; Thu, 08 Aug 2019 03:53:31 -0700 (PDT) Received: from otyshchenko.kyiv.epam.com (ll-22.209.223.85.sovam.net.ua. [85.223.209.22]) by smtp.gmail.com with ESMTPSA id k27sm18476194lfm.90.2019.08.08.03.53.30 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 08 Aug 2019 03:53:31 -0700 (PDT) From: Oleksandr Tyshchenko To: xen-devel@lists.xenproject.org Date: Thu, 8 Aug 2019 13:53:23 +0300 Message-Id: <1565261603-9632-1-git-send-email-olekstysh@gmail.com> X-Mailer: git-send-email 2.7.4 Subject: [Xen-devel] [PATCH] xen/arm: Let the IOMMU be accessible by Dom0 if forcibly disabled in Xen X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: Oleksandr Tyshchenko , julien.grall@arm.com, sstabellini@kernel.org MIME-Version: 1.0 Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" X-Virus-Scanned: ClamAV using ClamSMTP From: Oleksandr Tyshchenko Don't skip IOMMU nodes when creating DT for Dom0 if IOMMU has been forcibly disabled in bootargs (e.g. "iommu=0") in order to let the IOMMU be accessible by DOM0. Signed-off-by: Oleksandr Tyshchenko --- I have heard there is a "possible" case when the IOMMU could be accessible by DOM0. So, I think, for this to work we need to create corresponding DT nodes in the DT at least. --- xen/arch/arm/domain_build.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/xen/arch/arm/domain_build.c b/xen/arch/arm/domain_build.c index d67f7d4..ff88099 100644 --- a/xen/arch/arm/domain_build.c +++ b/xen/arch/arm/domain_build.c @@ -1403,9 +1403,11 @@ static int __init handle_node(struct domain *d, struct kernel_info *kinfo, /* * Even if the IOMMU device is not used by Xen, it should not be - * passthrough to DOM0 + * passthrough to DOM0. The exception here is the fact that IOMMU + * has been forcibly disabled in bootargs "iommu=0" in order to let + * the IOMMU be accessible by DOM0. */ - if ( device_get_class(node) == DEVICE_IOMMU ) + if ( device_get_class(node) == DEVICE_IOMMU && iommu_enable ) { dt_dprintk(" IOMMU, skip it\n"); return 0;