[PATCH] If we are doing a crash dump, we still need non-E820_RAMmemory type address information, which come from BIOS orfirmware. for example: PCI_MMCONFIG check this address.

From: jzha144
Date: Tue Oct 30 2012 - 20:51:18 EST


Signed-off-by: jzha144 <jun.zhang@xxxxxxxxx>
---
arch/x86/kernel/e820.c | 9 +++++++++
1 files changed, 9 insertions(+), 0 deletions(-)

diff --git a/arch/x86/kernel/e820.c b/arch/x86/kernel/e820.c
index df06ade..f8672d0 100644
--- a/arch/x86/kernel/e820.c
+++ b/arch/x86/kernel/e820.c
@@ -851,6 +851,15 @@ static int __init parse_memmap_opt(char *p)
* reset.
*/
saved_max_pfn = e820_end_of_ram_pfn();
+
+ /*
+ * If we are doing a crash dump, we still need non-E820_RAM
+ * memory type address information. so we only remove
+ * E820_RAM type.
+ */
+ e820_remove_range(0, ULLONG_MAX, E820_RAM, 1);
+ userdef = 1;
+ return 0;
#endif
e820.nr_map = 0;
userdef = 1;
--
1.7.6


Best Regards!

Jun Zhang
Inet: 8821-4273
Dir.Tel: 86-21-6116-4273
Email: jun.zhang@xxxxxxxxx


-----Original Message-----
From: H. Peter Anvin [mailto:hpa@xxxxxxxxx]
Sent: Wednesday, October 31, 2012 10:47 AM
To: Zhang, Jun
Cc: Thomas Gleixner; Ingo Molnar; x86@xxxxxxxxxx; Andrew Morton; Fleming, Matt; Paul Gortmaker; linux-kernel@xxxxxxxxxxxxxxx
Subject: Re: [PATCH] To crash dump, we need keep other memory type except E820_RAM, because other type come from BIOS or firmware is used by other code(for example: PCI_MMCONFIG).

On 10/30/2012 06:26 PM, Zhang, Jun wrote:
> From aebc336baa7ec2d4ccb6f21166770c7d2ee26cba Mon Sep 17 00:00:00 2001
> From: jzha144 <jun.zhang@xxxxxxxxx>
> Date: Wed, 31 Oct 2012 08:51:18 +0800
> Subject: [PATCH] To crash dump, we need keep other memory type except
> E820_RAM, because other type come from BIOS or firmware is used by
> other code(for example: PCI_MMCONFIG).

I'm sorry, I can't quite parse the description or the comment... could you clarify it a bit? I think I know what you mean, but there is clearly risk for misunderstandings.

-hpa

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/