All of lore.kernel.org
 help / color / mirror / Atom feed
From: Yinghai Lu <yinghai@kernel.org>
To: mingo@redhat.com, hpa@zytor.com, linux-kernel@vger.kernel.org,
	andreas.herrmann3@amd.com, stable@kernel.org, tglx@linutronix.de,
	mingo@elte.hu
Cc: linux-tip-commits@vger.kernel.org
Subject: Re: [tip:x86/urgent] x86: Detect use of extended APIC ID for AMD CPUs
Date: Sun, 07 Jun 2009 11:46:51 -0700	[thread overview]
Message-ID: <4A2C0B1B.3080502@kernel.org> (raw)
In-Reply-To: <tip-37f36c1017f0032fa7a1fb85a0cddfc0d526d17f@git.kernel.org>

tip-bot for Andreas Herrmann wrote:
> Commit-ID:  37f36c1017f0032fa7a1fb85a0cddfc0d526d17f
> Gitweb:     http://git.kernel.org/tip/37f36c1017f0032fa7a1fb85a0cddfc0d526d17f
> Author:     Andreas Herrmann <andreas.herrmann3@amd.com>
> AuthorDate: Thu, 4 Jun 2009 12:40:16 +0200
> Committer:  Ingo Molnar <mingo@elte.hu>
> CommitDate: Sun, 7 Jun 2009 16:39:38 +0200
> 
> x86: Detect use of extended APIC ID for AMD CPUs
> 
> Booting a 32-bit kernel on Magny-Cours results in the following panic
> 
>   ...
>   Using APIC driver default
>   ...
>   Overriding APIC driver with bigsmp
>   ...
>   Getting VERSION: 80050010
>   Getting VERSION: 80050010
>   Getting ID: 10000000
>   Getting ID: ef000000
>   Getting LVT0: 700
>   Getting LVT1: 10000
>   Kernel panic - not syncing: Boot APIC ID in local APIC unexpected (16 vs 0)
>   Pid: 1, comm: swapper Not tainted 2.6.30-rcX #2
>   Call Trace:
>    [<c05194da>] ? panic+0x38/0xd3
>    [<c0743102>] ? native_smp_prepare_cpus+0x259/0x31f
>    [<c073b19d>] ? kernel_init+0x3e/0x141
>    [<c073b15f>] ? kernel_init+0x0/0x141
>    [<c020325f>] ? kernel_thread_helper+0x7/0x10
> 
> The reason is that default_get_apic_id handled extension of local APIC
> ID field just in case of XAPIC.
> 
> Thus for this AMD CPU, default_get_apic_id() returns 0 and
> bigsmp_get_apic_id() returns 16 which leads to the respective kernel
> panic.
> 
> This patch introduces a Linux specific feature flag to indicate
> support for extended APIC id (8 bits instead of 4 bits width) and sets
> the flag on AMD CPUs if applicable.
> 
> Signed-off-by: Andreas Herrmann <andreas.herrmann3@amd.com>
> Cc: <stable@kernel.org>
> LKML-Reference: <20090604104016.GT5736@alberich.amd.com>
> Signed-off-by: Ingo Molnar <mingo@elte.hu>
> 
> 
> ---
>  arch/x86/include/asm/apic.h       |    2 +-
>  arch/x86/include/asm/cpufeature.h |    1 +
>  arch/x86/kernel/cpu/amd.c         |   10 ++++++++++
>  3 files changed, 12 insertions(+), 1 deletions(-)
> 
> diff --git a/arch/x86/include/asm/apic.h b/arch/x86/include/asm/apic.h
> index 42f2f83..9b2c049 100644
> --- a/arch/x86/include/asm/apic.h
> +++ b/arch/x86/include/asm/apic.h
> @@ -410,7 +410,7 @@ static inline unsigned default_get_apic_id(unsigned long x)
>  {
>  	unsigned int ver = GET_APIC_VERSION(apic_read(APIC_LVR));
>  
> -	if (APIC_XAPIC(ver))
> +	if (APIC_XAPIC(ver) || boot_cpu_has(X86_FEATURE_EXTD_APICID))
>  		return (x >> 24) & 0xFF;
>  	else
>  		return (x >> 24) & 0x0F;

looks like we should fix APIC_XAPIC() or have one global apic_ver.

YH

  parent reply	other threads:[~2009-06-07 18:47 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-06-04 10:40 [PATCH] x86: detect use of extended APIC ID for AMD CPUs Andreas Herrmann
2009-06-07 14:42 ` [tip:x86/urgent] x86: Detect " tip-bot for Andreas Herrmann
2009-06-07 15:33   ` Ingo Molnar
2009-06-08 12:01     ` Andreas Herrmann
2009-06-08 13:12       ` [PATCH v2] x86: detect " Andreas Herrmann
2009-06-08 13:55         ` [PATCH v3] " Andreas Herrmann
2009-06-09 14:52           ` [tip:x86/urgent] x86: Detect " tip-bot for Andreas Herrmann
2009-06-07 18:46   ` Yinghai Lu [this message]
2009-06-08 12:18     ` Andreas Herrmann
2009-07-21 10:36 ` [PATCH] x86: detect " Bastian Blank
2009-07-21 10:36   ` Bastian Blank
2009-07-21 16:56   ` Jeremy Fitzhardinge
2009-07-22  9:54     ` Bastian Blank
2009-07-22 14:29       ` Thomas Gleixner
2009-07-22 16:59         ` [PATCH] x86/amd: don't probe for extended APIC ID if APICs are disabled Jeremy Fitzhardinge
2009-07-22 16:59           ` Jeremy Fitzhardinge
2009-07-21 16:56   ` [PATCH] x86: detect use of extended APIC ID for AMD CPUs Jeremy Fitzhardinge

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=4A2C0B1B.3080502@kernel.org \
    --to=yinghai@kernel.org \
    --cc=andreas.herrmann3@amd.com \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tip-commits@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=mingo@redhat.com \
    --cc=stable@kernel.org \
    --cc=tglx@linutronix.de \
    /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.