From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:37393) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WzPNL-0000ee-Uv for qemu-devel@nongnu.org; Tue, 24 Jun 2014 07:59:08 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WzPND-0006kU-IQ for qemu-devel@nongnu.org; Tue, 24 Jun 2014 07:58:59 -0400 Message-ID: <53A967F9.1050004@suse.de> Date: Tue, 24 Jun 2014 13:58:49 +0200 From: Alexander Graf MIME-Version: 1.0 References: <53A8C4DB.7080408@au1.ibm.com> In-Reply-To: <53A8C4DB.7080408@au1.ibm.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [Qemu-ppc] [PATCH 3/4] spapr: Fix RTAS sysparm DIAGNOSTICS_RUN_MODE List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Sam Bobroff , qemu-devel@nongnu.org Cc: qemu-ppc@nongnu.org On 24.06.14 02:22, Sam Bobroff wrote: > This allows the ibm,get-system-parameter RTAS call to succeed for the > DIAGNOSTICS_RUN_MODE system parameter. > > The problem can be seen with "ppc64_cpu --run-mode" from the > powerpc-utils package which fails before this patch with "Machine does > not support diagnostic run mode". > > This is corrected by using the rtas_st_buffer() function to write to > the buffer. > > The function return value code is also slightly simplified. > > Signed-off-by: Sam Bobroff > --- > hw/ppc/spapr_rtas.c | 11 +++++------ > 1 file changed, 5 insertions(+), 6 deletions(-) > > diff --git a/hw/ppc/spapr_rtas.c b/hw/ppc/spapr_rtas.c > index 4f87673..8d94845 100644 > --- a/hw/ppc/spapr_rtas.c > +++ b/hw/ppc/spapr_rtas.c > @@ -236,19 +236,18 @@ static void rtas_ibm_get_system_parameter(PowerPCCPU *cpu, > target_ulong parameter = rtas_ld(args, 0); > target_ulong buffer = rtas_ld(args, 1); > target_ulong length = rtas_ld(args, 2); > - target_ulong ret = RTAS_OUT_NOT_SUPPORTED; > + target_ulong ret = RTAS_OUT_SUCCESS; > + uint8_t zero = 0; > > switch (parameter) { > case DIAGNOSTICS_RUN_MODE: > - if (length == 1) { > - rtas_st(buffer, 0, 0); > - ret = RTAS_OUT_SUCCESS; > - } > + rtas_st_buffer(buffer, length, &zero, sizeof zero); Please use sizeof(zero) here :). Alex