From patchwork Wed Apr 20 13:15:01 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefano Stabellini X-Patchwork-Id: 8889791 Return-Path: X-Original-To: patchwork-xen-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id BB6DFBF29F for ; Wed, 20 Apr 2016 13:17:46 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id D3993201FE for ; Wed, 20 Apr 2016 13:17:45 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id EEF6D20149 for ; Wed, 20 Apr 2016 13:17:43 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1asryO-0001Fv-8t; Wed, 20 Apr 2016 13:15:16 +0000 Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1asryM-0001Fo-Ka for xen-devel@lists.xenproject.org; Wed, 20 Apr 2016 13:15:14 +0000 Received: from [85.158.137.68] by server-9.bemta-3.messagelabs.com id 88/37-03814-1E087175; Wed, 20 Apr 2016 13:15:13 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFlrFIsWRWlGSWpSXmKPExsVybKJsh+7DBvF wg6Z5khbft0xmcmD0OPzhCksAYxRrZl5SfkUCa0bPx1aWgi9sFf+uT2RsYPzA2sXIySEkMJVR YtUWpy5GLiC7k0mipfEuM0iCRUBbovP4CjYQm03AUOLvk01ANgeHBJC95DMHSFhEQE6i6e07F pBeZoF2RomdG2ezgySEBbwkls5+ywhi8wp4S7w9MBdspqiArsShf3/YIOKCEidnPmEBsZkFtC SWT98GZksIZEjM65nDCmF7SSy6cQnKVpO4em4T8wRG/llI2mchaV/AyLSKUaM4tagstUjX0EQ vqSgzPaMkNzEzR9fQwFgvN7W4ODE9NScxqVgvOT93EyMw3BiAYAfjiu2ehxglOZiURHlVBcTD hfiS8lMqMxKLM+KLSnNSiw8xynBwKEnwNtcD5QSLUtNTK9Iyc4CBD5OW4OBREuHNA0nzFhck5 hZnpkOkTjHqciz4cXstkxBLXn5eqpQ471WQIgGQoozSPLgRsCi8xCgrJczLCHSUEE9BalFuZg mq/CtGcQ5GJWHe1SBTeDLzSuA2vQI6ggnoCP67oiBHlCQipKQaGM+pe736bxir9+vt4m+hbE7 invt+9e4Tnhnvn3p6bhRXRN577cWfn0Yx82e+2HNJXvhfAtuuyNdK7AsD34bPjY/1+HtH96vz /mjmwJsSaxdFm8153u2sfLHh6um9JQ39T60uG/KkBltpNhgIM07zb7C6Wiol2jx961TP0nJz4 5hZtVmcCqLPlFiKMxINtZiLihMBuQUaxL0CAAA= X-Env-Sender: sstabellini@kernel.org X-Msg-Ref: server-14.tower-31.messagelabs.com!1461158112!35970331!1 X-Originating-IP: [198.145.29.136] X-SpamReason: No, hits=0.0 required=7.0 tests= X-StarScan-Received: X-StarScan-Version: 8.28; banners=-,-,- X-VirusChecked: Checked Received: (qmail 61068 invoked from network); 20 Apr 2016 13:15:13 -0000 Received: from mail.kernel.org (HELO mail.kernel.org) (198.145.29.136) by server-14.tower-31.messagelabs.com with DHE-RSA-AES256-GCM-SHA384 encrypted SMTP; 20 Apr 2016 13:15:13 -0000 Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id C20392020F; Wed, 20 Apr 2016 13:15:10 +0000 (UTC) Received: from [10.0.0.5] (107.238.189.80.dyn.plus.net [80.189.238.107]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id F3D2820149; Wed, 20 Apr 2016 13:15:07 +0000 (UTC) Date: Wed, 20 Apr 2016 14:15:01 +0100 (BST) From: Stefano Stabellini X-X-Sender: sstabellini@sstabellini-ThinkPad-X260 To: boris.ostrovsky@oracle.com Message-ID: User-Agent: Alpine 2.10 (DEB 1266 2009-07-14) MIME-Version: 1.0 X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Cc: jgross@suse.com, xen-devel@lists.xenproject.org, sstabellini@kernel.org, linux-kernel@vger.kernel.org, david.vrabel@citrix.com Subject: [Xen-devel] [PATCH] xen/x86: actually allocate legacy interrupts on PV guests X-BeenThere: xen-devel@lists.xen.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xen.org Sender: "Xen-devel" X-Virus-Scanned: ClamAV using ClamSMTP b4ff8389ed14 is incomplete: relies on nr_legacy_irqs() to get the number of legacy interrupts when actually nr_legacy_irqs() returns 0 after probe_8259A(). Use NR_IRQS_LEGACY instead. Signed-off-by: Stefano Stabellini Tested-by: Olaf Hering diff --git a/arch/x86/pci/xen.c b/arch/x86/pci/xen.c index beac4df..349b8ce 100644 --- a/arch/x86/pci/xen.c +++ b/arch/x86/pci/xen.c @@ -491,8 +491,11 @@ int __init pci_xen_initial_domain(void) #endif __acpi_register_gsi = acpi_register_gsi_xen; __acpi_unregister_gsi = NULL; - /* Pre-allocate legacy irqs */ - for (irq = 0; irq < nr_legacy_irqs(); irq++) { + /* + * Pre-allocate the legacy IRQs. Use NR_LEGACY_IRQS here + * because we don't have a PIC and thus nr_legacy_irqs() is zero. + */ + for (irq = 0; irq < NR_IRQS_LEGACY; irq++) { int trigger, polarity; if (acpi_get_override_irq(irq, &trigger, &polarity) == -1)