From patchwork Sun Jun 2 18:04:11 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Amit Tomer X-Patchwork-Id: 10972029 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 84E9614DB for ; Sun, 2 Jun 2019 18:06:28 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 67EEA288F8 for ; Sun, 2 Jun 2019 18:06:28 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 42803289E0; Sun, 2 Jun 2019 18:06:28 +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 C85FF288F8 for ; Sun, 2 Jun 2019 18:06:26 +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 1hXUqM-0005pU-Hq; Sun, 02 Jun 2019 18:04:30 +0000 Received: from us1-rack-dfw2.inumbo.com ([104.130.134.6]) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1hXUqL-0005pP-OR for xen-devel@lists.xenproject.org; Sun, 02 Jun 2019 18:04:29 +0000 X-Inumbo-ID: dc6cc871-8560-11e9-8980-bc764e045a96 Received: from mail-pg1-x542.google.com (unknown [2607:f8b0:4864:20::542]) by us1-rack-dfw2.inumbo.com (Halon) with ESMTPS id dc6cc871-8560-11e9-8980-bc764e045a96; Sun, 02 Jun 2019 18:04:27 +0000 (UTC) Received: by mail-pg1-x542.google.com with SMTP id h17so6925709pgv.0 for ; Sun, 02 Jun 2019 11:04:27 -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=/I46+FskpLfnTJYdeg5+UEVFBu8SHGtnpAGw4wkETqU=; b=rGyaENeBQfxEpoYBcuF9Gcn8xTnQVR7I6gp3i6mFe6wfyEEBpyxFLLh3IRxlLA5lMx h8mm+SgEwk3SMNM0hIMe27iJ2x92JfIknXDssDBK61RgERahdSdsOmDg4YUoNel2ZuiA 3++wZoIfbkAMO/8sZiPHq6vJfQeu650jF6kUtCae6VUX+uHc8skFxOSlLV4CQXIuy+lv wyk5Sky/MGqwOMVMhz+mPMXcTIuk1PNZbjsscauTbB3lcz1l2bbQ0Q7tTOsKhUPMJKS9 XdBd7qCoD97T3B/zp8Bjhm8lGwGbR8pYgQ+/G1AvmGIbqWNirJ3UF4nZsbPszNv72odj yC3A== 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=/I46+FskpLfnTJYdeg5+UEVFBu8SHGtnpAGw4wkETqU=; b=rFsSjKJINZhf11ysZqMryurFmzj30X3oanUfpiZDiEV0iMnV1KGkU6a9SLlNIZ0vP1 182iX1bvxFEwgTNHhiTyUNf6WB+v5nd/brTRH68xayjpJROkl+pWRJSEfb2MRzGWIJF1 ur48s4gmmp3s/QNIN1gbHyWHiOSMPXG5J3IFR3EeM47twKt69W2Lg7+5sjt3gdn/RQCF lCd7eDE3RAmIrhvDUVx3pJfwV1G1YAQTV3foE2PQZUGUC9UNlnMChW3HS7sEUYMZFHOo IzezLCQg8udof/IHhYmcrt6IqF6GkWtV2I1eYEEd6tuzwzuGv7Vu2KdYuPVlom+cKf2I Lagw== X-Gm-Message-State: APjAAAVLLNd7qy2l14GEvIzsRtQ41D7ZsmxsfJrXCPxcIAMaqHfqQKw1 iTrurebqjG7zIGhpOvns/mAfcR/6 X-Google-Smtp-Source: APXvYqz1O2IfYtdKbBRc0dvDRhxL4DXpHz+J8odVOQuU+QxYmwsVlQ8zcKBHoFfrHNb57UawBLQ/KA== X-Received: by 2002:a63:f54c:: with SMTP id e12mr23643695pgk.62.1559498666274; Sun, 02 Jun 2019 11:04:26 -0700 (PDT) Received: from localhost.localdomain ([223.190.23.120]) by smtp.gmail.com with ESMTPSA id v9sm11732122pfm.34.2019.06.02.11.04.23 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sun, 02 Jun 2019 11:04:25 -0700 (PDT) From: Amit Singh Tomar To: xen-devel@lists.xenproject.org Date: Sun, 2 Jun 2019 23:34:11 +0530 Message-Id: <1559498651-25602-1-git-send-email-amittomer25@gmail.com> X-Mailer: git-send-email 2.7.4 Subject: [Xen-devel] [PATCH v2] xen/arm: Black list everything with a PPI 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: andre.przywara@arm.com, julien.grall@arm.com, sstabellini@kernel.org, Amit Singh Tomar MIME-Version: 1.0 Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" X-Virus-Scanned: ClamAV using ClamSMTP XEN should not forward PPIs to Dom0 as it only support SPIs. One of solution to this problem is to skip any device that uses PPI source completely while building domain itself. This patch goes through all the interrupt sources of device and skip it if one of interrupt source is PPI. It fixes XEN boot on i.MX8MQ by skipping PMU node. Suggested-by: Julien Grall Signed-off-by: Amit Singh Tomar --- Changes since v1: * Added comment for PPIs range. --- xen/arch/arm/domain_build.c | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/xen/arch/arm/domain_build.c b/xen/arch/arm/domain_build.c index d983677..5035758 100644 --- a/xen/arch/arm/domain_build.c +++ b/xen/arch/arm/domain_build.c @@ -1353,7 +1353,7 @@ static int __init handle_node(struct domain *d, struct kernel_info *kinfo, { /* sentinel */ }, }; struct dt_device_node *child; - int res; + int res, i, nirq, irq_id; const char *name; const char *path; @@ -1399,6 +1399,21 @@ static int __init handle_node(struct domain *d, struct kernel_info *kinfo, return 0; } + /* Skip the node, using PPI source */ + nirq = dt_number_of_irq(node); + + for ( i = 0 ; i < nirq ; i++ ) + { + irq_id = platform_get_irq(node, i); + + /* PPIs ranges from ID 16 to 31 */ + if ( irq_id >= 16 && irq_id < 32 ) + { + dt_dprintk(" Skip node with (PPI source)\n"); + return 0; + } + } + /* * Xen is using some path for its own purpose. Warn if a node * already exists with the same path.