kexec, x86: Need a new e820 type support for kexec
Subsystems (2)
Hello,
ACPI 6.0 defines a new type in e820, AddressRangePersistentMemory (7), for NVDIMM. On a system with NVDIMM, kexec displays the following error message and sets it to RANGE_RESERVED as the fallback type.
Unknown type (Persistent Memory) while parsing /sys/firmware/memmap/34/type. Please report this as bug. Using RANGE_RESERVED now.
This new type is defined in "arch/x86/include/uapi/asm/e820.h" in 4.2-rc1 as follows.
#define E820_PMEM 7
kexec needs to know this new type, but I think its build env includes "/usr/include/asm/e820.h", which is provided by a distribution. On Fedora 22, kernel-headers-4.0.6-300.fc22.x86_64 is the latest kernel header package and it will take a while for 4.2 headers.
How do we handle such kernel header dependency in the kexec build env?
Thanks,
-Toshi
_______________________________________________
kexec mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/kexec
Quoted 6 lines · Toshi Kani
Hello,
ACPI 6.0 defines a new type in e820, AddressRangePersistentMemory (7), for NVDIMM. On a system with NVDIMM, kexec displays the following error message and sets it to
RANGE_RESERVEDas the fallback type.
Quoted 8 lines
Unknown type (Persistent Memory) while parsing
/sys/firmware/memmap/34/type. Please report this as bug. UsingRANGE_RESERVEDnow.This new type is defined in "
arch/x86/include/uapi/asm/e820.h" in 4.2-rc1 as follows.#define E820_PMEM 7
It need be added in struct e820entry:include/x86/x86-linux.h and memory_range:kexec/kexec.h and their related handling. Could you give more details about this memory type? I downloaded a ACPI 6.0 spec but am not familiar with this.
Quoted 18 lines
kexec needs to know this new type, but I think its build env includes "
/usr/include/asm/e820.h", which is provided by a distribution. On Fedora 22, kernel-headers-4.0.6-300.fc22.x86_64 is the latest kernel header package and it will take a while for 4.2 headers.How do we handle such kernel header dependency in the kexec build env?
Thanks,
-Toshi
Quoted 4 lines
_______________________________________________
kexec mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/kexec
_______________________________________________
kexec mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/kexec
Quoted 7 lines · Baoquan He
Quoted 6 lines · Toshi Kani
Hello,
ACPI 6.0 defines a new type in e820, AddressRangePersistentMemory (7), for NVDIMM. On a system with NVDIMM, kexec displays the following error message and sets it to
RANGE_RESERVEDas the fallback type.
Quoted 8 lines
Quoted 8 lines
Unknown type (Persistent Memory) while parsing
/sys/firmware/memmap/34/type. Please report this as bug. UsingRANGE_RESERVEDnow.This new type is defined in "
arch/x86/include/uapi/asm/e820.h" in 4.2-rc1 as follows.#define E820_PMEM 7
Let me check this and try to make a patch, it may need your help to test it.
Quoted 29 lines
It need be added in struct e820entry:include/x86/x86-linux.h and memory_range:kexec/kexec.h and their related handling. Could you give more details about this memory type? I downloaded a ACPI 6.0 spec but am not familiar with this.
Quoted 18 lines
kexec needs to know this new type, but I think its build env includes "
/usr/include/asm/e820.h", which is provided by a distribution. On Fedora 22, kernel-headers-4.0.6-300.fc22.x86_64 is the latest kernel header package and it will take a while for 4.2 headers.How do we handle such kernel header dependency in the kexec build env?
Thanks,
-ToshiQuoted 4 lines
_______________________________________________
kexec mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/kexec
Quoted 4 lines
_______________________________________________
kexec mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/kexec
_______________________________________________
kexec mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/kexec
Quoted 13 lines · Baoquan He
Quoted 12 lines · Baoquan He
Quoted 11 lines · Toshi Kani
Hello,
ACPI 6.0 defines a new type in e820, AddressRangePersistentMemory (7), for
NVDIMM. On a system with NVDIMM, kexec displays the following error message and sets it toRANGE_RESERVEDas the fallback type.Unknown type (Persistent Memory) while parsing
/sys/firmware/memmap/34/type. Please report this as bug. UsingRANGE_RESERVEDnow.
Quoted 8 lines
Quoted 5 lines
Quoted 5 lines
This new type is defined in "
arch/x86/include/uapi/asm/e820.h" in 4.2 -rc1
as follows.#define E820_PMEM 7Let me check this and try to make a patch, it may need your help to test it.
Great! Yes, I'd be glad to help testing your changes.
Thanks,
-Toshi
_______________________________________________
kexec mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/kexec
Quoted 16 lines · Baoquan He
Quoted 15 lines · Toshi Kani
Hello,
ACPI 6.0 defines a new type in e820, AddressRangePersistentMemory (7), for
NVDIMM. On a system with NVDIMM, kexec displays the following error message and sets it toRANGE_RESERVEDas the fallback type.Unknown type (Persistent Memory) while parsing
/sys/firmware/memmap/34/type. Please report this as bug. UsingRANGE_RESERVEDnow.This new type is defined in "
arch/x86/include/uapi/asm/e820.h" in 4.2 -rc1
as follows.
Quoted 6 lines
Quoted 1 line
#define E820_PMEM 7It need be added in struct e820entry:include/x86/x86-linux.h and memory_range:kexec/kexec.h and their related handling. Could you give more details about this memory type? I downloaded a ACPI 6.0 spec but am not familiar with this.
Oh, I see. It has a locally defined header. The e820 types are defined in Table 15-312, page 683, of ACPI 6.0.
Thanks,
-Toshi
_______________________________________________
kexec mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/kexec
Hi Toshi,
Does this patch work for you?
There are things I am not sure. When jump to kexec/kdump kernel is this PMEM still needed by system? And what's the difference between PRAM and PMEM? I saw in kernel commit ec776ef6 it introduced E820_PRAM for the non-standard protected e820 type, then in kernel commit ad5fb870 it introduced E820_PMEM for ACPI 6.0 persistent memory types. While it doesn't add complete support for E820_PMEM like E820_PRAM if I understand it correctly. In this patch I simply pass E820_PMEM to kdump kernel as E820_PRAM when it emerges since kernel can parse E820_PRAM only in parse_memmap_one(), otherwise E820_PMEM has to be discarded or need be passed as E820_RESERVED. What do you think about this, need E820_PMEM be differentiated with E820_PRAM strictly? If yes, I think a kernel patch need be posted to fix this. If not, this patch is enough for supporting both of them in kexec.
Quoted 1 line
From
032f0c2cc89d1cde6d748b2cca90ebb829b4d589Mon Sep 17 00:00:00 2001
From: Baoquan He <[email protected]>
Date: Thu, 25 Jun 2015 19:15:49 +0900
Subject: [PATCH] Add persistent memory support
Kernel add E820_PRAM or E820_PMEM type for NVDIMM memory device. Now support them in kexec too.
--- include/x86/x86-linux.h | 2 ++ kexec/arch/i386/crashdump-x86.c | 10 +++++++++- kexec/arch/i386/kexec-x86-common.c | 10 ++++++++++ kexec/arch/i386/x86-linux-setup.c | 6 ++++++ kexec/firmware_memmap.c | 4 ++++ kexec/kexec.h | 2 ++ 6 files changed, 33 insertions(+), 1 deletion(-)
include/x86/x86-linux.h +2 -0
@@ -21,6 +21,8 @@ struct e820entry {#define E820_RESERVED 2#define E820_ACPI 3/* usable as RAM once ACPI tables have been read */ #define E820_NVS 4 +#define E820_PMEM 7 +#define E820_PRAM 12 } __attribute__((packed));#endif
kexec/arch/i386/crashdump-x86.c +9 -1
@@ -301,6 +301,10 @@ static int get_crash_memory_ranges(struct memory_range **range, int *ranges, type =RANGE_ACPI ; }else if (memcmp (str,"ACPI Non-volatile Storage\n" ,26 ) ==0 ) { type =RANGE_ACPI_NVS ; + }else if (memcmp (str,"Persistent Memory (legacy)\n" ,27 ) ==0 ) { + type =RANGE_PRAM ; + }else if (memcmp (str,"Persistent Memory\n" ,18 ) ==0 ) { + type =RANGE_PMEM ; }else if (memcmp (str,"reserved\n" ,9 ) ==0 ) { type =RANGE_RESERVED ; }else if (memcmp (str,"GART\n" ,5 ) ==0 ) {
@@ -640,6 +644,8 @@ static void cmdline_add_memmap_internal(char *cmdline, unsigned long startk,strcat (str_mmap,"K$" ); else if (type == RANGE_ACPI || type == RANGE_ACPI_NVS) strcat (str_mmap, "K#"); + else if (type == RANGE_PMEM || type == RANGE_PRAM) + strcat (str_mmap, "K!"); ultoa(startk, str_tmp); strcat (str_mmap, str_tmp);
@@ -997,7 +1003,9 @@ int load_crashdump_segments(struct kexec_info *info, char* mod_cmdline,unsigned long start, end, size, type;if ( !( mem_range[i].type ==RANGE_ACPI || mem_range[i].type ==RANGE_ACPI_NVS - || mem_range[i].type ==RANGE_RESERVED )) + || mem_range[i].type ==RANGE_RESERVED + || mem_range[i].type ==RANGE_PMEM + || mem_range[i].type ==RANGE_PRAM ))continue ; start = mem_range[i].start; end = mem_range[i].end;
kexec/arch/i386/kexec-x86-common.c +10 -0
@@ -94,6 +94,12 @@ static int get_memory_ranges_proc_iomem(struct memory_range **range, int *rangeselse if (memcmp (str,"ACPI Non-volatile Storage\n" ,26 ) ==0 ) { type =RANGE_ACPI_NVS ; } +else if (memcmp (str,"Persistent Memory (legacy)\n" ,27 ) ==0 ) { + type =RANGE_ACPI_NVS ; + } +else if (memcmp (str,"Persistent Memory\n" ,18 ) ==0 ) { + type =RANGE_ACPI_NVS ; + }else {continue ; }
@@ -149,6 +155,10 @@ unsigned xen_e820_to_kexec_type(uint32_t type)return RANGE_ACPI ;case E820_NVS :return RANGE_ACPI_NVS ; +case E820_PMEM : +return RANGE_PMEM ; +case E820_PRAM : +return RANGE_PRAM ;case E820_RESERVED :default :return RANGE_RESERVED ;
kexec/arch/i386/x86-linux-setup.c +6 -0
@@ -705,6 +705,12 @@ static void add_e820_map_from_mr(struct x86_linux_param_header *real_mode,case RANGE_ACPI_NVS : e820[i].type =E820_NVS ;break ; +case RANGE_PMEM : + e820[i].type =E820_PMEM ; +break ; +case RANGE_PRAM : + e820[i].type =E820_PRAM ; +break ;default :case RANGE_RESERVED : e820[i].type =E820_RESERVED ;
kexec/firmware_memmap.c +4 -0
@@ -168,6 +168,10 @@ static int parse_memmap_entry(const char *entry, struct memory_range *range) range->type =RANGE_ACPI_NVS ; else if (strcmp(type, "Uncached RAM") == 0) range->type = RANGE_UNCACHED; + else if (strcmp(type, "Persistent Memory (legacy)") == 0) + range->type = RANGE_PRAM; + else if (strcmp(type, "Persistent Memory") == 0) + range->type = RANGE_PMEM; else { fprintf(stderr, "Unknown type (%s) while parsing %s. Please " "report this as bug. Using RANGE_RESERVED now.\n",
kexec/kexec.h +2 -0
@@ -136,6 +136,8 @@ struct memory_range {#define RANGE_ACPI 2#define RANGE_ACPI_NVS 3#define RANGE_UNCACHED 4 +#define RANGE_PMEM 6 +#define RANGE_PRAM 11 };struct memory_ranges {
Signature · 1 line
2.1.0
Toshi Kani
Tested-byQuoted 3 lines · Baoquan He
Hi Toshi,
Does this patch work for you?
Hi Baoquan,
I have tested the patch with both E820_PMEM and E820_PRAM setups, and confirmed it works fine for both cases. :-) I did multiple kexec reboots followed by a kdump in my testing. So, please feel free to add:
Quoted 2 lines
There are things I am not sure. When jump to kexec/kdump kernel is this PMEM still needed by system?
Yes, after a kexec reboot, the kernel needs to be able to use NVDIMM as before. While the kernel actually uses NFIT table, not e820, the range should be marked as PMEM for consistency. The same goes to kdump kernel since NVDIMM may be used as a dump device in future.
Quoted 6 lines
And what's the difference between PRAM and
PMEM? I saw in kernel commitec776ef6it introducedE820_PRAMfor the non-standard protected e820 type, then in kernel commitad5fb870it introducedE820_PMEMfor ACPI 6.0 persistent memory types. While it doesn't add complete support forE820_PMEMlikeE820_PRAMif I understand it correctly.
ACPI 6.0 spec defines E820_PMEM, which is used for NVDIMM devices from now on. ACPI 6.0 also defines NFIT table for NVDIMM along with this type.
Before these are defined in ACPI, E820_PRAM type was "unofficially" used by some NVDIMM devices. So, E820_PRAM was added for such legacy NVDIMMs.
Since the E820_PRAM case is very simple (it does not have any other FW
tables), it can be easily emulated with the "memmap=nn!ss" option. So, people may use the memmap option to emulate this legacy NVDIMM.
Quoted 7 lines
In this patch I simply pass
E820_PMEMto kdump
kernel asE820_PRAMwhen it emerges since kernel can parseE820_PRAMonly inparse_memmap_one(), otherwiseE820_PMEMhas to be discarded or need be passed asE820_RESERVED. What do you think about this, needE820_PMEMbe differentiated withE820_PRAMstrictly? If yes, I think a kernel patch need be posted to fix this. If not, this patch is enough for supporting both of them in kexec.
E820_PMEM cannot be emulated by the "memmap=" option. Do you have to use the "memmap=" options to pass the ranges for kdump kernel? If so, I'd rather ignore E820_PMEM and let it be passed as E820_RESERVED. The kdump kernel can still obtain the info from NFIT if necessary.
As for the code change...
kexec/arch/i386/crashdump-x86.c static void cmdline_add_memmap_internal(char *cmdline, · line 649
Quoted 7 lines
kexec/arch/i386/crashdump-x86.c +2
-0@@ -640,6 +644,8 @@ static void cmdline_add_memmap_internal(char *cmdline,unsigned long startk, strcat (str_mmap, "K$"); else if (type == RANGE_ACPI || type == RANGE_ACPI_NVS) strcat (str_mmap, "K#"); + else if (type == RANGE_PMEM || type == RANGE_PRAM) + strcat (str_mmap, "K!");
It should only check with RANGE_PRAM, but I do not think this change matters much unless you also modify the caller cmdline_add_memmap(), which has the following check to skip other types. I do not think we will use legacy NVDIMM device as a dump device, so you may ignore RANGE_PRAM and let it be passed as RESERVED as well (which is likely the case I tested with).
/* Only adding memory regions of RAM and ACPI */
if (type != RANGE_RAM &&
type != RANGE_ACPI &&
type != RANGE_ACPI_NVS)
continue;Thanks,
-Toshi
Hi Toshi,
Sorry for replying late.
Quoted 5 lines · Toshi Kani
Quoted 3 lines · Baoquan He
Hi Toshi,
Does this patch work for you?
Quoted 7 lines
Hi Baoquan,
I have tested the patch with both
E820_PMEMandE820_PRAMsetups, and confirmed it works fine for both cases. :-) I did multiple kexec reboots followed by a kdump in my testing. So, please feel free to add:Tested-by Toshi Kani <[email protected]>
Thanks for testing, I will repost with Tested-by info.
Quoted 16 lines
Quoted 3 lines
There are things I am not sure. When jump to kexec/kdump kernel is this PMEM still needed by system?
Yes, after a kexec reboot, the kernel needs to be able to use NVDIMM as before. While the kernel actually uses NFIT table, not e820, the range should be marked as PMEM for consistency. The same goes to kdump kernel since NVDIMM may be used as a dump device in future.
Quoted 6 lines
And what's the difference between PRAM and
PMEM? I saw in kernel commitec776ef6it introducedE820_PRAMfor the non-standard protected e820 type, then in kernel commitad5fb870it introducedE820_PMEMfor ACPI 6.0 persistent memory types. While it doesn't add complete support forE820_PMEMlikeE820_PRAMif I understand it correctly.
Quoted 8 lines
ACPI 6.0 spec defines
E820_PMEM, which is used for NVDIMM devices from now on. ACPI 6.0 also defines NFIT table for NVDIMM along with this type.Before these are defined in ACPI,
E820_PRAMtype was "unofficially" used by some NVDIMM devices. So,E820_PRAMwas added for such legacy NVDIMMs.
Since theE820_PRAMcase is very simple (it does not have any other FW
tables), it can be easily emulated with the "memmap=nn!ss" option. So, people may use the memmap option to emulate this legacy NVDIMM.
I was wrong. In fact in kexec-tools memory info can be passed to kdump kernel by 2 ways. One is using memmap by specifying --pass-memmap-cmdline. The other one is storing memory regions in e820_map of real mode data structure by default. And the 1st way is rarely used. So no need to worry about the "memmap=nn!ss" option.
Since kernel parse_memmap_one doesn't support E820_PMEM well, I would like to ignore the PMEM adding in memmap way. So this patch is enough.
Quoted 30 lines
Quoted 8 lines
In this patch I simply pass
E820_PMEMto kdump
kernel asE820_PRAMwhen it emerges since kernel can parseE820_PRAMonly inparse_memmap_one(), otherwiseE820_PMEMhas to be discarded or need be passed asE820_RESERVED. What do you think about this, needE820_PMEMbe differentiated withE820_PRAMstrictly? If yes, I think a kernel patch need be posted to fix this. If not, this patch is enough for supporting both of them in kexec.
E820_PMEMcannot be emulated by the "memmap=" option. Do you have to use the "memmap=" options to pass the ranges for kdump kernel? If so, I'd rather ignoreE820_PMEMand let it be passed asE820_RESERVED. The kdump kernel can still obtain the info from NFIT if necessary.As for the code change...
kexec/arch/i386/crashdump-x86.c static void cmdline_add_memmap_internal(char *cmdline, · line 649
Quoted 7 lines
kexec/arch/i386/crashdump-x86.c +2
-0@@ -640,6 +644,8 @@ static void cmdline_add_memmap_internal(char *cmdline,unsigned long startk, strcat (str_mmap, "K$"); else if (type == RANGE_ACPI || type == RANGE_ACPI_NVS) strcat (str_mmap, "K#"); + else if (type == RANGE_PMEM || type == RANGE_PRAM) + strcat (str_mmap, "K!");It should only check with
RANGE_PRAM, but I do not think this change matters much unless you also modify the callercmdline_add_memmap(), which has the following check to skip other types. I do not think we will use legacy NVDIMM device as a dump device, so you may ignoreRANGE_PRAMand let it be passed as RESERVED as well (which is likely the case I tested with).
Quoted 5 lines
/* Only adding memory regions of RAM and ACPI */
if (type != RANGE_RAM &&
type != RANGE_ACPI &&
type != RANGE_ACPI_NVS)
continue;Then if ignore PMEM adding into memmap, cmdline_add_memmap need not be cared any more.
Thanks
Baoquan
Quoted 49 lines · Baoquan He
Hi Toshi,
Sorry for replying late.
Quoted 5 lines · Toshi Kani
Quoted 3 lines · Baoquan He
Hi Toshi,
Does this patch work for you?
Quoted 8 lines
Hi Baoquan,
I have tested the patch with both
E820_PMEMandE820_PRAMsetups, and confirmed it works fine for both cases. :-) I did multiple kexec reboots
followed by a kdump in my testing. So, please feel free to add:Tested-by Toshi Kani <[email protected]>Thanks for testing, I will repost with Tested-by info.
Quoted 21 lines
Quoted 4 lines
There are things I am not sure. When jump to kexec/kdump kernel is this
PMEM still needed by system?Yes, after a kexec reboot, the kernel needs to be able to use NVDIMM as before. While the kernel actually uses NFIT table, not e820, the range should be marked as PMEM for consistency. The same goes to kdump kernel since NVDIMM may be used as a dump device in future.
Quoted 6 lines
And what's the difference between PRAM and
PMEM? I saw in kernel commitec776ef6it introducedE820_PRAMfor the non-standard protected e820 type, then in kernel commitad5fb870it introducedE820_PMEMfor ACPI 6.0 persistent memory types. While it doesn't add complete support forE820_PMEMlikeE820_PRAMif I understand it correctly.ACPI 6.0 spec defines
E820_PMEM, which is used for NVDIMM devices from now
on. ACPI 6.0 also defines NFIT table for NVDIMM along with this type.Quoted 6 lines
Before these are defined in ACPI,
E820_PRAMtype was "unofficially" used by
some NVDIMM devices. So,E820_PRAMwas added for such legacy NVDIMMs.
Since theE820_PRAMcase is very simple (it does not have any other FW
tables), it can be easily emulated with the "memmap=nn!ss" option. So, people may use the memmap option to emulate this legacy NVDIMM.
Quoted 8 lines
I was wrong. In fact in kexec-tools memory info can be passed to kdump kernel by 2 ways. One is using memmap by specifying --pass-memmap-cmdline. The other one is storing memory regions in
e820_mapof real mode data structure by default. And the 1st way is rarely used. So no need to worry about the "memmap=nn!ss" option.Since kernel
parse_memmap_onedoesn't supportE820_PMEMwell, I would like to ignore the PMEM adding in memmap way. So this patch is enough.
Yes, that is fine.
Quoted 30 lines
Quoted 30 lines
Quoted 7 lines
In this patch I simply pass
E820_PMEMto kdump
kernel asE820_PRAMwhen it emerges since kernel can parseE820_PRAMonly inparse_memmap_one(), otherwiseE820_PMEMhas to be discarded or need be passed asE820_RESERVED. What do you think about this, needE820_PMEMbe differentiated withE820_PRAMstrictly? If yes, I think a kernel patch need be posted to fix this. If not, this patch is enough for supporting both of them in kexec.
E820_PMEMcannot be emulated by the "memmap=" option. Do you have to use the "memmap=" options to pass the ranges for kdump kernel? If so, I'd rather ignoreE820_PMEMand let it be passed asE820_RESERVED. The kdump kernel can still obtain the info from NFIT if necessary.As for the code change...
kexec/arch/i386/crashdump-x86.c static void cmdline_add_memmap_internal(char · line 650
Quoted 8 lines
kexec/arch/i386/crashdump-x86.c +2
-0@@ -640,6 +644,8 @@ static void cmdline_add_memmap_internal(char *cmdline, unsigned long startk,strcat (str_mmap,"K$" ); else if (type == RANGE_ACPI || type == RANGE_ACPI_NVS) strcat (str_mmap, "K#"); + else if (type == RANGE_PMEM || type == RANGE_PRAM) + strcat (str_mmap, "K!");It should only check with
RANGE_PRAM, but I do not think this change
matters much unless you also modify the callercmdline_add_memmap(),
which has the following check to skip other types. I do not think we
will use legacy NVDIMM device as a dump device, so you may ignoreRANGE_PRAMand let it be passed as RESERVED as well (which is likely the > > case I tested with).
Quoted 8 lines
Quoted 5 lines
/* Only adding memory regions of RAM and ACPI */ if (type != RANGE_RAM && type != RANGE_ACPI && type != RANGE_ACPI_NVS) continue;Then if ignore PMEM adding into memmap,
cmdline_add_memmapneed not be cared any more.
Sounds good.
Thanks,
-Toshi
Quoted 8 lines · Toshi Kani
On Thu, 2015-08-06 at 16:12 +0800, Baoquan He wrote:
E820_PMEMcannot be emulated by the "memmap=" option. Do you have to use the "memmap=" options to pass the ranges for kdump kernel? If so, I'd rather ignoreE820_PMEMand let it be passed asE820_RESERVED. The kdump kernel can still obtain the info from NFIT if necessary.As for the code change...
Quoted 13 lines
kexec/arch/i386/crashdump-x86.c static void cmdline_add_memmap_internal(char *cmdline, · line 649
Quoted 7 lines
kexec/arch/i386/crashdump-x86.c +2
-0@@ -640,6 +644,8 @@ static void cmdline_add_memmap_internal(char *cmdline,unsigned long startk, strcat (str_mmap, "K$"); else if (type == RANGE_ACPI || type == RANGE_ACPI_NVS) strcat (str_mmap, "K#"); + else if (type == RANGE_PMEM || type == RANGE_PRAM) + strcat (str_mmap, "K!");It should only check with
RANGE_PRAM, but I do not think this change matters much unless you also modify the callercmdline_add_memmap(), which has the following check to skip other types. I do not think we will use legacy NVDIMM device as a dump device, so you may ignoreRANGE_PRAMand let it be passed as RESERVED as well (which is likely the case I tested with).
Rethink it again, maybe it's better to pass PMEM as PRAM to kdump kernel if user really want to use memmap way by specifying --pass-memmap-cmdline. Then I need add the PMEM and PRAM checking here you pointed out. Will repost with them.
Quoted 7 lines
/* Only adding memory regions of RAM and ACPI */
if (type != RANGE_RAM &&
type != RANGE_ACPI &&
type != RANGE_ACPI_NVS)
continue;Quoted 25 lines · Baoquan He
Quoted 8 lines · Toshi Kani
On Thu, 2015-08-06 at 16:12 +0800, Baoquan He wrote:
E820_PMEMcannot be emulated by the "memmap=" option. Do you have to use the "memmap=" options to pass the ranges for kdump kernel? If so, I'd rather ignoreE820_PMEMand let it be passed asE820_RESERVED. The kdump kernel can still obtain the info from NFIT if necessary.As for the code change...
Quoted 15 lines
kexec/arch/i386/crashdump-x86.c static void cmdline_add_memmap_internal(char · line 650
Quoted 8 lines
kexec/arch/i386/crashdump-x86.c +2
-0@@ -640,6 +644,8 @@ static void cmdline_add_memmap_internal(char *cmdline, unsigned long startk,strcat (str_mmap,"K$" ); else if (type == RANGE_ACPI || type == RANGE_ACPI_NVS) strcat (str_mmap, "K#"); + else if (type == RANGE_PMEM || type == RANGE_PRAM) + strcat (str_mmap, "K!");It should only check with
RANGE_PRAM, but I do not think this change matters much unless you also modify the callercmdline_add_memmap(), which has the following check to skip other types. I do not think we will use legacy NVDIMM device as a dump device, so you may ignoreRANGE_PRAMand let it be passed as RESERVED as well (which is likely the case I tested with).
Quoted 4 lines
Rethink it again, maybe it's better to pass PMEM as PRAM to kdump kernel if user really want to use memmap way by specifying --pass-memmap-cmdline. Then I need add the PMEM and PRAM checking here you pointed out. Will repost with them.
No, you should not report PMEM as PRAM. They are different things. The kdump kernel does not need to support memmap cmdline for PMEM, as the regular kernel does not -- memmap cmdline cannot emulate PMEM.
Thanks,
-Toshi
Quoted 10 lines
Quoted 9 lines
/* Only adding memory regions of RAM and ACPI */ if (type != RANGE_RAM && type != RANGE_ACPI && type != RANGE_ACPI_NVS) continue;
Quoted 9 lines · Toshi Kani
Quoted 4 lines · Baoquan He
Rethink it again, maybe it's better to pass PMEM as PRAM to kdump kernel if user really want to use memmap way by specifying --pass-memmap-cmdline. Then I need add the PMEM and PRAM checking here you pointed out. Will repost with them.
No, you should not report PMEM as PRAM. They are different things. The kdump kernel does not need to support memmap cmdline for PMEM, as the regular kernel does not -- memmap cmdline cannot emulate PMEM.
OK. Then it will be wrong if people intend to specify --pass-memmap-cmdline. There might be 3 ways to fix this:
1) add PMEM support in kernel. memmap cmdline is not only used for emulating, but for kexec/kdump using.
2) Delete --pass-memmap-cmdline option in kexec-tools since people rarely use it.
3) Add a note in kexec-tools that option --pass-memmap-cmdline can't work together with PMEM, people should not use it.
Thanks
Baoquan
Quoted 12 lines · Baoquan He
Quoted 8 lines · Toshi Kani
Quoted 4 lines · Baoquan He
Rethink it again, maybe it's better to pass PMEM as PRAM to kdump kernel if user really want to use memmap way by specifying --pass-memmap-cmdline. Then I need add the PMEM and PRAM checking here you pointed out. Will repost with them.
No, you should not report PMEM as PRAM. They are different things. The kdump kernel does not need to support memmap cmdline for PMEM, as the regular kernel does not -- memmap cmdline cannot emulate PMEM.
OK. Then it will be wrong if people intend to specify --pass-memmap-cmdline. There might be 3 ways to fix this:
Quoted 8 lines
1) add PMEM support in kernel. memmap cmdline is not only used for emulating, but for kexec/kdump using.
2) Delete --pass-memmap-cmdline option in kexec-tools since people rarely use it.
3) Add a note in kexec-tools that option --pass-memmap-cmdline can't work together with PMEM, people should not use it.
3) is fine, and I do not think we need a note either. It does not make sense to add an memmap cmdline for PMEM since PMEM ranges require ACPI NFIT table.
Thanks,
-Toshi
Quoted 19 lines · Toshi Kani
Quoted 18 lines · Baoquan He
Quoted 8 lines · Toshi Kani
Quoted 4 lines · Baoquan He
Rethink it again, maybe it's better to pass PMEM as PRAM to kdump kernel if user really want to use memmap way by specifying --pass-memmap-cmdline. Then I need add the PMEM and PRAM checking here you pointed out. Will repost with them.
No, you should not report PMEM as PRAM. They are different things. The kdump kernel does not need to support memmap cmdline for PMEM, as the regular kernel does not -- memmap cmdline cannot emulate PMEM.
OK. Then it will be wrong if people intend to specify --pass-memmap-cmdline. There might be 3 ways to fix this:
1) add PMEM support in kernel. memmap cmdline is not only used for emulating, but for kexec/kdump using.
2) Delete --pass-memmap-cmdline option in kexec-tools since people rarely use it.
Quoted 6 lines
Quoted 2 lines
3) Add a note in kexec-tools that option --pass-memmap-cmdline can't work together with PMEM, people should not use it.
3) is fine, and I do not think we need a note either. It does not make sense to add an memmap cmdline for PMEM since PMEM ranges require ACPI NFIT table.
OK, got it. Let me repost without PMEM memmap adding. In fact I am a little confused that E820_PMEM is got by EFI in linux, seems in do_add_efi_memmap() though later ACPI NFIT need be read and more information about nvdimm will be got for nvdimm device. e820 memory map need be got from uefi/bios/kexec, this doesn't conflict with ACPI NFIT processing.
Thanks
Baoquan