From patchwork Sun Jun 23 12:56:31 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Amit Tomer X-Patchwork-Id: 11011705 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 3F21413AF for ; Sun, 23 Jun 2019 12:58:46 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2768C287C1 for ; Sun, 23 Jun 2019 12:58:46 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1A13228AF5; Sun, 23 Jun 2019 12:58:46 +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 B301E287C1 for ; Sun, 23 Jun 2019 12:58:45 +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 1hf23F-000672-1T; Sun, 23 Jun 2019 12:56:57 +0000 Received: from us1-rack-dfw2.inumbo.com ([104.130.134.6]) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1hf23D-00066x-Pf for xen-devel@lists.xenproject.org; Sun, 23 Jun 2019 12:56:55 +0000 X-Inumbo-ID: 601f9eca-95b6-11e9-8980-bc764e045a96 Received: from mail-pf1-x444.google.com (unknown [2607:f8b0:4864:20::444]) by us1-rack-dfw2.inumbo.com (Halon) with ESMTPS id 601f9eca-95b6-11e9-8980-bc764e045a96; Sun, 23 Jun 2019 12:56:54 +0000 (UTC) Received: by mail-pf1-x444.google.com with SMTP id r7so5961484pfl.3 for ; Sun, 23 Jun 2019 05:56:54 -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=ZCeGcahujoVd3nyx1OqtQFGH4qBrJPCeRTzcnpoiFsk=; b=V/0QkVRKLV6YjT2NtDJ1q6NHWLekYdG4jLtVhBoxc66TeVMhshd+T1q5Tr8KD6HQ/O tkdvYHLTfydhWHy0RN4ruRlHUOQhMMlkSIZcYmYTrYfnGwigVZ7ds6Gydgo/+wk/0wa1 aFJYblPzwODCFAjjs/g6hs02V/bK18Sr4MyIED/88Kc8YK+D8dS/B5OdUCleS8EwDKCR mVgvCcPGfEmWJUPbdyf++R53CSWNycmJcAszzok7/5/PnwMHpHfKHUCDQxKHuaj3jjUv khHLpMLLNfr/OeYV2md+ErNxAPK6+lXgZd5i3ch7pR0bsskrPHu05JacU+UbpTpkOyLm T+Mg== 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=ZCeGcahujoVd3nyx1OqtQFGH4qBrJPCeRTzcnpoiFsk=; b=QNHZbjDAceXgt9glz0YD/GhvXgLJLX/de+OKUOJDrDJw3pTjBDzSKEqE8pI8XXBKZZ fPd2RTfUY3e4NTV+ihNrDGcRODqew5XYUpmYqluof2idNdSJbPYEYDwZ2/4M9mwZt2MF qmn/MY5Xxfk5Ox2/sXZ9FK9h5GagPyBKrYy7t8GopPLhyDXBAuU9Sx0h/i48h5yZnGJj 87WIxyGVS/eyVYlYdXJ2/qM15dZaUEi9/yBFs8YGyGCkXCrbYXMZuzeMIjN8wppcicZG 4P/wxfPTO3xvDFpjF6PQdiF9cAfXarxvkZUF8RlW0nt44n1KSRa+We9w1JppZ6OuTcV0 TBJQ== X-Gm-Message-State: APjAAAWtIL8Sqr9X9RmaH6eYZvfg1dRWV4hTiwAnbuJfGyFYcyVQgE2r rIYHeo+EBM2prMcBInKOAQBlLJjF X-Google-Smtp-Source: APXvYqwafA1QKByFAENVOhPoviKCwhk7XBXXxSENeaFi/pjny8iHwoxW66pt8M6d6Buwvuaw5GMTvw== X-Received: by 2002:a17:90a:2385:: with SMTP id g5mr19078234pje.12.1561294613183; Sun, 23 Jun 2019 05:56:53 -0700 (PDT) Received: from localhost.localdomain ([223.179.152.0]) by smtp.gmail.com with ESMTPSA id k3sm7712338pgo.81.2019.06.23.05.56.48 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sun, 23 Jun 2019 05:56:52 -0700 (PDT) From: Amit Singh Tomar To: xen-devel@lists.xenproject.org Date: Sun, 23 Jun 2019 18:26:31 +0530 Message-Id: <1561294591-14867-1-git-send-email-amittomer25@gmail.com> X-Mailer: git-send-email 2.7.4 Subject: [Xen-devel] [PATCH v3] xen/arm: domain_build: Black list devices using PPIs 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 Currently, the vGIC is not able to cope with hardware PPIs routed to guests. One of the solutions to this problem is to skip any device that uses PPI source completely while building the domain itself. This patch goes through all the interrupt sources of a device and skip it if one of the interrupts sources is a PPI. It fixes XEN boot on i.MX8MQ by skipping the PMU node. Suggested-by: Julien Grall Signed-off-by: Amit Singh Tomar Acked-by: Julien Grall --- Changes since v2: * Update subject-line for the patch. * Fix commit message. * Add proper comments for changes. Changes since v1: * Added comment for PPIs range. --- xen/arch/arm/domain_build.c | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/xen/arch/arm/domain_build.c b/xen/arch/arm/domain_build.c index d983677..53935f8 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; @@ -1400,6 +1400,24 @@ static int __init handle_node(struct domain *d, struct kernel_info *kinfo, } /* + * The vGIC does not support routing hardware PPIs to guest. So + * we need to skip any node using PPIs. + */ + 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 it(using PPIs)\n"); + return 0; + } + } + + /* * Xen is using some path for its own purpose. Warn if a node * already exists with the same path. */