Re: [PATCH] x86_64: setup saved_max_pfn correctly (kdump)



On Thu, Nov 02, 2006 at 10:19:34PM +0900, Magnus Damm wrote:
x86_64: setup saved_max_pfn correctly

2.6.19-rc4 has broken CONFIG_CRASH_DUMP support on x86_64. It is impossible
to read out the kernel contents from /proc/vmcore because saved_max_pfn is set
to zero instead of the max_pfn value before the user map is setup.

This happens because saved_max_pfn is initialized at parse_early_param() time,
and at this time no active regions have been registered. save_max_pfn is setup
from e820_end_of_ram(), more exact find_max_pfn_with_active_regions() which
returns 0 because no regions exist.

This patch fixes this by registering before and removing after the call
to e820_end_of_ram().

Signed-off-by: Magnus Damm <magnus@xxxxxxxxxxxxx>
---

Applies to 2.6.19-rc4.

arch/x86_64/kernel/e820.c | 2 ++
1 file changed, 2 insertions(+)

--- 0002/arch/x86_64/kernel/e820.c
+++ work/arch/x86_64/kernel/e820.c 2006-11-02 21:37:19.000000000 +0900
@@ -594,7 +594,9 @@ static int __init parse_memmap_opt(char
* size before original memory map is
* reset.
*/
+ e820_register_active_regions(0, 0, -1UL);
saved_max_pfn = e820_end_of_ram();
+ remove_all_active_ranges();
#endif
end_pfn_map = 0;
e820.nr_map = 0;

This looks fine to me for the time being.

Down the line I am thinking that how about passing saved_max_pfn as
command line parameter. I think that way we don't have to pass all the
memmap= options to second kernel and kexec-tools can pass the memory map
through parameter segment. This memory map can be modified to represent
only the memory which can be used by second kernel and not the whole of
the memory.

I think this will simplify the logic and also save us precious comand
line in second kernel for kdump purposes.

Thanks
Vivek



-
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/



Relevant Pages

  • Re: GPS
    ... Buy a SysOnChip CF 1GB Memory GPS with SiRF Star III. ... Buy an OS mapping system of your choice, eg Memory Map. ... especially at lower speeds. ...
    (uk.rec.waterways)
  • Re: Road Angel Navigator / Satmap Active 10 - Any opinions?
    ... on-screen OS map. ... anyone have any opinions for or against? ... To combat this I have an external battery too, but this then of course means ... your PC was not available and it will not use Memory Map or similar so you ...
    (uk.rec.walking)
  • Re-installing Garmin City Select - Will I still have the second registering?
    ... I can use it with the MapSource, and I can upload maps to my GPS). ... the map SW allows two registering. ... I did the registering quite some time ago, so I cannot remember all the details, though. ... That includes USB driver, MapSource app, City Select maps, and the registering of the maps. ...
    (sci.geo.satellite-nav)
  • 19851c58e68 breaks spacecom1 board
    ... registering sa1111 interrupts over those at zero, ... Map the whole region. ...
    (Linux-Kernel)
  • memmapfile NFS wont update file
    ... I am new to memory mapping and am trying to use memory maps as a way ... write the file, then map it, read it, change it, clear the map, ... So it seems that when I edit the file through the memory map on the ... eventually get written to the disk but in the several hours that I've ...
    (comp.soft-sys.matlab)