Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753444AbcCLUKL (ORCPT ); Sat, 12 Mar 2016 15:10:11 -0500 Received: from www.linutronix.de ([62.245.132.108]:41679 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752657AbcCLUKD (ORCPT ); Sat, 12 Mar 2016 15:10:03 -0500 Date: Sat, 12 Mar 2016 21:08:16 +0100 (CET) From: Thomas Gleixner To: Jianyu Zhan cc: mingo@redhat.com, hpa@zytor.com, Aravind.Gopalakrishnan@amd.com, brgerst@gmail.com, bp@suse.de, feng.wu@intel.com, jiang.liu@linux.intel.com, tj@kernel.org, dvlasenk@redhat.com, penberg@cs.helsinki.fi, yhlu.kernel@gmail.com, andi@firstfloor.org, luto@kernel.org, ajm@sgi.com, yinghai@kernel.org, akinobu.mita@gmail.com, x86@kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 3/3] x86/irq: update first_system_vector only when X86_LOCAL_PIC is on In-Reply-To: Message-ID: References: User-Agent: Alpine 2.11 (DEB 23 2013-08-11) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Linutronix-Spam-Score: -1.0 X-Linutronix-Spam-Level: - X-Linutronix-Spam-Status: No , -1.0 points, 5.0 required, ALL_TRUSTED=-1,SHORTCIRCUIT=-0.0001 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1725 Lines: 52 On Sat, 12 Mar 2016, Jianyu Zhan wrote: > During native_init_IRQ(), we will update first_system_vector conditionally > when we init system vector. But on !CONFIG_X86_LOCAL_PIC, we prefer it > to NR_IRQS, so don't bother set it on this case. > > Signed-off-by: Jianyu Zhan > --- > arch/x86/include/asm/desc.h | 2 ++ > arch/x86/kernel/irqinit.c | 3 --- > 2 files changed, 2 insertions(+), 3 deletions(-) > > diff --git a/arch/x86/include/asm/desc.h b/arch/x86/include/asm/desc.h > index 4e10d73..4fc2deb 100644 > --- a/arch/x86/include/asm/desc.h > +++ b/arch/x86/include/asm/desc.h > @@ -383,8 +383,10 @@ static inline void alloc_system_vector(int vector) > { > if (!test_bit(vector, used_vectors)) { > set_bit(vector, used_vectors); > +#ifdef CONFIG_X86_LOCAL_APIC > if (first_system_vector > vector) > first_system_vector = vector; > +#endif This is pointless, because it's only called when local apic is enabled as all call sites of alloc_intr_gate() depend on CONFIG_X86_LOCAL_APIC .... > } else { > BUG(); > } > diff --git a/arch/x86/kernel/irqinit.c b/arch/x86/kernel/irqinit.c > index 0e9fa7c..e999b38 100644 > --- a/arch/x86/kernel/irqinit.c > +++ b/arch/x86/kernel/irqinit.c > @@ -188,9 +188,6 @@ void __init native_init_IRQ(void) > * 'special' SMP interrupts) > */ > i = FIRST_EXTERNAL_VECTOR; > -#ifndef CONFIG_X86_LOCAL_APIC > -#define first_system_vector NR_VECTORS > -#endif > for_each_clear_bit_from(i, used_vectors, first_system_vector) { And how exactly is this here supposed to compile when CONFIG_X86_LOCAL_APIC=n? > /* IA32_SYSCALL_VECTOR could be used in trap_init already. */ > set_intr_gate(i, irq_entries_start + > -- > 2.4.3 > >