public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Ingo Molnar <mingo@elte.hu>
To: Yinghai Lu <yinghai@kernel.org>
Cc: Thomas Gleixner <tglx@linutronix.de>,
	"H. Peter Anvin" <hpa@zytor.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] x86: ioremap mptable
Date: Wed, 4 Mar 2009 20:50:14 +0100	[thread overview]
Message-ID: <20090304195014.GA21488@elte.hu> (raw)
In-Reply-To: <49AE4901.3090801@kernel.org>


* Yinghai Lu <yinghai@kernel.org> wrote:

> 
> Impact: fix boot with mptable above max_low_mapped
> 
> try to use early_ioremap to map mpc to make sure it works even it is
> at end of ram on system.
> 
> Signed-off-by: Yinghai Lu <yinghai@kernel.org>
> Reported-and-tested-by: Kevin O'Connor <kevin@koconnor.net>
> 
> ---
>  arch/x86/kernel/mpparse.c |   26 +++++++++++++++++++++++---
>  1 file changed, 23 insertions(+), 3 deletions(-)
> 
> Index: linux-2.6/arch/x86/kernel/mpparse.c
> ===================================================================
> --- linux-2.6.orig/arch/x86/kernel/mpparse.c
> +++ linux-2.6/arch/x86/kernel/mpparse.c
> @@ -558,6 +558,19 @@ static inline void __init construct_defa
>  
>  static struct mpf_intel *mpf_found;
>  
> +static unsigned long __init get_mpc_size(unsigned long physptr)
> +{
> +	struct mpc_table *mpc;
> +	unsigned long size;
> +
> +	mpc = early_ioremap(physptr, PAGE_SIZE);
> +	size = mpc->length;
> +	early_iounmap(mpc, PAGE_SIZE);
> +	apic_printk(APIC_VERBOSE, "  mpc: %lx-%lx\n", physptr, physptr + size);
> +
> +	return size;
> +}
> +
>  /*
>   * Scan the memory blocks for an SMP configuration block.
>   */
> @@ -611,12 +624,16 @@ static void __init __get_smp_config(unsi
>  		construct_default_ISA_mptable(mpf->feature1);
>  
>  	} else if (mpf->physptr) {
> +		struct mpc_table *mpc;
> +		unsigned long size;
>  
> +		size = get_mpc_size(mpf->physptr);
> +		mpc = early_ioremap(mpf->physptr, size);
>  		/*
>  		 * Read the physical hardware table.  Anything here will
>  		 * override the defaults.
>  		 */
> -		if (!smp_read_mpc(phys_to_virt(mpf->physptr), early)) {
> +		if (!smp_read_mpc(mpc, early)) {
>  #ifdef CONFIG_X86_LOCAL_APIC
>  			smp_found_config = 0;
>  #endif
> @@ -624,8 +641,10 @@ static void __init __get_smp_config(unsi
>  			       "BIOS bug, MP table errors detected!...\n");
>  			printk(KERN_ERR "... disabling SMP support. "
>  			       "(tell your hw vendor)\n");
> +			early_iounmap(mpc, size);
>  			return;
>  		}
> +		early_iounmap(mpc, size);
>  
>  		if (early)
>  			return;

the whole "else if" branch here:

 	} else if (mpf->physptr) {

should move into a helper function, not just get_mpc_size().

	Ingo

  parent reply	other threads:[~2009-03-04 19:50 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-03-04  9:22 [PATCH] x86: fix bootmem cross node for 32bit numa Yinghai Lu
2009-03-04  9:24 ` [PATCH] x86: make 32bit init_memory_mapping range change more like 64bit Yinghai Lu
2009-03-04  9:51   ` Pekka Enberg
2009-03-04 20:00   ` [tip:x86/mm] x86: make 32-bit init_memory_mapping range change more like 64-bit Yinghai Lu
2009-03-04  9:25 ` [PATCH] x86: ioremap mptable Yinghai Lu
2009-03-04  9:25   ` [PATCH] x86: reserve exact size of mptable Yinghai Lu
2009-03-04 19:51     ` Ingo Molnar
2009-03-04 20:01     ` [tip:x86/mm] " Yinghai Lu
2009-03-04 19:50   ` Ingo Molnar [this message]
2009-03-04 20:29     ` [PATCH] x86: ioremap mptable Yinghai Lu
2009-03-04 21:06       ` Ingo Molnar
2009-03-04 20:00   ` [tip:x86/mm] " Yinghai Lu
2009-03-04 18:08 ` [PATCH] x86: fix bootmem cross node for 32bit numa -v2 Yinghai Lu
2009-03-04 19:58   ` Ingo Molnar
2009-03-04 20:21     ` Yinghai Lu
2009-03-04 21:12       ` [tip:x86/mm] x86: fix bootmem cross node for 32bit numa, cleanup Yinghai Lu
2009-03-04 20:00 ` [tip:x86/mm] x86: fix bootmem cross node for 32bit numa Yinghai Lu
2009-03-08 23:16   ` Yinghai Lu
2009-03-09  6:58     ` Ingo Molnar

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=20090304195014.GA21488@elte.hu \
    --to=mingo@elte.hu \
    --cc=akpm@linux-foundation.org \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=tglx@linutronix.de \
    --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