public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: ebiederm@xmission.com (Eric W. Biederman)
To: "H. Peter Anvin" <hpa@zytor.com>
Cc: Yinghai Lu <yinghai@kernel.org>,
	mingo@redhat.com, linux-kernel@vger.kernel.org,
	tvrtko.ursulin@sophos.com, hilld@binarystorm.net,
	tglx@linutronix.de, hpa@linux.intel.com,
	linux-tip-commits@vger.kernel.org
Subject: Re: [tip:x86/urgent] x86, apic: Map the local apic when parsing the MP table.
Date: Fri, 06 Aug 2010 18:08:05 -0700	[thread overview]
Message-ID: <m1d3tvtekq.fsf@fess.ebiederm.org> (raw)
In-Reply-To: <4C5CA5AC.3060608@zytor.com> (H. Peter Anvin's message of "Fri\, 06 Aug 2010 17\:15\:40 -0700")

"H. Peter Anvin" <hpa@zytor.com> writes:

> On 08/06/2010 05:08 PM, Yinghai Lu wrote:
>> this change is not needed, it will break:
>> 1. found mptable, but is using default contruct path.
>> 2. visws path, found found mptable, but get_smp_conf is not called.
>> 
>> YH
>
> I'm not sure the above is decipherable.  Please provide an incremental
> patch with a more detailed description.

YH was saying I overoptimized, and it looks like he is right,
although there are only one or two machines in existence that
are likely to be affected.

Untested patch to remove the cleverness below.  It it boots all
is well.

---

From: Eric W. Biederman <ebiederm@xmission.com>
Date: Fri, 6 Aug 2010 18:00:12 -0700
Subject: [PATCH] x86/apic:  Always map the local apic in init_apic_mappings.

In all of the common cases we currently map the local apic before
we get to init_apic_mappings.  Unfortunately there are still a few
weird subarch code paths that require us to map the local apic in
init_apic_mappings, and those subarchitectures set smp_found_config.

So just unconditionally run the fixmap code, and stop being clever.

Signed-off-by: Eric W. Biederman <ebiederm@xmission.com>
---
 arch/x86/kernel/apic/apic.c |   13 +++++++++----
 1 files changed, 9 insertions(+), 4 deletions(-)

diff --git a/arch/x86/kernel/apic/apic.c b/arch/x86/kernel/apic/apic.c
index c07e513..ad96090 100644
--- a/arch/x86/kernel/apic/apic.c
+++ b/arch/x86/kernel/apic/apic.c
@@ -1603,11 +1603,16 @@ void __init init_apic_mappings(void)
 		apic_phys = mp_lapic_addr;
 
 		/*
-		 * acpi lapic path already maps that address in
-		 * acpi_register_lapic_address()
+		 * acpi and mptable paths already fixmap mp_lapic_addr
+		 * at FIX_APIC_BASE but perform the fixmap anyway
+		 * because our initialization code is spaghetti and
+		 * there are weird subarchitectures that do something
+		 * different.  The double fixmap isn't particularly
+		 * expensive and always running the code should prevent
+		 * bitrot.
+		 *
 		 */
-		if (!acpi_lapic && !smp_found_config)
-			set_fixmap_nocache(FIX_APIC_BASE, apic_phys);
+		set_fixmap_nocache(FIX_APIC_BASE, apic_phys);
 
 		apic_printk(APIC_VERBOSE, "mapped APIC to %08lx (%08lx)\n",
 					APIC_BASE, apic_phys);
-- 
1.6.5.2.143.g8cc62


  parent reply	other threads:[~2010-08-07  1:08 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-08-03  9:28 2.6.35 hangs on early boot in KVM Tvrtko Ursulin
2010-08-03  9:45 ` Tvrtko Ursulin
2010-08-03 13:53   ` Tvrtko Ursulin
2010-08-03 14:51 ` Avi Kivity
2010-08-03 14:57   ` Tvrtko Ursulin
2010-08-03 15:17     ` Tvrtko Ursulin
2010-08-03 15:31       ` Tvrtko Ursulin
2010-08-03 15:49         ` Borislav Petkov
2010-08-03 16:01           ` Tvrtko Ursulin
2010-08-03 15:59       ` Tvrtko Ursulin
2010-08-03 20:37         ` Eric W. Biederman
2010-08-04  8:09           ` Tvrtko Ursulin
2010-08-03 20:57         ` Yinghai Lu
2010-08-04  8:18           ` Tvrtko Ursulin
2010-08-04  9:05             ` Yinghai Lu
2010-08-04  9:16               ` Tvrtko Ursulin
2010-08-04  9:19                 ` Tvrtko Ursulin
2010-08-04  9:34                 ` Yinghai Lu
2010-08-04  9:44                   ` Tvrtko Ursulin
2010-08-04  9:36                 ` Gleb Natapov
2010-08-04 10:37                   ` Eric W. Biederman
2010-08-04 10:46                     ` Tvrtko Ursulin
2010-08-04 20:30                       ` [PATCH] x86/apic: Map the local apic when parsing the MP table Eric W. Biederman
2010-08-04 21:49                         ` Yinghai Lu
2010-08-04 21:58                         ` [PATCH 1/2] x86, acpi: merge two register_lapic_address() Yinghai Lu
2010-08-04 22:00                           ` [PATCH 2/2] x86: remove early_init_lapic_mapping Yinghai Lu
2010-08-06  0:15                         ` [tip:x86/urgent] x86, apic: Map the local apic when parsing the MP table tip-bot for Eric W. Biederman
2010-08-07  0:08                           ` Yinghai Lu
2010-08-07  0:15                             ` H. Peter Anvin
2010-08-07  0:51                               ` Yinghai Lu
2010-08-07  1:08                               ` Eric W. Biederman [this message]
2010-08-07  1:21                                 ` H. Peter Anvin
2010-08-07  1:30                                   ` Yinghai Lu
2010-08-07  2:49                                     ` Eric W. Biederman

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=m1d3tvtekq.fsf@fess.ebiederm.org \
    --to=ebiederm@xmission.com \
    --cc=hilld@binarystorm.net \
    --cc=hpa@linux.intel.com \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tip-commits@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=tglx@linutronix.de \
    --cc=tvrtko.ursulin@sophos.com \
    --cc=yinghai@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