From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:46081) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W7sNC-0003KZ-7J for qemu-devel@nongnu.org; Mon, 27 Jan 2014 15:01:42 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1W7sN0-0001ai-5Z for qemu-devel@nongnu.org; Mon, 27 Jan 2014 15:01:34 -0500 Message-ID: <52E6BB06.8020304@gmail.com> Date: Mon, 27 Jan 2014 14:01:10 -0600 From: Tom Musta MIME-Version: 1.0 References: <1390845264-2532-1-git-send-email-tommusta@gmail.com> <1390845264-2532-8-git-send-email-tommusta@gmail.com> <9FC7D786-5323-4051-8100-321EE9A492F0@suse.de> In-Reply-To: <9FC7D786-5323-4051-8100-321EE9A492F0@suse.de> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [Qemu-ppc] [PATCH 7/8] target-ppc: Add Load Quadword and Reserve List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Alexander Graf Cc: PowerPC , QEMU Developers On 1/27/2014 12:59 PM, Alexander Graf wrote: > > On 27.01.2014, at 18:54, Tom Musta wrote: > >> This patch adds the Load Quadword and Reserve (lqarx) instruction, >> which is new in Power ISA 2.07. >> >> Signed-off-by: Tom Musta >> --- >> target-ppc/translate.c | 34 ++++++++++++++++++++++++++++++++++ >> 1 files changed, 34 insertions(+), 0 deletions(-) >> >> diff --git a/target-ppc/translate.c b/target-ppc/translate.c >> index bb1dc82..589cee9 100644 >> --- a/target-ppc/translate.c >> +++ b/target-ppc/translate.c >> @@ -3361,6 +3361,39 @@ STCX(stwcx_, 4); >> /* ldarx */ >> LARX(ldarx, 8, ld64); >> >> +/* lqarx */ >> +static void gen_lqarx(DisasContext *ctx) >> +{ >> + TCGv EA; >> + int rd = rD(ctx->opcode); >> + TCGv gpr1, gpr2; >> + >> + if (unlikely((rd & 1) || (rd == rA(ctx->opcode)) || >> + (rd == rB(ctx->opcode)))) { >> + gen_inval_exception(ctx, POWERPC_EXCP_INVAL_INVAL); >> + return; >> + } >> + >> + gen_set_access_type(ctx, ACCESS_RES); >> + EA = tcg_temp_local_new(); >> + gen_addr_reg_index(ctx, EA); >> + gen_check_align(ctx, EA, 15); >> + if (unlikely(ctx->le_mode)) { >> + gpr1 = cpu_gpr[rd+1]; >> + gpr2 = cpu_gpr[rd]; >> + } else { >> + gpr1 = cpu_gpr[rd]; >> + gpr2 = cpu_gpr[rd+1]; >> + } >> + gen_qemu_ld64(ctx, gpr1, EA); >> + tcg_gen_mov_tl(cpu_reserve, EA); >> + tcg_gen_st_tl(gpr1, cpu_env, offsetof(CPUPPCState, reserve_val)); > > I suppose it's ok to only store the first 64bits as reserved? > > > Alex > Thank you, Alex. It looks like there is some interesting code in linux-user/main.c that is impacted by lqarx/stqcx.