Skip to content

Commit

Permalink
powerpc/pseries: Export data from new hcall H_EM_GET_PARMS
Browse files Browse the repository at this point in the history
Add support for H_EM_GET_PARMS hcall that will return data
related to power modes from the platform.  Export the data
directly to user space for administrative tools to interpret
and use.

cat /proc/powerpc/lparcfg will export power mode data

Signed-off-by: Vaidyanathan Srinivasan <svaidy@linux.vnet.ibm.com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
  • Loading branch information
Vaidyanathan Srinivasan authored and Benjamin Herrenschmidt committed Apr 7, 2010
1 parent 9c7cc23 commit 6fe9d1f
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
1 change: 1 addition & 0 deletions arch/powerpc/include/asm/hvcall.h
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,7 @@
#define H_JOIN 0x298
#define H_VASI_STATE 0x2A4
#define H_ENABLE_CRQ 0x2B0
#define H_GET_EM_PARMS 0x2B8
#define H_SET_MPP 0x2D0
#define H_GET_MPP 0x2D4
#define MAX_HCALL_OPCODE H_GET_MPP
Expand Down
12 changes: 11 additions & 1 deletion arch/powerpc/kernel/lparcfg.c
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
#include <asm/vio.h>
#include <asm/mmu.h>

#define MODULE_VERS "1.8"
#define MODULE_VERS "1.9"
#define MODULE_NAME "lparcfg"

/* #define LPARCFG_DEBUG */
Expand Down Expand Up @@ -487,6 +487,14 @@ static void splpar_dispatch_data(struct seq_file *m)
seq_printf(m, "dispatch_dispersions=%lu\n", dispatch_dispersions);
}

static void parse_em_data(struct seq_file *m)
{
unsigned long retbuf[PLPAR_HCALL_BUFSIZE];

if (plpar_hcall(H_GET_EM_PARMS, retbuf) == H_SUCCESS)
seq_printf(m, "power_mode_data=%016lx\n", retbuf[0]);
}

static int pseries_lparcfg_data(struct seq_file *m, void *v)
{
int partition_potential_processors;
Expand Down Expand Up @@ -541,6 +549,8 @@ static int pseries_lparcfg_data(struct seq_file *m, void *v)

seq_printf(m, "slb_size=%d\n", mmu_slb_size);

parse_em_data(m);

return 0;
}

Expand Down

0 comments on commit 6fe9d1f

Please sign in to comment.