mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Cyrill Gorcunov <gorcunov@openvz.org>
To: x86@kernel.org
Cc: linux-kernel@vger.kernel.org,
	Cyrill Gorcunov <gorcunov@openvz.org>,
	"Maciej W. Rozycki" <macro@linux-mips.org>
Subject: [rfc -tip 3/4] x86,apic: fix missed handling of discrete apics
Date: Mon, 24 Aug 2009 21:53:38 +0400	[thread overview]
Message-ID: <20090824175551.322214127@openvz.org> (raw)
In-Reply-To: <20090824175335.186713800@openvz.org>

[-- Attachment #1: x86-apic-discrete-fixups-2 --]
[-- Type: text/plain, Size: 1914 bytes --]

In case of discrete (pretty old) apics we may have
cpu_has_apic bit not set but have to check if
smp_found_config (MP spec) is there and apic was
not disabled. So in case of discrete apic we need
to proceed apic handling.

Also don't forget to print apic/io-apic for such
case as well.

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
CC: "Maciej W. Rozycki" <macro@linux-mips.org>
---

Perhaps this smp_found_config,disable_apic (which are
useful for insoectation in x86-32 only apart of cpu_has_apic)
are good candidate for helper function, say lapic_from_mp.
Dunno.Please comment.

 arch/x86/kernel/apic/apic.c    |    2 +-
 arch/x86/kernel/apic/io_apic.c |    4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

Index: linux-2.6.git/arch/x86/kernel/apic/apic.c
=====================================================================
--- linux-2.6.git.orig/arch/x86/kernel/apic/apic.c
+++ linux-2.6.git/arch/x86/kernel/apic/apic.c
@@ -978,7 +978,7 @@ void lapic_shutdown(void)
 {
 	unsigned long flags;
 
-	if (!cpu_has_apic)
+	if (!cpu_has_apic && (!smp_found_config || disable_apic))
 		return;
 
 	local_irq_save(flags);
Index: linux-2.6.git/arch/x86/kernel/apic/io_apic.c
=====================================================================
--- linux-2.6.git.orig/arch/x86/kernel/apic/io_apic.c
+++ linux-2.6.git/arch/x86/kernel/apic/io_apic.c
@@ -1860,7 +1860,7 @@ __apicdebuginit(int) print_all_ICs(void)
 	print_PIC();
 
 	/* don't print out if apic is not there */
-	if (!cpu_has_apic || disable_apic)
+	if (!cpu_has_apic && (!smp_found_config || disable_apic))
 		return 0;
 
 	print_all_local_APICs();
@@ -1978,7 +1978,7 @@ void disable_IO_APIC(void)
 	/*
 	 * Use virtual wire A mode when interrupt remapping is enabled.
 	 */
-	if (cpu_has_apic)
+	if (cpu_has_apic || (smp_found_config && !disable_apic))
 		disconnect_bsp_APIC(!intr_remapping_enabled &&
 				ioapic_i8259.pin != -1);
 }


  parent reply	other threads:[~2009-08-24 17:56 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-08-24 17:53 [rfc -tip 0/4] x86 apic,ioapic fixes Cyrill Gorcunov
2009-08-24 17:53 ` [rfc -tip 1/4] x86,ioapic: define IO_APIC_DEFAULT_PHYS_BASE constant Cyrill Gorcunov
2009-08-26  6:22   ` [tip:x86/apic] x86, ioapic: Define " tip-bot for Cyrill Gorcunov
2009-08-24 17:53 ` [rfc -tip 2/4] x86,e820: __e820_add_region -- guard against array overflowed Cyrill Gorcunov
2009-08-26  6:22   ` [tip:x86/setup] x86, e820: Guard against array overflowed in __e820_add_region() tip-bot for Cyrill Gorcunov
2009-08-24 17:53 ` Cyrill Gorcunov [this message]
2009-08-26  6:12   ` [rfc -tip 3/4] x86,apic: fix missed handling of discrete apics Ingo Molnar
2009-08-26  6:22     ` Cyrill Gorcunov
2009-08-26 16:49     ` Cyrill Gorcunov
2009-08-24 17:53 ` [rfc -tip 4/4] x86,ioapic: ioapic_setup_resources - get rid of needless check and simplify Cyrill Gorcunov
2009-08-26  6:22   ` [tip:x86/apic] x86, ioapic: Get rid of needless check and simplify ioapic_setup_resources() tip-bot for Cyrill Gorcunov

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=20090824175551.322214127@openvz.org \
    --to=gorcunov@openvz.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=macro@linux-mips.org \
    --cc=x86@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome