lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <4A2C0B1B.3080502@kernel.org>
Date:	Sun, 07 Jun 2009 11:46:51 -0700
From:	Yinghai Lu <yinghai@...nel.org>
To:	mingo@...hat.com, hpa@...or.com, linux-kernel@...r.kernel.org,
	andreas.herrmann3@....com, stable@...nel.org, tglx@...utronix.de,
	mingo@...e.hu
CC:	linux-tip-commits@...r.kernel.org
Subject: Re: [tip:x86/urgent] x86: Detect use of extended APIC ID for AMD
 CPUs

tip-bot for Andreas Herrmann wrote:
> Commit-ID:  37f36c1017f0032fa7a1fb85a0cddfc0d526d17f
> Gitweb:     http://git.kernel.org/tip/37f36c1017f0032fa7a1fb85a0cddfc0d526d17f
> Author:     Andreas Herrmann <andreas.herrmann3@....com>
> AuthorDate: Thu, 4 Jun 2009 12:40:16 +0200
> Committer:  Ingo Molnar <mingo@...e.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@....com>
> Cc: <stable@...nel.org>
> LKML-Reference: <20090604104016.GT5736@...erich.amd.com>
> Signed-off-by: Ingo Molnar <mingo@...e.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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ