From nobody Sun May 5 16:02:39 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org ARC-Seal: i=1; a=rsa-sha256; t=1585336017; cv=none; d=zohomail.com; s=zohoarc; b=GY4F5mhSLHU/vf1N8LSVadI0b49vijVZTNC926m7kJ+eCj499ijL9jwBC9cmD+TIzR6YZNurx0oxBx5YQTUptaTADtYb0B/YZA6Irb58ZB/U+2bIcPSMshuqualrobXmeQlvalFtXyOeBFPRdfv6wa5Cj8SxXN6cSXf/pHBG67o= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1585336017; h=Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:Message-ID:References:Sender:Subject:To; bh=LbkHRMejVzjX2Y1W5Wqka+7qxm9kBms8I4prnQ0VkJ4=; b=ZPFHpJhf9VoUz0VPT8m66wgrZCAeIxVrWIsP9UsL9jJHAuIIfbbuXhZDCfG486jPulhlNRvfhWSI2JbRZj+3JdQU6StXq9pe7z04UKu5iE3UJpFDN5YJUfItrENpWCQF9W/YqPWhYwhns17JUDyyI/iZp8GkfUobSSDzCF4s2qk= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 158533601727437.638992644153745; Fri, 27 Mar 2020 12:06:57 -0700 (PDT) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1jHuIu-00010d-7s; Fri, 27 Mar 2020 19:06:04 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1jHuIs-00010S-J6 for xen-devel@lists.xenproject.org; Fri, 27 Mar 2020 19:06:02 +0000 Received: from mail.xenproject.org (unknown [104.130.215.37]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id fff63f92-705d-11ea-a6c1-bc764e2007e4; Fri, 27 Mar 2020 19:06:01 +0000 (UTC) Received: from xenbits.xenproject.org ([104.239.192.120]) by mail.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1jHuIr-0000HW-7V; Fri, 27 Mar 2020 19:06:01 +0000 Received: from 54-240-197-235.amazon.com ([54.240.197.235] helo=ufe34d9ed68d054.ant.amazon.com) by xenbits.xenproject.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.89) (envelope-from ) id 1jHuIq-0008GW-UI; Fri, 27 Mar 2020 19:06:01 +0000 X-Inumbo-ID: fff63f92-705d-11ea-a6c1-bc764e2007e4 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org; s=20200302mail; h=References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From: Sender:Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=LbkHRMejVzjX2Y1W5Wqka+7qxm9kBms8I4prnQ0VkJ4=; b=O3Pnm3WTHlxwO/aHPiA6TzTVb7 z93HNWeUDmHKZptteXNzz/tIQ9Am3ge431GMOPbjS79vSNNJuEf+wjJ4PdCfvOKnCP1ozJsHkONyz Bm6Xq+aLsXI1dKHK7eZanZ/zXFVBBvLfwbb8FBFZUbgk7hKSlE/1+tChL44swRLvzYJ8=; From: Julien Grall To: xen-devel@lists.xenproject.org Date: Fri, 27 Mar 2020 19:05:44 +0000 Message-Id: <20200327190546.21580-2-julien@xen.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200327190546.21580-1-julien@xen.org> References: <20200327190546.21580-1-julien@xen.org> Subject: [Xen-devel] [PATCH 1/3] xen/x86: ioapic: Use true/false in bad_ioapic_register() 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@xen.org, Wei Liu , Andrew Cooper , Julien Grall , Jan Beulich , =?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Julien Grall bad_ioapic_register() is return a bool, so we should switch to true/false. Signed-off-by: Julien Grall Acked-by: Jan Beulich Reviewed-by: Wei Liu --- xen/arch/x86/io_apic.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/xen/arch/x86/io_apic.c b/xen/arch/x86/io_apic.c index e98e08e9c8..9868933287 100644 --- a/xen/arch/x86/io_apic.c +++ b/xen/arch/x86/io_apic.c @@ -2531,10 +2531,10 @@ static __init bool bad_ioapic_register(unsigned int= idx) { printk(KERN_WARNING "I/O APIC %#x registers return all ones, skipp= ing!\n", mp_ioapics[idx].mpc_apicaddr); - return 1; + return true; } =20 - return 0; + return false; } =20 void __init init_ioapic_mappings(void) --=20 2.17.1 From nobody Sun May 5 16:02:39 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org ARC-Seal: i=1; a=rsa-sha256; t=1585336011; cv=none; d=zohomail.com; s=zohoarc; b=nsl/3wANL56To70FTN7Fqyauzdq4+0qtPMBwNZKCXKxDoIEYfVd+9E3kY905Q+dX/tzKqunAzo5eWNn6I1m9e2VUNFZyXrqnsOO/mnZ1403wTmuM6gUCW8zp1WmjShWEigQo2EoF1QdJX1YM64l/CLLprCN+9J/sNFchTBE8KiY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1585336011; h=Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:Message-ID:References:Sender:Subject:To; bh=jjF1bOOYAwCDwYk7dmh1xYKDxjJ8k2AnoUufOIgOUNw=; b=LbHU1yZ5WbTGgJcDIKX60STgETQgNDDyho/U+nlNMjvH/LPXiEFCUVUhJUA7GzLvwamLonFnEOG0btxoDUj3pl/Mp2W+oeworiTAgZV5VTv5bsT7EKu7iLgEFGuI8AXRLLmgJe/wfKT/7fTrjv2XzdI14IJaa6MTg8OLimbE0wc= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 158533601120967.65571140110796; Fri, 27 Mar 2020 12:06:51 -0700 (PDT) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1jHuIy-00011X-TM; Fri, 27 Mar 2020 19:06:08 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1jHuIx-000118-FW for xen-devel@lists.xenproject.org; Fri, 27 Mar 2020 19:06:07 +0000 Received: from mail.xenproject.org (unknown [104.130.215.37]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id 009d02a0-705e-11ea-bec1-bc764e2007e4; Fri, 27 Mar 2020 19:06:02 +0000 (UTC) Received: from xenbits.xenproject.org ([104.239.192.120]) by mail.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1jHuIs-0000Ht-FZ; Fri, 27 Mar 2020 19:06:02 +0000 Received: from 54-240-197-235.amazon.com ([54.240.197.235] helo=ufe34d9ed68d054.ant.amazon.com) by xenbits.xenproject.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.89) (envelope-from ) id 1jHuIs-0008GW-6h; Fri, 27 Mar 2020 19:06:02 +0000 X-Inumbo-ID: 009d02a0-705e-11ea-bec1-bc764e2007e4 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org; s=20200302mail; h=References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From: Sender:Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=jjF1bOOYAwCDwYk7dmh1xYKDxjJ8k2AnoUufOIgOUNw=; b=qh8qt/Z9PIDY3m2Zo3lrBjqB7x j0YUTy7D6uXZE/UJQ8mZDEGoOv+ScZo3Jrc6VnUB1LJA2D0xBg2eLb4SZHIgqbFAxhQt4HSqdQVX2 Zd2yrHB/IW3+H0W8Ex+i0I+ClBZC6YoMjE169sZP5gBn/ylZmrQ2jIn93tsk2/97Hl9A=; From: Julien Grall To: xen-devel@lists.xenproject.org Date: Fri, 27 Mar 2020 19:05:45 +0000 Message-Id: <20200327190546.21580-3-julien@xen.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200327190546.21580-1-julien@xen.org> References: <20200327190546.21580-1-julien@xen.org> Subject: [Xen-devel] [PATCH 2/3] xen/x86: ioapic: Rename init_ioapic_mappings() to init_ioapic() 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@xen.org, Wei Liu , Andrew Cooper , Julien Grall , Jan Beulich , =?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Julien Grall The function init_ioapic_mappings() is doing more than initialization mappings. It is also initialization the number of IRQs/GSIs supported. So rename the function to init_ioapic(). This will allow us to re-use the name in a follow-up patch. Signed-off-by: Julien Grall Acked-by: Jan Beulich Reviewed-by: Roger Pau Monn=C3=A9 --- xen/arch/x86/apic.c | 2 +- xen/arch/x86/io_apic.c | 2 +- xen/include/asm-x86/io_apic.h | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/xen/arch/x86/apic.c b/xen/arch/x86/apic.c index cde67cd87e..c7a54cafc3 100644 --- a/xen/arch/x86/apic.c +++ b/xen/arch/x86/apic.c @@ -978,7 +978,7 @@ __next: boot_cpu_physical_apicid =3D get_apic_id(); x86_cpu_to_apicid[0] =3D get_apic_id(); =20 - init_ioapic_mappings(); + init_ioapic(); } =20 /*************************************************************************= **** diff --git a/xen/arch/x86/io_apic.c b/xen/arch/x86/io_apic.c index 9868933287..9a11ee8342 100644 --- a/xen/arch/x86/io_apic.c +++ b/xen/arch/x86/io_apic.c @@ -2537,7 +2537,7 @@ static __init bool bad_ioapic_register(unsigned int i= dx) return false; } =20 -void __init init_ioapic_mappings(void) +void __init init_ioapic(void) { unsigned long ioapic_phys; unsigned int i, idx =3D FIX_IO_APIC_BASE_0; diff --git a/xen/include/asm-x86/io_apic.h b/xen/include/asm-x86/io_apic.h index 998905186b..8c0af4bdd3 100644 --- a/xen/include/asm-x86/io_apic.h +++ b/xen/include/asm-x86/io_apic.h @@ -180,7 +180,7 @@ extern int io_apic_get_version (int ioapic); extern int io_apic_get_redir_entries (int ioapic); extern int io_apic_set_pci_routing (int ioapic, int pin, int irq, int edge= _level, int active_high_low); =20 -extern void init_ioapic_mappings(void); +extern void init_ioapic(void); =20 extern void ioapic_suspend(void); extern void ioapic_resume(void); --=20 2.17.1 From nobody Sun May 5 16:02:39 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org ARC-Seal: i=1; a=rsa-sha256; t=1585336012; cv=none; d=zohomail.com; s=zohoarc; b=ST6WUqVVTQYD6fK3jQbTog3/uZqzL56e+IMg0P+bRHMPhcwr+dsmDCFW6i610IPBUuXC/9LOKhMvOIb9tnz8jB0wVLteTBPurqxUCh2pWohPUl9XAUWQbu4iGtEe9NMsRxWWShpUL9sQ/7g6fAXvO/yU7AhVDv/R89MhcjBn5G8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1585336012; h=Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:Message-ID:References:Sender:Subject:To; bh=/kgX5xknhEqORZatyugjOY2mzp7As56zH4Y5K1HikCY=; b=XijFas3HurpqgfgeS54glWS9yE7+dfH/WwgxeVOXYfRntkZNJkUKWTio93R6BEePRfEXU1NF6I/RQDkBUCh7akLHlQd9ZIQGPOAqC1Em9AEuhlA5GT3GGiBu+Zic9lKNb9gEkyziJB2rM0SH/y0ExTo9gEPVsQJGP8wjMXpDRHs= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1585336012461791.2439495357183; Fri, 27 Mar 2020 12:06:52 -0700 (PDT) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1jHuIx-00011E-KW; Fri, 27 Mar 2020 19:06:07 +0000 Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1jHuIw-000113-Pp for xen-devel@lists.xenproject.org; Fri, 27 Mar 2020 19:06:06 +0000 Received: from mail.xenproject.org (unknown [104.130.215.37]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id 0160e7c4-705e-11ea-8a1a-12813bfff9fa; Fri, 27 Mar 2020 19:06:04 +0000 (UTC) Received: from xenbits.xenproject.org ([104.239.192.120]) by mail.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1jHuIt-0000I0-OJ; Fri, 27 Mar 2020 19:06:03 +0000 Received: from 54-240-197-235.amazon.com ([54.240.197.235] helo=ufe34d9ed68d054.ant.amazon.com) by xenbits.xenproject.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.89) (envelope-from ) id 1jHuIt-0008GW-FX; Fri, 27 Mar 2020 19:06:03 +0000 X-Inumbo-ID: 0160e7c4-705e-11ea-8a1a-12813bfff9fa DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org; s=20200302mail; h=References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From: Sender:Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=/kgX5xknhEqORZatyugjOY2mzp7As56zH4Y5K1HikCY=; b=28SU1bQebDXQ8tQqfWMjDEuD3o owCEoSDHSZJ0gu3B1wnFQuwOxrAibjOaSsqokMLH9dWqe4GomPPbRkMnuWVtTqcr+3crRf3XHCROf RH1iLW36eF5KeDwMebugKgjyJM6eiUemvGBJRECar3RjKORLZRVvfu7Ba/0u1Yai5BQI=; From: Julien Grall To: xen-devel@lists.xenproject.org Date: Fri, 27 Mar 2020 19:05:46 +0000 Message-Id: <20200327190546.21580-4-julien@xen.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200327190546.21580-1-julien@xen.org> References: <20200327190546.21580-1-julien@xen.org> Subject: [Xen-devel] [PATCH 3/3] xen/x86: ioapic: Simplify ioapic_init() 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@xen.org, Wei Liu , Andrew Cooper , Julien Grall , Jan Beulich , =?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Julien Grall Since commit 9facd54a45 "x86/ioapic: Add register level checks to detect bogus io-apic entries", Xen is able to cope with IO APICs not mapped in the fixmap. Therefore the whole logic to allocate a fake page for some IO APICs is unnecessary. With the logic removed, the code can be simplified a lot as we don't need to go through all the IO APIC if SMP has not been detected or a bogus zero IO-APIC address has been detected. To avoid another level of tabulation, the simplification is now moved in its own function. Signed-off-by: Julien Grall --- xen/arch/x86/io_apic.c | 63 ++++++++++++++++++++---------------------- 1 file changed, 30 insertions(+), 33 deletions(-) diff --git a/xen/arch/x86/io_apic.c b/xen/arch/x86/io_apic.c index 9a11ee8342..3d52e4daf1 100644 --- a/xen/arch/x86/io_apic.c +++ b/xen/arch/x86/io_apic.c @@ -2537,34 +2537,25 @@ static __init bool bad_ioapic_register(unsigned int= idx) return false; } =20 -void __init init_ioapic(void) +static void __init init_ioapic_mappings(void) { - unsigned long ioapic_phys; unsigned int i, idx =3D FIX_IO_APIC_BASE_0; - union IO_APIC_reg_01 reg_01; =20 - if ( smp_found_config ) - nr_irqs_gsi =3D 0; for ( i =3D 0; i < nr_ioapics; i++ ) { - if ( smp_found_config ) - { - ioapic_phys =3D mp_ioapics[i].mpc_apicaddr; - if ( !ioapic_phys ) - { - printk(KERN_ERR "WARNING: bogus zero IO-APIC address " - "found in MPTABLE, disabling IO/APIC support!\n"); - smp_found_config =3D false; - skip_ioapic_setup =3D true; - goto fake_ioapic_page; - } - } - else + union IO_APIC_reg_01 reg_01; + unsigned long ioapic_phys =3D mp_ioapics[i].mpc_apicaddr; + + ioapic_phys =3D mp_ioapics[i].mpc_apicaddr; + if ( !ioapic_phys ) { - fake_ioapic_page: - ioapic_phys =3D __pa(alloc_xenheap_page()); - clear_page(__va(ioapic_phys)); + printk(KERN_ERR + "WARNING: bogus zero IO-APIC address found in MPTABLE, = disabling IO/APIC support!\n"); + smp_found_config =3D false; + skip_ioapic_setup =3D true; + break; } + set_fixmap_nocache(idx, ioapic_phys); apic_printk(APIC_VERBOSE, "mapped IOAPIC to %08Lx (%08lx)\n", __fix_to_virt(idx), ioapic_phys); @@ -2576,18 +2567,24 @@ void __init init_ioapic(void) continue; } =20 - if ( smp_found_config ) - { - /* The number of IO-APIC IRQ registers (=3D=3D #pins): */ - reg_01.raw =3D io_apic_read(i, 1); - nr_ioapic_entries[i] =3D reg_01.bits.entries + 1; - nr_irqs_gsi +=3D nr_ioapic_entries[i]; - - if ( rangeset_add_singleton(mmio_ro_ranges, - ioapic_phys >> PAGE_SHIFT) ) - printk(KERN_ERR "Failed to mark IO-APIC page %lx read-only= \n", - ioapic_phys); - } + /* The number of IO-APIC IRQ registers (=3D=3D #pins): */ + reg_01.raw =3D io_apic_read(i, 1); + nr_ioapic_entries[i] =3D reg_01.bits.entries + 1; + nr_irqs_gsi +=3D nr_ioapic_entries[i]; + + if ( rangeset_add_singleton(mmio_ro_ranges, + ioapic_phys >> PAGE_SHIFT) ) + printk(KERN_ERR "Failed to mark IO-APIC page %lx read-only\n", + ioapic_phys); + } +} + +void __init init_ioapic(void) +{ + if ( smp_found_config ) + { + nr_irqs_gsi =3D 0; + init_ioapic_mappings(); } =20 nr_irqs_gsi =3D max(nr_irqs_gsi, highest_gsi() + 1); --=20 2.17.1