Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 272063
b: refs/heads/master
c: dab7a7b
h: refs/heads/master
i:
  272061: cdbe6d6
  272059: ce09774
  272055: 7e8cd32
  272047: 8e86506
  272031: 70e192d
  271999: 4e30b83
v: v3
  • Loading branch information
Michael Holzheu authored and Martin Schwidefsky committed Oct 30, 2011
1 parent b8fce01 commit 85aeef4
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 5 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 558df7209e7997275f6b8ad37737494cf2da1512
refs/heads/master: dab7a7b1538fec48790a321a58180adae79a3f3c
3 changes: 3 additions & 0 deletions trunk/arch/s390/include/asm/kexec.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@
/* Allocate one page for the pdp and the second for the code */
#define KEXEC_CONTROL_PAGE_SIZE 4096

/* Alignment of crashkernel memory */
#define KEXEC_CRASH_MEM_ALIGN HPAGE_SIZE

/* The native architecture */
#define KEXEC_ARCH KEXEC_ARCH_S390

Expand Down
31 changes: 31 additions & 0 deletions trunk/arch/s390/kernel/machine_kexec.c
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,37 @@ static int kdump_csum_valid(struct kimage *image)
#endif
}

/*
* Map or unmap crashkernel memory
*/
static void crash_map_pages(int enable)
{
unsigned long size = resource_size(&crashk_res);

BUG_ON(crashk_res.start % KEXEC_CRASH_MEM_ALIGN ||
size % KEXEC_CRASH_MEM_ALIGN);
if (enable)
vmem_add_mapping(crashk_res.start, size);
else
vmem_remove_mapping(crashk_res.start, size);
}

/*
* Map crashkernel memory
*/
void crash_map_reserved_pages(void)
{
crash_map_pages(1);
}

/*
* Unmap crashkernel memory
*/
void crash_unmap_reserved_pages(void)
{
crash_map_pages(0);
}

/*
* Give back memory to hypervisor before new kdump is loaded
*/
Expand Down
10 changes: 6 additions & 4 deletions trunk/arch/s390/kernel/setup.c
Original file line number Diff line number Diff line change
Expand Up @@ -446,6 +446,7 @@ static void __init setup_resources(void)
res->flags = IORESOURCE_BUSY | IORESOURCE_MEM;
switch (memory_chunk[i].type) {
case CHUNK_READ_WRITE:
case CHUNK_CRASHK:
res->name = "System RAM";
break;
case CHUNK_READ_ONLY:
Expand Down Expand Up @@ -720,8 +721,8 @@ static void __init reserve_crashkernel(void)
&crash_base);
if (rc || crash_size == 0)
return;
crash_base = PAGE_ALIGN(crash_base);
crash_size = PAGE_ALIGN(crash_size);
crash_base = ALIGN(crash_base, KEXEC_CRASH_MEM_ALIGN);
crash_size = ALIGN(crash_size, KEXEC_CRASH_MEM_ALIGN);
if (register_memory_notifier(&kdump_mem_nb))
return;
if (!crash_base)
Expand All @@ -741,7 +742,7 @@ static void __init reserve_crashkernel(void)
crashk_res.start = crash_base;
crashk_res.end = crash_base + crash_size - 1;
insert_resource(&iomem_resource, &crashk_res);
reserve_kdump_bootmem(crash_base, crash_size, CHUNK_READ_WRITE);
reserve_kdump_bootmem(crash_base, crash_size, CHUNK_CRASHK);
pr_info("Reserving %lluMB of memory at %lluMB "
"for crashkernel (System RAM: %luMB)\n",
crash_size >> 20, crash_base >> 20, memory_end >> 20);
Expand Down Expand Up @@ -816,7 +817,8 @@ setup_memory(void)
for (i = 0; i < MEMORY_CHUNKS && memory_chunk[i].size > 0; i++) {
unsigned long start_chunk, end_chunk, pfn;

if (memory_chunk[i].type != CHUNK_READ_WRITE)
if (memory_chunk[i].type != CHUNK_READ_WRITE &&
memory_chunk[i].type != CHUNK_CRASHK)
continue;
start_chunk = PFN_DOWN(memory_chunk[i].addr);
end_chunk = start_chunk + PFN_DOWN(memory_chunk[i].size);
Expand Down

0 comments on commit 85aeef4

Please sign in to comment.