powerpc/pseries: Export data from new hcall H_EM_GET_PARMS
authorVaidyanathan Srinivasan <svaidy@linux.vnet.ibm.com>
Wed, 31 Mar 2010 21:39:24 +0000 (21:39 +0000)
committerBenjamin Herrenschmidt <benh@kernel.crashing.org>
Wed, 7 Apr 2010 08:00:29 +0000 (18:00 +1000)
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>
arch/powerpc/include/asm/hvcall.h
arch/powerpc/kernel/lparcfg.c

index f0275818b95c216686765ec3c36a41c8d6132ca6..ebe7493e93e3857c6605b4eae2e462cb72234a75 100644 (file)
 #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
index c2c70e1b32cd25eacb691497b6a572c645efe16f..50362b6ef6e93d8752ffda779ffaee429e2a054a 100644 (file)
@@ -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 */
@@ -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;
@@ -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;
 }