linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Stoney Wang <song-bo.wang@hp.com>
To: suresh.b.siddha@intel.com
Cc: linbao.zhang@hp.com, greg.pearson@hp.com,
	linux-kernel@vger.kernel.org, Stoney Wang <song-bo.wang@hp.com>
Subject: [PATCH] x86/apic: check FADT settings after enable x2apic
Date: Tue, 15 Jan 2013 09:50:36 +0800	[thread overview]
Message-ID: <1358214636-4801-1-git-send-email-song-bo.wang@hp.com> (raw)

OS will enable x2apic mode even BIOS default in xapic mode.

FADT settings check (commit ea0dcf903e7d76aa5d483d876215fedcfdfe140f)
should be applied after detect default mode and change the mode (enable_IR_x2apic called)

Signed-off-by: Stoney Wang <song-bo.wang@hp.com>
---
 arch/x86/kernel/apic/x2apic_phys.c |   25 ++++++++++++++++---------
 1 files changed, 16 insertions(+), 9 deletions(-)

diff --git a/arch/x86/kernel/apic/x2apic_phys.c b/arch/x86/kernel/apic/x2apic_phys.c
index e03a1e1..76ea60d 100644
--- a/arch/x86/kernel/apic/x2apic_phys.c
+++ b/arch/x86/kernel/apic/x2apic_phys.c
@@ -20,18 +20,22 @@ static int set_x2apic_phys_mode(char *arg)
 }
 early_param("x2apic_phys", set_x2apic_phys_mode);
 
-static int x2apic_acpi_madt_oem_check(char *oem_id, char *oem_table_id)
+static int x2apic_fadt_phys(void)
 {
-	if (x2apic_phys)
-		return x2apic_enabled();
-	else if ((acpi_gbl_FADT.header.revision >= FADT2_REVISION_ID) &&
-		(acpi_gbl_FADT.flags & ACPI_FADT_APIC_PHYSICAL) &&
-		x2apic_enabled()) {
+	if ((acpi_gbl_FADT.header.revision >= FADT2_REVISION_ID) &&
+		(acpi_gbl_FADT.flags & ACPI_FADT_APIC_PHYSICAL)) {
 		printk(KERN_DEBUG "System requires x2apic physical mode\n");
 		return 1;
 	}
-	else
-		return 0;
+	return 0;
+}
+
+static int x2apic_acpi_madt_oem_check(char *oem_id, char *oem_table_id)
+{
+	if (x2apic_enabled())
+		return x2apic_phys || x2apic_fadt_phys();
+
+	return 0;
 }
 
 static void
@@ -85,7 +89,10 @@ static int x2apic_phys_probe(void)
 	if (x2apic_mode && x2apic_phys)
 		return 1;
 
-	return apic == &apic_x2apic_phys;
+	if (apic == &apic_x2apic_phys)
+		return 1;
+
+	return x2apic_enabled() && x2apic_fadt_phys();
 }
 
 static struct apic apic_x2apic_phys = {
-- 
1.7.1


             reply	other threads:[~2013-01-15  1:51 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-01-15  1:50 Stoney Wang [this message]
2013-01-28  5:05 ` [PATCH] x86/apic: check FADT settings after enable x2apic Wang, Song-Bo (Stoney)
2013-01-28  6:57   ` Yinghai Lu
2013-01-28 10:11     ` Ingo Molnar
2013-01-28 18:10       ` Yinghai Lu
2013-01-29  7:47         ` Ingo Molnar
2013-01-29  8:43           ` Wang, Song-Bo (Stoney)
2013-01-29  8:49             ` Ingo Molnar
2013-01-29 21:30               ` Yinghai Lu
2013-01-29 21:52               ` Yinghai Lu
2013-01-31 11:32                 ` Ingo Molnar
2013-01-31 15:56                   ` Yinghai Lu
2013-02-04  6:41                   ` Wang, Song-Bo (Stoney)
2013-02-04 11:03                     ` Ingo Molnar
2013-02-04 20:29                       ` [PATCH] x86, apic: Check fadt x2apic phys in x2apic_phys_probe() Yinghai Lu
2013-02-05 12:24                         ` Ingo Molnar
2013-02-05 16:53                           ` Yinghai Lu
2013-02-06 13:16                             ` Ingo Molnar
2013-02-06 17:10                               ` Yinghai Lu
2013-02-07 18:53                                 ` [PATCH v4] " Yinghai Lu
2013-02-11 12:37                                   ` [tip:x86/urgent] x86/apic: Work around boot failure on HP ProLiant DL980 G7 Server systems tip-bot for Stoney Wang
2013-02-18  8:52                                   ` [PATCH v4] x86, apic: Check fadt x2apic phys in x2apic_phys_probe() Lin-Bao Zhang
2013-02-18 17:13                                     ` Yinghai Lu

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=1358214636-4801-1-git-send-email-song-bo.wang@hp.com \
    --to=song-bo.wang@hp.com \
    --cc=greg.pearson@hp.com \
    --cc=linbao.zhang@hp.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=suresh.b.siddha@intel.com \
    /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;
as well as URLs for NNTP newsgroup(s).