Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755950AbZDVKEP (ORCPT ); Wed, 22 Apr 2009 06:04:15 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1753459AbZDVKD6 (ORCPT ); Wed, 22 Apr 2009 06:03:58 -0400 Received: from mx2.mail.elte.hu ([157.181.151.9]:43222 "EHLO mx2.mail.elte.hu" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753312AbZDVKD5 (ORCPT ); Wed, 22 Apr 2009 06:03:57 -0400 Date: Wed, 22 Apr 2009 12:03:35 +0200 From: Ingo Molnar To: "Han, Weidong" Cc: "Siddha, Suresh B" , "hpa@zytor.com" , "tglx@linutronix.de" , "linux-kernel@vger.kernel.org" , "dwmw2@infradead.org" Subject: Re: [patch 4/5] x2apic, IR: remove reinit_intr_remapped_IO_APIC() Message-ID: <20090422100335.GH18226@elte.hu> References: <20090420200450.128993000@linux-os.sc.intel.com> <20090420200450.552359000@linux-os.sc.intel.com> <715D42877B251141A38726ABF5CABF2C01A6B7F9FC@pdsmsx503.ccr.corp.intel.com> <20090421070130.GC22937@elte.hu> <1240338284.27006.8519.camel@localhost.localdomain> <715D42877B251141A38726ABF5CABF2C01A6B7FC31@pdsmsx503.ccr.corp.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <715D42877B251141A38726ABF5CABF2C01A6B7FC31@pdsmsx503.ccr.corp.intel.com> User-Agent: Mutt/1.5.18 (2008-05-17) X-ELTE-VirusStatus: clean X-ELTE-SpamScore: -1.5 X-ELTE-SpamLevel: X-ELTE-SpamCheck: no X-ELTE-SpamVersion: ELTE 2.0 X-ELTE-SpamCheck-Details: score=-1.5 required=5.9 tests=BAYES_00 autolearn=no SpamAssassin version=3.2.3 -1.5 BAYES_00 BODY: Bayesian spam probability is 0 to 1% [score: 0.0000] Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 3836 Lines: 88 * Han, Weidong wrote: > Siddha, Suresh B wrote: > > On Tue, 2009-04-21 at 00:01 -0700, Ingo Molnar wrote: > >> * Han, Weidong wrote: > >> > >>> Siddha, Suresh B wrote: > >>>> When interrupt-remapping is enabled, We are relying on > >>>> setup_IO_APIC_irqs() to configure remapped entries in the IO-APIC, > >>>> which comes little bit later after enabling interrupt-remapping. > >>>> > >>>> Meanwhile, Restore of old io-apic entries after enabling > >>>> interrupt-remapping will not make the interrupts through io-apic > >>>> functional anyway. > >>>> > >>>> So remove unnecessary reinit_intr_remapped_IO_APIC(). > >>>> > >>>> Signed-off-by: Suresh Siddha > >>>> Cc: Weidong Han > >>>> --- > >>>> > >>>> Index: tip/arch/x86/include/asm/io_apic.h > >>>> =================================================================== > >>>> --- tip.orig/arch/x86/include/asm/io_apic.h > >>>> +++ tip/arch/x86/include/asm/io_apic.h > >>>> @@ -166,8 +166,6 @@ extern void free_ioapic_entries(struct I > >>>> extern int save_IO_APIC_setup(struct IO_APIC_route_entry > >>>> **ioapic_entries); extern void mask_IO_APIC_setup(struct > >>>> IO_APIC_route_entry **ioapic_entries); extern int > >>>> restore_IO_APIC_setup(struct IO_APIC_route_entry **ioapic_entries); > >>>> -extern void reinit_intr_remapped_IO_APIC(int intr_remapping, > >>>> - struct IO_APIC_route_entry **ioapic_entries); > >>>> > >>>> extern void probe_nr_irqs_gsi(void); > >>>> > >>>> Index: tip/arch/x86/kernel/apic/apic.c > >>>> =================================================================== > >>>> --- tip.orig/arch/x86/kernel/apic/apic.c > >>>> +++ tip/arch/x86/kernel/apic/apic.c > >>>> @@ -1416,8 +1416,6 @@ end_restore: > >>>> * IR enabling failed > >>>> */ > >>>> restore_IO_APIC_setup(ioapic_entries); > >>>> - else > >>>> - reinit_intr_remapped_IO_APIC(x2apic_preenabled, ioapic_entries); > >>> > >>> Whether IR enabling succeeds or fails, it always needs to restore > >>> old IOAPIC entries. Due to removing reinit_intr_remapped_IO_APIC > >>> here, it needs to also remove the "if (ret)" before > >>> restore_IO_APIC_setup(ioapic_entries); > >> > >> Ok - i skipped this patch for now. > > > > Let me clarify what I am doing in this patch: > > > > When interrupt-remapping is enabled, IO-APIC entries need to be setup > > in the re-mappable format (pointing to interrupt-remapping table > > entries setup by the OS). This remapping configuration is happening > > in the same place where we traditionally configure IO-APIC (i.e., in > > setup_IO_APIC_irqs()). > > > > So when we enable interrupt-remapping successfully, there is no need > > to restore old io-apic RTE entries before we actually do a complete > > configuration shortly in setup_IO_APIC_irqs(). Old IO-APIC RTE's may > > be in traditional format (non re-mappable) or in re-mappable format > > pointing to interrupt-remapping table entries setup by BIOS. Restoring > > both of these will not make IO-APIC functional. We have to rely on > > setup_IO_APIC_irqs() for proper configuration by OS. > > > > So I am removing this unnecessary and broken step. > > > > When enabling interrupt-remapping is not successful, we are doing > > plain restore of old RTE's (which will still work as we went back to > > original no-remapping state). Complete IO-APIC configuration will be > > done shortly in setup_IO_APIC_irqs(). > > > > Clear explanation. I misunderstood it. This patch is fine. Applied to tip:x86/apic - thanks guys, Ingo -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/