From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:37628) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WzEVz-0001mn-NJ for qemu-devel@nongnu.org; Mon, 23 Jun 2014 20:23:21 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WzEVo-000460-4B for qemu-devel@nongnu.org; Mon, 23 Jun 2014 20:23:11 -0400 Received: from e23smtp05.au.ibm.com ([202.81.31.147]:35452) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WzEVn-000452-AO for qemu-devel@nongnu.org; Mon, 23 Jun 2014 20:23:00 -0400 Received: from /spool/local by e23smtp05.au.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 24 Jun 2014 10:22:56 +1000 Message-ID: <53A8C4DE.6090408@au1.ibm.com> Date: Tue, 24 Jun 2014 10:22:54 +1000 From: Sam Bobroff MIME-Version: 1.0 References: In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Subject: [Qemu-devel] [PATCH 4/4] spapr: Add RTAS sysparm SPLPAR Characteristics List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: qemu-ppc@nongnu.org Add support for the SPLPAR Characteristics parameter to the emulated RTAS call ibm,get-system-parameter. The support provides just enough information to allow "cat /proc/powerpc/lparcfg" to succeed without generating a kernel error message. Without this patch the above command will produce the following kernel message: arch/powerpc/platforms/pseries/lparcfg.c \ parse_system_parameter_string Error calling get-system-parameter \ (0xfffffffd) Signed-off-by: Sam Bobroff --- hw/ppc/spapr_rtas.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/hw/ppc/spapr_rtas.c b/hw/ppc/spapr_rtas.c index 8d94845..4270e7a 100644 --- a/hw/ppc/spapr_rtas.c +++ b/hw/ppc/spapr_rtas.c @@ -224,6 +224,7 @@ static void rtas_stop_self(PowerPCCPU *cpu, sPAPREnvironment *spapr, env->msr = 0; } +#define SPLPAR_CHARACTERISTICS 20 #define DIAGNOSTICS_RUN_MODE 42 #define UUID 48 @@ -238,8 +239,20 @@ static void rtas_ibm_get_system_parameter(PowerPCCPU *cpu, target_ulong length = rtas_ld(args, 2); target_ulong ret = RTAS_OUT_SUCCESS; uint8_t zero = 0; + uint8_t param_buf[64]; + int param_len; switch (parameter) { + case SPLPAR_CHARACTERISTICS: + param_len = snprintf((char *)param_buf, sizeof param_buf, + "MaxEntCap=%d,MaxPlatProcs=%d", + max_cpus, smp_cpus); + if (param_len >= 0) { + rtas_st_buffer(buffer, length, param_buf, param_len); + } else { + ret = RTAS_OUT_HW_ERROR; + } + break; case DIAGNOSTICS_RUN_MODE: rtas_st_buffer(buffer, length, &zero, sizeof zero); break; -- 1.9.0