From patchwork Fri Apr 5 13:54:04 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lukas Juenger X-Patchwork-Id: 10887437 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 9F3DC17E9 for ; Fri, 5 Apr 2019 13:56:48 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8AB8B28A5C for ; Fri, 5 Apr 2019 13:56:48 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7EEC328B5A; Fri, 5 Apr 2019 13:56:48 +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.2 required=2.0 tests=BAYES_00,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 15BA228A5C for ; Fri, 5 Apr 2019 13:56:47 +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 1hCPIX-0004E5-Ie; Fri, 05 Apr 2019 13:54:25 +0000 Received: from us1-rack-dfw2.inumbo.com ([104.130.134.6]) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1hCPIV-0004Ds-GO for xen-devel@lists.xenproject.org; Fri, 05 Apr 2019 13:54:23 +0000 X-Inumbo-ID: 4ef67cab-57aa-11e9-92d7-bc764e045a96 Received: from mail-out-2.itc.rwth-aachen.de (unknown [134.130.5.47]) by us1-rack-dfw2.inumbo.com (Halon) with ESMTPS id 4ef67cab-57aa-11e9-92d7-bc764e045a96; Fri, 05 Apr 2019 13:54:20 +0000 (UTC) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A2D1AABQXadc/5wagoZlGwEBAQEDAQEBBwMBAQGBZYIRghIKtBsBLIoVIjgSAQEDAQEJAQMCbSiGAwFGgT4OBYMigXaxI4ozCQGBJoZyhFUXgX+BOII9bIQNBgtzhRQDpXUJgSmSUiCLTokHn0oCAgICCQIVgWYhgVYzGggcFIMnghYXjiE+MoEHIYx3ASWBCAGBHwEB X-IPAS-Result: A2D1AABQXadc/5wagoZlGwEBAQEDAQEBBwMBAQGBZYIRghIKtBsBLIoVIjgSAQEDAQEJAQMCbSiGAwFGgT4OBYMigXaxI4ozCQGBJoZyhFUXgX+BOII9bIQNBgtzhRQDpXUJgSmSUiCLTokHn0oCAgICCQIVgWYhgVYzGggcFIMnghYXjiE+MoEHIYx3ASWBCAGBHwEB X-IronPort-AV: E=Sophos;i="5.60,312,1549926000"; d="scan'208";a="74445000" Received: from rwthex-w1-a.rwth-ad.de ([134.130.26.156]) by mail-in-2.itc.rwth-aachen.de with ESMTP; 05 Apr 2019 15:54:18 +0200 Received: from scuti.iss.rwth-aachen.de (137.226.91.86) by rwthex-w1-a.rwth-ad.de (2a00:8a60:1:e500::26:156) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1713.5; Fri, 5 Apr 2019 15:54:16 +0200 From: Lukas Juenger To: Date: Fri, 5 Apr 2019 15:54:04 +0200 X-Mailer: git-send-email 2.21.0 MIME-Version: 1.0 X-Originating-IP: [137.226.91.86] X-ClientProxiedBy: rwthex-s2-a.rwth-ad.de (2a00:8a60:1:e500::26:154) To rwthex-w1-a.rwth-ad.de (2a00:8a60:1:e500::26:156) Message-ID: Subject: [Xen-devel] [PATCH v2] xen/arm: Cap the number of interrupt lines for dom0 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: Julien Grall , Stefano Stabellini , Lukas Juenger Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" X-Virus-Scanned: ClamAV using ClamSMTP Dom0 vGIC will use the same number of interrupt lines as the hardware GIC. While the hardware GIC can support up to 1020 interrupt lines, the vGIC is only supporting up to 992 interrupt lines. This means that Xen will not be able to boot on platforms where the hardware GIC supports more than 992 interrupt lines. While it would make sense to increase the limits in the vGICs, this is not trivial because of the design choices. At the moment, only models seem to report the maximum of interrupt lines. They also do not have any interrupt wired above the 992 limit. So it should be fine to cap the number of interrupt lines for dom0 to 992 lines. Signed-off-by: Lukas Juenger Acked-by: Julien Grall --- Changed since v1: - Adapted commit message as suggested - Changed code comment to reflect correct terminology --- xen/arch/arm/setup.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/xen/arch/arm/setup.c b/xen/arch/arm/setup.c index 444857a967..ccb0f181ea 100644 --- a/xen/arch/arm/setup.c +++ b/xen/arch/arm/setup.c @@ -888,7 +888,13 @@ void __init start_xen(unsigned long boot_phys_offset, /* Create initial domain 0. */ /* The vGIC for DOM0 is exactly emulating the hardware GIC */ dom0_cfg.arch.gic_version = XEN_DOMCTL_CONFIG_GIC_NATIVE; - dom0_cfg.arch.nr_spis = gic_number_lines() - 32; + /* + * Xen vGIC supports a maximum of 992 interrupt lines. + * 32 are substracted to cover local IRQs. + */ + dom0_cfg.arch.nr_spis = min(gic_number_lines(), (unsigned int) 992) - 32; + if ( gic_number_lines() > 992 ) + printk(XENLOG_WARNING "Maximum number of vGIC IRQs exceeded.\n"); dom0_cfg.max_vcpus = dom0_max_vcpus(); dom0 = domain_create(0, &dom0_cfg, true);