From patchwork Wed Mar 27 07:19:58 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lukas Juenger X-Patchwork-Id: 10872821 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 900BC1575 for ; Wed, 27 Mar 2019 07:22:26 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7387228C2A for ; Wed, 27 Mar 2019 07:22:26 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 678C628CF6; Wed, 27 Mar 2019 07:22:26 +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 9FC1028C2A for ; Wed, 27 Mar 2019 07:22:25 +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 1h92r4-0008V8-Sq; Wed, 27 Mar 2019 07:20:10 +0000 Received: from us1-rack-dfw2.inumbo.com ([104.130.134.6]) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1h92r4-0008V3-8X for xen-devel@lists.xenproject.org; Wed, 27 Mar 2019 07:20:10 +0000 X-Inumbo-ID: bec1fb81-5060-11e9-bc90-bc764e045a96 Received: from mail-out-1.itc.rwth-aachen.de (unknown [134.130.5.46]) by us1-rack-dfw2.inumbo.com (Halon) with ESMTPS id bec1fb81-5060-11e9-bc90-bc764e045a96; Wed, 27 Mar 2019 07:20:06 +0000 (UTC) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A2BaAADhIptc/5wagoZkGgEBAQEBAgEBAQEHAgEBAQGBZYIRghIKmS6aaQEsiWoiOBIBAQMBAQkBAwJtKIYDAUaBPg4FgyKBdqt6ijQJAYElAYZphEgXgX+BOAyCMWyEDQZ+hRQDpSEJgSiSFSCLI4hkAZ5aAgICAgkCFYFkIYFWMxoIHBSDJ4IWF44fPzKBByGMTwElgQgBgR4BAQ X-IPAS-Result: A2BaAADhIptc/5wagoZkGgEBAQEBAgEBAQEHAgEBAQGBZYIRghIKmS6aaQEsiWoiOBIBAQMBAQkBAwJtKIYDAUaBPg4FgyKBdqt6ijQJAYElAYZphEgXgX+BOAyCMWyEDQZ+hRQDpSEJgSiSFSCLI4hkAZ5aAgICAgkCFYFkIYFWMxoIHBSDJ4IWF44fPzKBByGMTwElgQgBgR4BAQ X-IronPort-AV: E=Sophos;i="5.60,276,1549926000"; d="scan'208";a="73370513" Received: from rwthex-w1-a.rwth-ad.de ([134.130.26.156]) by mail-in-1.itc.rwth-aachen.de with ESMTP; 27 Mar 2019 08:20:04 +0100 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; Wed, 27 Mar 2019 08:20:04 +0100 From: Lukas Juenger To: Date: Wed, 27 Mar 2019 08:19:58 +0100 X-Mailer: git-send-email 2.21.0 MIME-Version: 1.0 X-Originating-IP: [137.226.91.86] X-ClientProxiedBy: rwthex-s1-b.rwth-ad.de (2a00:8a60:1:e500::26:153) To rwthex-w1-a.rwth-ad.de (2a00:8a60:1:e500::26:156) Message-ID: <50fee047-6463-4524-9449-51555ed59277@rwthex-w1-a.rwth-ad.de> Subject: [Xen-devel] [PATCH] arm/dom0: Add check for maximum number of supported vGIC IRQs 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 Xen's vGIC implementation supports a maximum number of 992 IRQ lines. GICv2 specification allows for 1020 IRQ lines. This commit adds a check for this discrepancy. Signed-off-by: Lukas Juenger (juenger@ice.rwth-aachen.de) --- 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..37b3648a18 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 IRQ 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);