From: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
To: Jiang Liu <jiang.liu@linux.intel.com>
Cc: Thomas Gleixner <tglx@linutronix.de>,
Ingo Molnar <mingo@redhat.com>,
Sander Eikelenboom <linux@eikelenboom.it>,
"H. Peter Anvin" <hpa@zytor.com>,
x86@kernel.org, Boris Ostrovsky <boris.ostrovsky@oracle.com>,
David Vrabel <david.vrabel@citrix.com>,
Jan Beulich <JBeulich@suse.com>,
David Rientjes <rientjes@google.com>,
HATAYAMA Daisuke <d.hatayama@jp.fujitsu.com>,
Richard Weinberger <richard@nod.at>,
Oren Twaig <oren@scalemp.com>,
Grant Likely <grant.likely@linaro.org>,
Prarit Bhargava <prarit@redhat.com>,
Yinghai Lu <yinghai@kernel.org>, Tony Luck <tony.luck@intel.com>,
linux-kernel@vger.kernel.org, linux-pci@vger.kernel.org,
linux-arm-kernel@lists.infradead.org,
Ingo Molnar <mingo@kernel.org>,
xen-devel@lists.xenproject.org
Subject: Re: [Bugfix] x86/apic: Fix xen IRQ allocation failure caused by commit b81975eade8c
Date: Wed, 7 Jan 2015 09:50:50 -0500 [thread overview]
Message-ID: <20150107145050.GC30457@l.oracle.com> (raw)
In-Reply-To: <1420611244-25624-1-git-send-email-jiang.liu@linux.intel.com>
On Wed, Jan 07, 2015 at 02:13:49PM +0800, Jiang Liu wrote:
> Commit b81975eade8c ("x86, irq: Clean up irqdomain transition code")
> breaks xen IRQ allocation because xen_smp_prepare_cpus() doesn't invoke
> setup_IO_APIC(), so no irqdomains created for IOAPICs and
> mp_map_pin_to_irq() fails at the very beginning.
> --- a/arch/x86/kernel/apic/io_apic.c
> +++ b/arch/x86/kernel/apic/io_apic.c
> @@ -2369,31 +2369,29 @@ static void ioapic_destroy_irqdomain(int idx)
> ioapics[idx].pin_info = NULL;
> }
>
> -void __init setup_IO_APIC(void)
> +void __init setup_IO_APIC(bool xen_smp)
> {
> int ioapic;
>
> - /*
> - * calling enable_IO_APIC() is moved to setup_local_APIC for BP
> - */
> - io_apic_irqs = nr_legacy_irqs() ? ~PIC_IRQS : ~0UL;
> + if (!xen_smp) {
> + apic_printk(APIC_VERBOSE, "ENABLING IO-APIC IRQs\n");
> + io_apic_irqs = nr_legacy_irqs() ? ~PIC_IRQS : ~0UL;
> +
> + /* Set up IO-APIC IRQ routing. */
> + x86_init.mpparse.setup_ioapic_ids();
> + sync_Arb_IDs();
> + }
Is there a specific reason that this cannot run in all cases?
What I am asking is why are we doing a special case here? The description
at the top implied that we were just missing an call to
setup_IO_APIC..
>
> - apic_printk(APIC_VERBOSE, "ENABLING IO-APIC IRQs\n");
> for_each_ioapic(ioapic)
> BUG_ON(mp_irqdomain_create(ioapic));
> -
> - /*
> - * Set up IO-APIC IRQ routing.
> - */
> - x86_init.mpparse.setup_ioapic_ids();
> -
> - sync_Arb_IDs();
> setup_IO_APIC_irqs();
> - init_IO_APIC_traps();
> - if (nr_legacy_irqs())
> - check_timer();
> -
> ioapic_initialized = 1;
> +
> + if (!xen_smp) {
> + init_IO_APIC_traps();
> + if (nr_legacy_irqs())
> + check_timer();
> + }
> }
>
> /*
> diff --git a/arch/x86/xen/smp.c b/arch/x86/xen/smp.c
> index 4c071aeb8417..7eb0283901fa 100644
> --- a/arch/x86/xen/smp.c
> +++ b/arch/x86/xen/smp.c
> @@ -326,7 +326,10 @@ static void __init xen_smp_prepare_cpus(unsigned int max_cpus)
>
> xen_raw_printk(m);
> panic(m);
> + } else {
> + setup_IO_APIC(true);
> }
> +
> xen_init_lock_cpu(0);
>
> smp_store_boot_cpu_info();
> --
> 1.7.10.4
>
WARNING: multiple messages have this Message-ID (diff)
From: konrad.wilk@oracle.com (Konrad Rzeszutek Wilk)
To: linux-arm-kernel@lists.infradead.org
Subject: [Bugfix] x86/apic: Fix xen IRQ allocation failure caused by commit b81975eade8c
Date: Wed, 7 Jan 2015 09:50:50 -0500 [thread overview]
Message-ID: <20150107145050.GC30457@l.oracle.com> (raw)
In-Reply-To: <1420611244-25624-1-git-send-email-jiang.liu@linux.intel.com>
On Wed, Jan 07, 2015 at 02:13:49PM +0800, Jiang Liu wrote:
> Commit b81975eade8c ("x86, irq: Clean up irqdomain transition code")
> breaks xen IRQ allocation because xen_smp_prepare_cpus() doesn't invoke
> setup_IO_APIC(), so no irqdomains created for IOAPICs and
> mp_map_pin_to_irq() fails at the very beginning.
> --- a/arch/x86/kernel/apic/io_apic.c
> +++ b/arch/x86/kernel/apic/io_apic.c
> @@ -2369,31 +2369,29 @@ static void ioapic_destroy_irqdomain(int idx)
> ioapics[idx].pin_info = NULL;
> }
>
> -void __init setup_IO_APIC(void)
> +void __init setup_IO_APIC(bool xen_smp)
> {
> int ioapic;
>
> - /*
> - * calling enable_IO_APIC() is moved to setup_local_APIC for BP
> - */
> - io_apic_irqs = nr_legacy_irqs() ? ~PIC_IRQS : ~0UL;
> + if (!xen_smp) {
> + apic_printk(APIC_VERBOSE, "ENABLING IO-APIC IRQs\n");
> + io_apic_irqs = nr_legacy_irqs() ? ~PIC_IRQS : ~0UL;
> +
> + /* Set up IO-APIC IRQ routing. */
> + x86_init.mpparse.setup_ioapic_ids();
> + sync_Arb_IDs();
> + }
Is there a specific reason that this cannot run in all cases?
What I am asking is why are we doing a special case here? The description
at the top implied that we were just missing an call to
setup_IO_APIC..
>
> - apic_printk(APIC_VERBOSE, "ENABLING IO-APIC IRQs\n");
> for_each_ioapic(ioapic)
> BUG_ON(mp_irqdomain_create(ioapic));
> -
> - /*
> - * Set up IO-APIC IRQ routing.
> - */
> - x86_init.mpparse.setup_ioapic_ids();
> -
> - sync_Arb_IDs();
> setup_IO_APIC_irqs();
> - init_IO_APIC_traps();
> - if (nr_legacy_irqs())
> - check_timer();
> -
> ioapic_initialized = 1;
> +
> + if (!xen_smp) {
> + init_IO_APIC_traps();
> + if (nr_legacy_irqs())
> + check_timer();
> + }
> }
>
> /*
> diff --git a/arch/x86/xen/smp.c b/arch/x86/xen/smp.c
> index 4c071aeb8417..7eb0283901fa 100644
> --- a/arch/x86/xen/smp.c
> +++ b/arch/x86/xen/smp.c
> @@ -326,7 +326,10 @@ static void __init xen_smp_prepare_cpus(unsigned int max_cpus)
>
> xen_raw_printk(m);
> panic(m);
> + } else {
> + setup_IO_APIC(true);
> }
> +
> xen_init_lock_cpu(0);
>
> smp_store_boot_cpu_info();
> --
> 1.7.10.4
>
next prev parent reply other threads:[~2015-01-07 14:52 UTC|newest]
Thread overview: 54+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-01-07 6:13 [Bugfix] x86/apic: Fix xen IRQ allocation failure caused by commit b81975eade8c Jiang Liu
2015-01-07 6:13 ` Jiang Liu
2015-01-07 14:50 ` Konrad Rzeszutek Wilk [this message]
2015-01-07 14:50 ` Konrad Rzeszutek Wilk
2015-01-07 15:37 ` Jiang Liu
2015-01-07 15:37 ` Jiang Liu
2015-01-07 15:37 ` Jiang Liu
2015-01-07 15:44 ` Konrad Rzeszutek Wilk
2015-01-07 15:44 ` Konrad Rzeszutek Wilk
2015-01-07 15:44 ` Konrad Rzeszutek Wilk
2015-01-08 6:36 ` Jiang Liu
2015-01-08 6:36 ` Jiang Liu
2015-01-09 21:15 ` Konrad Rzeszutek Wilk
2015-01-09 21:15 ` Konrad Rzeszutek Wilk
2015-01-09 21:15 ` Konrad Rzeszutek Wilk
2015-01-08 6:36 ` Jiang Liu
2015-01-07 14:50 ` Konrad Rzeszutek Wilk
2015-01-10 19:12 ` Sander Eikelenboom
2015-01-10 19:12 ` Sander Eikelenboom
2015-01-12 13:39 ` [PATCH v2] " Jiang Liu
2015-01-12 13:39 ` Jiang Liu
2015-01-12 15:01 ` David Vrabel
2015-01-12 15:01 ` [Xen-devel] " David Vrabel
2015-01-12 23:18 ` Sander Eikelenboom
2015-01-13 9:01 ` Thomas Gleixner
2015-01-14 3:09 ` [PATCH v3] " Jiang Liu
2015-01-14 12:23 ` Sander Eikelenboom
2015-01-14 12:29 ` Jiang Liu
2015-01-15 13:04 ` [Bugfix v4 0/2] " Jiang Liu
2015-01-15 13:04 ` [Bugfix v4 1/2] xen/pci: " Jiang Liu
2015-01-15 13:04 ` Jiang Liu
2015-01-16 18:13 ` Konrad Rzeszutek Wilk
2015-01-19 4:39 ` Jiang Liu
2015-01-19 4:39 ` Jiang Liu
2015-01-19 4:41 ` Jiang Liu
2015-01-20 19:12 ` Konrad Rzeszutek Wilk
2015-01-20 19:12 ` Konrad Rzeszutek Wilk
2015-01-19 4:41 ` Jiang Liu
2015-01-16 18:13 ` Konrad Rzeszutek Wilk
2015-01-15 13:04 ` [Bugfix v4 2/2] xen/pci: Simplify x86/pci/xen.c by killing gsi_override related code Jiang Liu
2015-01-15 13:04 ` Jiang Liu
2015-01-15 13:11 ` [Bugfix v4 0/2] Fix xen IRQ allocation failure caused by commit b81975eade8c Sander Eikelenboom
2015-01-15 14:22 ` Sander Eikelenboom
2015-01-15 14:37 ` Jiang Liu
2015-01-13 9:01 ` [PATCH v2] [Bugfix] x86/apic: " Thomas Gleixner
2015-01-12 23:18 ` Sander Eikelenboom
2015-01-13 2:23 ` Jiang Liu
2015-01-13 2:23 ` [Xen-devel] " Jiang Liu
2015-01-13 10:09 ` David Vrabel
2015-01-13 12:39 ` Jiang Liu
2015-01-13 12:39 ` [Xen-devel] " Jiang Liu
2015-01-13 10:09 ` David Vrabel
2015-01-10 19:12 ` Sander Eikelenboom
-- strict thread matches above, loose matches on Subject: below --
2015-01-07 6:13 Jiang Liu
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20150107145050.GC30457@l.oracle.com \
--to=konrad.wilk@oracle.com \
--cc=JBeulich@suse.com \
--cc=boris.ostrovsky@oracle.com \
--cc=d.hatayama@jp.fujitsu.com \
--cc=david.vrabel@citrix.com \
--cc=grant.likely@linaro.org \
--cc=hpa@zytor.com \
--cc=jiang.liu@linux.intel.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pci@vger.kernel.org \
--cc=linux@eikelenboom.it \
--cc=mingo@kernel.org \
--cc=mingo@redhat.com \
--cc=oren@scalemp.com \
--cc=prarit@redhat.com \
--cc=richard@nod.at \
--cc=rientjes@google.com \
--cc=tglx@linutronix.de \
--cc=tony.luck@intel.com \
--cc=x86@kernel.org \
--cc=xen-devel@lists.xenproject.org \
--cc=yinghai@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.