All of lore.kernel.org
 help / color / mirror / Atom feed
From: Vivek Goyal <vgoyal@redhat.com>
To: Bob Montgomery <bob.montgomery@hp.com>
Cc: airlied@linux.ie,
	linux kernel mailing list <linux-kernel@vger.kernel.org>,
	"kexec@lists.infradead.org" <kexec@lists.infradead.org>,
	Andi Kleen <ak@suse.de>, Dave Jones <rhkernel-list@redhat.com>
Subject: Re: AMD Family 10H machine check on vmcore read
Date: Tue, 8 Jul 2008 09:28:55 -0400	[thread overview]
Message-ID: <20080708132855.GB7866@redhat.com> (raw)
In-Reply-To: <1215472086.3361.297.camel@amd.troyhebe>

On Mon, Jul 07, 2008 at 05:08:06PM -0600, Bob Montgomery wrote:
> We maintain a 2.6.18 derived kernel.  
> When testing kdump on a new AMD Family 10h (16) processor, once in the
> kdump kernel, a read from either /proc/vmcore or /dev/oldmem that
> corresponds to the area of memory identified in the original (crashing)
> kernel by these boot messages:
> 
> Mapping aperture over 65536 KB of RAM @ 1c000000
> ...
> PCI-DMA: Disabling AGP.
> PCI-DMA: aperture base @ 1c000000 size 65536 KB
> PCI-DMA: using GART IOMMU.
> 
> causes a machine check.
> 
> On a Family 15 AMD64 processor running this kernel and kdump kernel, I
> can read the areas identified as being in the aperture from the kdump
> kernel and get values, but on the new processor, reads from the kdump
> kernel that are within that address range result in the machine check:
> 
> HARDWARE ERROR
> CPU 0: Machine Check Exception:                4 Bank 4: be0000010005001b
> TSC 141bd974323de ADDR 1c000000 MISC e00c0ffe01000000
> 
> While up on the original kernel, attempts to read those locations
> from /dev/mem result in EFAULTs on both the old and new processors.
> It's just the reads from the kdump kernel's /proc/vmcore or /dev/oldmem
> that work ok on the old processor and machine check on the new one.
> 
> The output of /proc/iomem does not specifically identify the area.  It's
> just within the range of: 
> 
> 00100000-cfe4ffff : System RAM
> 
> I found code in arch/x86_64/kernel/mce.c:mce_cpu_quirks() that disables
> GART TBL walk errors to prevent machine checks.  The code checked for
> family 15 and so I added family 16 as well.  Here is a patch that fixes
> my version of the kernel:
> 
> --- linux-source-2.6.18-kdump/arch/x86_64/kernel/mce.c.orig	2008-07-02 09:27:39.000000000 -0600
> +++ linux-source-2.6.18-kdump/arch/x86_64/kernel/mce.c	2008-07-02 09:28:45.000000000 -0600
> @@ -354,7 +354,8 @@ static void mce_init(void *dummy)
>  static void __cpuinit mce_cpu_quirks(struct cpuinfo_x86 *c)
>  { 
>  	/* This should be disabled by the BIOS, but isn't always */
> -	if (c->x86_vendor == X86_VENDOR_AMD && c->x86 == 15) {
> +	if (c->x86_vendor == X86_VENDOR_AMD && 
> +			((c->x86 == 15) || (c->x86 == 16))) {
>  		/* disable GART TBL walk error reporting, which trips off 
>  		   incorrectly with the IOMMU & 3ware & Cerberus. */
>  		clear_bit(10, &bank[4]);
> 
> 
Hi Bob,

I am not sure what's happening here. Because in /proc/iomem, GART reserved
area is reported as System RAM, kdump kernel will try to read this area
and save it. Now I am not sure, what is so special about this area that
mapping it and reading it in second kernel would cause a MCE.

CCing it to LKML, hoping people knowing GART will be able to provide some
input.

> But I don't see this fix upstream in the kernel.  So I'm wondering if
> some other patch protects other kdump kernels from this problem.  In
> particular, a recent patch that informed the e820 map about the gart
> aperture to prevent a normal kernel and a kexec kernel from putting it
> at different addresses.  It didn't mention machine checks from kdump
> kernels, but I wonder if it would have prevented access to that memory
> area by having it be excluded from the /proc/vmcore list of areas??

Can you provide a link to the patch above? If /proc/iomem, does not report
GART area as system ram then it will be excluded from the dump. (IIUC,
IOMMU tables are in GART area and ideally one should be capturing it to 
find out how IOMMU tables looked like at the time of crash).

Thanks
Vivek

_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec

WARNING: multiple messages have this Message-ID (diff)
From: Vivek Goyal <vgoyal@redhat.com>
To: Bob Montgomery <bob.montgomery@hp.com>
Cc: "kexec@lists.infradead.org" <kexec@lists.infradead.org>,
	Andi Kleen <ak@suse.de>, Dave Jones <rhkernel-list@redhat.com>,
	airlied@linux.ie,
	linux kernel mailing list <linux-kernel@vger.kernel.org>
Subject: Re: AMD Family 10H machine check on vmcore read
Date: Tue, 8 Jul 2008 09:28:55 -0400	[thread overview]
Message-ID: <20080708132855.GB7866@redhat.com> (raw)
In-Reply-To: <1215472086.3361.297.camel@amd.troyhebe>

On Mon, Jul 07, 2008 at 05:08:06PM -0600, Bob Montgomery wrote:
> We maintain a 2.6.18 derived kernel.  
> When testing kdump on a new AMD Family 10h (16) processor, once in the
> kdump kernel, a read from either /proc/vmcore or /dev/oldmem that
> corresponds to the area of memory identified in the original (crashing)
> kernel by these boot messages:
> 
> Mapping aperture over 65536 KB of RAM @ 1c000000
> ...
> PCI-DMA: Disabling AGP.
> PCI-DMA: aperture base @ 1c000000 size 65536 KB
> PCI-DMA: using GART IOMMU.
> 
> causes a machine check.
> 
> On a Family 15 AMD64 processor running this kernel and kdump kernel, I
> can read the areas identified as being in the aperture from the kdump
> kernel and get values, but on the new processor, reads from the kdump
> kernel that are within that address range result in the machine check:
> 
> HARDWARE ERROR
> CPU 0: Machine Check Exception:                4 Bank 4: be0000010005001b
> TSC 141bd974323de ADDR 1c000000 MISC e00c0ffe01000000
> 
> While up on the original kernel, attempts to read those locations
> from /dev/mem result in EFAULTs on both the old and new processors.
> It's just the reads from the kdump kernel's /proc/vmcore or /dev/oldmem
> that work ok on the old processor and machine check on the new one.
> 
> The output of /proc/iomem does not specifically identify the area.  It's
> just within the range of: 
> 
> 00100000-cfe4ffff : System RAM
> 
> I found code in arch/x86_64/kernel/mce.c:mce_cpu_quirks() that disables
> GART TBL walk errors to prevent machine checks.  The code checked for
> family 15 and so I added family 16 as well.  Here is a patch that fixes
> my version of the kernel:
> 
> --- linux-source-2.6.18-kdump/arch/x86_64/kernel/mce.c.orig	2008-07-02 09:27:39.000000000 -0600
> +++ linux-source-2.6.18-kdump/arch/x86_64/kernel/mce.c	2008-07-02 09:28:45.000000000 -0600
> @@ -354,7 +354,8 @@ static void mce_init(void *dummy)
>  static void __cpuinit mce_cpu_quirks(struct cpuinfo_x86 *c)
>  { 
>  	/* This should be disabled by the BIOS, but isn't always */
> -	if (c->x86_vendor == X86_VENDOR_AMD && c->x86 == 15) {
> +	if (c->x86_vendor == X86_VENDOR_AMD && 
> +			((c->x86 == 15) || (c->x86 == 16))) {
>  		/* disable GART TBL walk error reporting, which trips off 
>  		   incorrectly with the IOMMU & 3ware & Cerberus. */
>  		clear_bit(10, &bank[4]);
> 
> 
Hi Bob,

I am not sure what's happening here. Because in /proc/iomem, GART reserved
area is reported as System RAM, kdump kernel will try to read this area
and save it. Now I am not sure, what is so special about this area that
mapping it and reading it in second kernel would cause a MCE.

CCing it to LKML, hoping people knowing GART will be able to provide some
input.

> But I don't see this fix upstream in the kernel.  So I'm wondering if
> some other patch protects other kdump kernels from this problem.  In
> particular, a recent patch that informed the e820 map about the gart
> aperture to prevent a normal kernel and a kexec kernel from putting it
> at different addresses.  It didn't mention machine checks from kdump
> kernels, but I wonder if it would have prevented access to that memory
> area by having it be excluded from the /proc/vmcore list of areas??

Can you provide a link to the patch above? If /proc/iomem, does not report
GART area as system ram then it will be excluded from the dump. (IIUC,
IOMMU tables are in GART area and ideally one should be capturing it to 
find out how IOMMU tables looked like at the time of crash).

Thanks
Vivek

  reply	other threads:[~2008-07-08 13:29 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-07-07 23:08 AMD Family 10H machine check on vmcore read Bob Montgomery
2008-07-08 13:28 ` Vivek Goyal [this message]
2008-07-08 13:28   ` Vivek Goyal
2008-07-09 17:32   ` Bob Montgomery
2008-07-09 17:32     ` Bob Montgomery
2008-07-11 20:50     ` Vivek Goyal
2008-07-11 20:50       ` Vivek Goyal
2008-07-11 21:13       ` Yinghai Lu
2008-07-11 21:13         ` Yinghai Lu

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=20080708132855.GB7866@redhat.com \
    --to=vgoyal@redhat.com \
    --cc=airlied@linux.ie \
    --cc=ak@suse.de \
    --cc=bob.montgomery@hp.com \
    --cc=kexec@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rhkernel-list@redhat.com \
    /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.