All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andi Kleen <ak@muc.de>
To: torvalds@osdl.org, akpm@osdl.org, linux-kernel@vger.kernel.org,
	discuss@x86-64.org
Subject: [PATCH] x86_64: Fix safe_smp_processor_id after genapic
Date: 29 Oct 2004 01:46:02 +0200
Date: Fri, 29 Oct 2004 01:46:02 +0200	[thread overview]
Message-ID: <20041028234602.GA94390@muc.de> (raw)


genapic broke early safe_smp_processor_id(), especially when you
got a WARN_ON or oops early it would loops forever in show_trace.
The reason was that the x86_cpu_to_apicid array wasn't correctly
initialized.

This patch fixes this by just testing for this case.


Orginally from James Cleverdon
Acked-by: Andi Kleen <ak@muc.de> 

Please apply ASAP

Index: linux/include/asm-x86_64/smp.h
===================================================================
--- linux.orig/include/asm-x86_64/smp.h	2004-10-28 11:32:15.%N +0200
+++ linux/include/asm-x86_64/smp.h	2004-10-29 01:30:29.%N +0200
@@ -104,6 +104,11 @@
 		if (x86_cpu_to_apicid[i] == apicid)
 			return i;
 
+	/* No entries in x86_cpu_to_apicid?  Either no MPS|ACPI,
+	 * or called too early.  Either way, we must be CPU 0. */
+      	if (x86_cpu_to_apicid[0] == BAD_APICID)
+		return 0;
+
 	return -1;
 }
 

                 reply	other threads:[~2004-10-28 23:49 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20041028234602.GA94390@muc.de \
    --to=ak@muc.de \
    --cc=akpm@osdl.org \
    --cc=discuss@x86-64.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=torvalds@osdl.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.