Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 91565
b: refs/heads/master
c: 37ddd5d
h: refs/heads/master
i:
  91563: 062b2bd
v: v3
  • Loading branch information
Manish Ahuja authored and Paul Mackerras committed Apr 16, 2008
1 parent 3d9d313 commit 961a1fc
Show file tree
Hide file tree
Showing 4 changed files with 46 additions and 4 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: af892e0f9fad390669494e389aed29b968ab7fdb
refs/heads/master: 37ddd5d053c57fee798d72fa9c18660f59a9299b
35 changes: 33 additions & 2 deletions trunk/arch/powerpc/kernel/prom.c
Original file line number Diff line number Diff line change
Expand Up @@ -1042,6 +1042,33 @@ static void __init early_reserve_mem(void)
}

#ifdef CONFIG_PHYP_DUMP
/**
* phyp_dump_calculate_reserve_size() - reserve variable boot area 5% or arg
*
* Function to find the largest size we need to reserve
* during early boot process.
*
* It either looks for boot param and returns that OR
* returns larger of 256 or 5% rounded down to multiples of 256MB.
*
*/
static inline unsigned long phyp_dump_calculate_reserve_size(void)
{
unsigned long tmp;

if (phyp_dump_info->reserve_bootvar)
return phyp_dump_info->reserve_bootvar;

/* divide by 20 to get 5% of value */
tmp = lmb_end_of_DRAM();
do_div(tmp, 20);

/* round it down in multiples of 256 */
tmp = tmp & ~0x0FFFFFFFUL;

return (tmp > PHYP_DUMP_RMR_END ? tmp : PHYP_DUMP_RMR_END);
}

/**
* phyp_dump_reserve_mem() - reserve all not-yet-dumped mmemory
*
Expand All @@ -1055,6 +1082,8 @@ static void __init early_reserve_mem(void)
static void __init phyp_dump_reserve_mem(void)
{
unsigned long base, size;
unsigned long variable_reserve_size;

if (!phyp_dump_info->phyp_dump_configured) {
printk(KERN_ERR "Phyp-dump not supported on this hardware\n");
return;
Expand All @@ -1065,9 +1094,11 @@ static void __init phyp_dump_reserve_mem(void)
return;
}

variable_reserve_size = phyp_dump_calculate_reserve_size();

if (phyp_dump_info->phyp_dump_is_active) {
/* Reserve *everything* above RMR.Area freed by userland tools*/
base = PHYP_DUMP_RMR_END;
base = variable_reserve_size;
size = lmb_end_of_DRAM() - base;

/* XXX crashed_ram_end is wrong, since it may be beyond
Expand All @@ -1079,7 +1110,7 @@ static void __init phyp_dump_reserve_mem(void)
} else {
size = phyp_dump_info->cpu_state_size +
phyp_dump_info->hpte_region_size +
PHYP_DUMP_RMR_END;
variable_reserve_size;
base = lmb_end_of_DRAM() - size;
lmb_reserve(base, size);
phyp_dump_info->init_reserve_start = base;
Expand Down
9 changes: 9 additions & 0 deletions trunk/arch/powerpc/platforms/pseries/phyp_dump.c
Original file line number Diff line number Diff line change
Expand Up @@ -496,3 +496,12 @@ static int __init early_phyp_dump_enabled(char *p)
}
early_param("phyp_dump", early_phyp_dump_enabled);

/* Look for phyp_dump_reserve_size= cmdline option */
static int __init early_phyp_dump_reserve_size(char *p)
{
if (p)
phyp_dump_info->reserve_bootvar = memparse(p, &p);

return 0;
}
early_param("phyp_dump_reserve_size", early_phyp_dump_reserve_size);
4 changes: 3 additions & 1 deletion trunk/include/asm-powerpc/phyp_dump.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,10 @@ struct phyp_dump {
/* Memory that is reserved during very early boot. */
unsigned long init_reserve_start;
unsigned long init_reserve_size;
/* Check status during boot if dump supported, active & present*/
/* cmd line options during boot */
unsigned long reserve_bootvar;
unsigned long phyp_dump_at_boot;
/* Check status during boot if dump supported, active & present*/
unsigned long phyp_dump_configured;
unsigned long phyp_dump_is_active;
/* store cpu & hpte size */
Expand Down

0 comments on commit 961a1fc

Please sign in to comment.