From patchwork Sat Jan 16 01:14:46 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Gibson X-Patchwork-Id: 8047701 Return-Path: X-Original-To: patchwork-qemu-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id BA996BEEE5 for ; Sat, 16 Jan 2016 01:15:09 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 28F1D202F2 for ; Sat, 16 Jan 2016 01:15:09 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 745D9202EC for ; Sat, 16 Jan 2016 01:15:08 +0000 (UTC) Received: from localhost ([::1]:49573 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aKFSN-0000WO-Q5 for patchwork-qemu-devel@patchwork.kernel.org; Fri, 15 Jan 2016 20:15:07 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:32909) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aKFRI-0007A4-KH for qemu-devel@nongnu.org; Fri, 15 Jan 2016 20:14:01 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aKFRE-0002Hz-2u for qemu-devel@nongnu.org; Fri, 15 Jan 2016 20:14:00 -0500 Received: from ozlabs.org ([103.22.144.67]:35818) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aKFRD-0002Hi-OL; Fri, 15 Jan 2016 20:13:56 -0500 Received: by ozlabs.org (Postfix, from userid 1007) id 05AEB140D6B; Sat, 16 Jan 2016 12:13:51 +1100 (AEDT) From: David Gibson To: aik@ozlabs.ru Date: Sat, 16 Jan 2016 12:14:46 +1100 Message-Id: <1452906886-806-4-git-send-email-david@gibson.dropbear.id.au> X-Mailer: git-send-email 2.5.0 In-Reply-To: <1452906886-806-1-git-send-email-david@gibson.dropbear.id.au> References: <1452906886-806-1-git-send-email-david@gibson.dropbear.id.au> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 103.22.144.67 Cc: agraf@suse.de, qemu-devel@nongnu.org, mdroth@linux.vnet.ibm.com, qemu-ppc@nongnu.org, David Gibson Subject: [Qemu-devel] [PATCH 3/3] spapr: Remove abuse of rtas_ld() in h_client_architecture_support X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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; }