From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:39374) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aLLit-0002Rz-7Q for qemu-devel@nongnu.org; Mon, 18 Jan 2016 21:08:44 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aLLiq-00050G-1a for qemu-devel@nongnu.org; Mon, 18 Jan 2016 21:08:43 -0500 Received: from mail-pf0-x244.google.com ([2607:f8b0:400e:c00::244]:35925) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aLLip-000506-RV for qemu-devel@nongnu.org; Mon, 18 Jan 2016 21:08:39 -0500 Received: by mail-pf0-x244.google.com with SMTP id n128so12418202pfn.3 for ; Mon, 18 Jan 2016 18:08:39 -0800 (PST) References: <1452906886-806-1-git-send-email-david@gibson.dropbear.id.au> <1452906886-806-4-git-send-email-david@gibson.dropbear.id.au> From: Alexey Kardashevskiy Message-ID: <569D9AA2.7040009@ozlabs.ru> Date: Tue, 19 Jan 2016 13:08:34 +1100 MIME-Version: 1.0 In-Reply-To: <1452906886-806-4-git-send-email-david@gibson.dropbear.id.au> Content-Type: text/plain; charset=koi8-r; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 3/3] spapr: Remove abuse of rtas_ld() in h_client_architecture_support List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: David Gibson Cc: qemu-devel@nongnu.org, qemu-ppc@nongnu.org, mdroth@linux.vnet.ibm.com, agraf@suse.de On 01/16/2016 12:14 PM, David Gibson wrote: > h_client_architecture_support() uses rtas_ld() for general purpose memory > access, despite the fact that it's not an RTAS routine at all and rtas_ld > makes things more awkward. > > Clean this up by replacing rtas_ld() calls with appropriate ldXX_phys() > calls. > > Signed-off-by: David Gibson Reviewed-by: Alexey Kardashevskiy > --- > hw/ppc/spapr_hcall.c | 14 +++++++------- > 1 file changed, 7 insertions(+), 7 deletions(-) > > diff --git a/hw/ppc/spapr_hcall.c b/hw/ppc/spapr_hcall.c > index cebceea..9dbdba9 100644 > --- a/hw/ppc/spapr_hcall.c > +++ b/hw/ppc/spapr_hcall.c > @@ -861,7 +861,8 @@ static target_ulong h_client_architecture_support(PowerPCCPU *cpu_, > target_ulong opcode, > target_ulong *args) > { > - target_ulong list = args[0], ov_table; > + target_ulong list = ppc64_phys_to_real(args[0]); > + target_ulong ov_table, ov5; > PowerPCCPUClass *pcc_ = POWERPC_CPU_GET_CLASS(cpu_); > CPUState *cs; > bool cpu_match = false, cpu_update = true, memory_update = false; > @@ -875,9 +876,9 @@ static target_ulong h_client_architecture_support(PowerPCCPU *cpu_, > for (counter = 0; counter < 512; ++counter) { > uint32_t pvr, pvr_mask; > > - pvr_mask = rtas_ld(list, 0); > + pvr_mask = ldl_be_phys(&address_space_memory, list); > list += 4; > - pvr = rtas_ld(list, 0); > + pvr = ldl_be_phys(&address_space_memory, list); > list += 4; > > trace_spapr_cas_pvr_try(pvr); > @@ -948,14 +949,13 @@ static target_ulong h_client_architecture_support(PowerPCCPU *cpu_, > /* For the future use: here @ov_table points to the first option vector */ > ov_table = list; > > - list = cas_get_option_vector(5, ov_table); > - if (!list) { > + ov5 = cas_get_option_vector(5, ov_table); > + if (!ov5) { > return H_SUCCESS; > } > > /* @list now points to OV 5 */ > - list += 2; > - ov5_byte2 = rtas_ld(list, 0) >> 24; > + ov5_byte2 = ldub_phys(&address_space_memory, ov5 + 2); > if (ov5_byte2 & OV5_DRCONF_MEMORY) { > memory_update = true; > } > -- Alexey