mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2025-01-21 09:08:45 +07:00
powerpc/pseries: Export maximum memory value
This patch exports the maximum possible amount of memory configured on the system via /proc/powerpc/lparcfg. Signed-off-by: Aravinda Prasad <aravinda@linux.vnet.ibm.com> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
This commit is contained in:
parent
709cf19c57
commit
772b039fd9
@ -26,6 +26,7 @@
|
||||
#include <linux/seq_file.h>
|
||||
#include <linux/slab.h>
|
||||
#include <linux/uaccess.h>
|
||||
#include <linux/hugetlb.h>
|
||||
#include <asm/lppaca.h>
|
||||
#include <asm/hvcall.h>
|
||||
#include <asm/firmware.h>
|
||||
@ -36,6 +37,7 @@
|
||||
#include <asm/vio.h>
|
||||
#include <asm/mmu.h>
|
||||
#include <asm/machdep.h>
|
||||
#include <asm/drmem.h>
|
||||
|
||||
#include "pseries.h"
|
||||
|
||||
@ -433,6 +435,16 @@ static void parse_em_data(struct seq_file *m)
|
||||
seq_printf(m, "power_mode_data=%016lx\n", retbuf[0]);
|
||||
}
|
||||
|
||||
static void maxmem_data(struct seq_file *m)
|
||||
{
|
||||
unsigned long maxmem = 0;
|
||||
|
||||
maxmem += drmem_info->n_lmbs * drmem_info->lmb_size;
|
||||
maxmem += hugetlb_total_pages() * PAGE_SIZE;
|
||||
|
||||
seq_printf(m, "MaxMem=%ld\n", maxmem);
|
||||
}
|
||||
|
||||
static int pseries_lparcfg_data(struct seq_file *m, void *v)
|
||||
{
|
||||
int partition_potential_processors;
|
||||
@ -491,6 +503,7 @@ static int pseries_lparcfg_data(struct seq_file *m, void *v)
|
||||
seq_printf(m, "slb_size=%d\n", mmu_slb_size);
|
||||
#endif
|
||||
parse_em_data(m);
|
||||
maxmem_data(m);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user