Re: [PATCH] x86/idt: Simplify the idt_setup_apic_and_irq_gates()

From: Thomas Gleixner
Date: Tue May 22 2018 - 09:23:39 EST


On Tue, 22 May 2018, Dou Liyang wrote:

> Hi Thomas,
>
> At 05/19/2018 08:32 PM, Thomas Gleixner wrote:
> > On Thu, 26 Apr 2018, Dou Liyang wrote:
> >
> > > The vectors between FIRST_SYSTEM_VECTOR and NR_VECTORS are special IRQ
> > > vectors used by the SMP architecture. But, if X86_LOCAL_APIC=n, it will
> > > not be used, and the FIRST_SYSTEM_VECTOR is equal to NR_VECTORS.
> >
> > Correct, but that function has nothing to do with FIRST_SYSTEM_VECTOR.
> >
>
> Oops, sorry, when I reread, my changelog even made me misunderstand.
> the patch hided it.
>
> void __init idt_setup_apic_and_irq_gates(void)
> ...
> for_each_clear_bit_from(i, system_vectors, FIRST_SYSTEM_VECTOR)
> ^^^^^^^^^^^^^^^^^^^
> ...
> for_each_clear_bit_from(i, system_vectors, NR_VECTORS)
>
> What I want to say is:
>
> Â In the APIC=n system, the FIRST_SYSTEM_VECTOR is equal to
> Â NR_VECTORS, So all entries has been set by
>
> for_each_clear_bit_from(i, system_vectors, FIRST_SYSTEM_VECTOR)
> Â Â Â Â...
>
> Â the following setup code for APIC=n is redundant. Just setup gates for
> Â APIC=y.
>
> If it is OK, I will send v2.

Right you are. I got confused ....