[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 08/11] target/hppa: fix b,gate instruction
From: |
Richard Henderson |
Subject: |
[Qemu-devel] [PULL 08/11] target/hppa: fix b,gate instruction |
Date: |
Tue, 12 Mar 2019 09:19:01 -0700 |
From: Sven Schnelle <address@hidden>
b,gate does GR[t] ← cat(GR[t]{0..29},IAOQ_Front{30..31});
instead of saving the link address to register t.
Signed-off-by: Sven Schnelle <address@hidden>
Message-Id: <address@hidden>
[rth: Move link check outside of ifndef CONFIG_USER_ONLY;
use ctx->privilege; nullify the insn earlier.]
Signed-off-by: Richard Henderson <address@hidden>
---
target/hppa/translate.c | 13 ++++++++++++-
1 file changed, 12 insertions(+), 1 deletion(-)
diff --git a/target/hppa/translate.c b/target/hppa/translate.c
index f3e78b8e22..6ac196804b 100644
--- a/target/hppa/translate.c
+++ b/target/hppa/translate.c
@@ -3446,6 +3446,8 @@ static bool trans_b_gate(DisasContext *ctx, arg_b_gate *a)
{
target_ureg dest = iaoq_dest(ctx, a->disp);
+ nullify_over(ctx);
+
/* Make sure the caller hasn't done something weird with the queue.
* ??? This is not quite the same as the PSW[B] bit, which would be
* expensive to track. Real hardware will trap for
@@ -3483,7 +3485,16 @@ static bool trans_b_gate(DisasContext *ctx, arg_b_gate
*a)
}
#endif
- return do_dbranch(ctx, dest, a->l, a->n);
+ if (a->l) {
+ TCGv_reg tmp = dest_gpr(ctx, a->l);
+ if (ctx->privilege < 3) {
+ tcg_gen_andi_reg(tmp, tmp, -4);
+ }
+ tcg_gen_ori_reg(tmp, tmp, ctx->privilege);
+ save_gpr(ctx, a->l, tmp);
+ }
+
+ return do_dbranch(ctx, dest, 0, a->n);
}
static bool trans_blr(DisasContext *ctx, arg_blr *a)
--
2.17.2
- [Qemu-devel] [PULL 00/11] target/hppa patch queue, Richard Henderson, 2019/03/12
- [Qemu-devel] [PULL 01/11] target/hppa: Check for page crossings in use_goto_tb, Richard Henderson, 2019/03/12
- [Qemu-devel] [PULL 02/11] target/hppa: fix overwriting source reg in addb, Richard Henderson, 2019/03/12
- [Qemu-devel] [PULL 03/11] target/hppa: fix TLB handling for page 0, Richard Henderson, 2019/03/12
- [Qemu-devel] [PULL 05/11] target/hppa: add TLB trace events, Richard Henderson, 2019/03/12
- [Qemu-devel] [PULL 04/11] target/hppa: report ITLB_EXCP_MISS for ITLB misses, Richard Henderson, 2019/03/12
- [Qemu-devel] [PULL 06/11] target/hppa: remove PSW I/R/Q bit check, Richard Henderson, 2019/03/12
- [Qemu-devel] [PULL 08/11] target/hppa: fix b,gate instruction,
Richard Henderson <=
- [Qemu-devel] [PULL 07/11] target/hppa: ignore DIAG opcode, Richard Henderson, 2019/03/12
- [Qemu-devel] [PULL 09/11] target/hppa: allow multiple itlbp without itlba, Richard Henderson, 2019/03/12
- [Qemu-devel] [PULL 10/11] target/hppa: add TLB protection id check, Richard Henderson, 2019/03/12
- [Qemu-devel] [PULL 11/11] target/hppa: exit TB if either Data or Instruction TLB changes, Richard Henderson, 2019/03/12
- Re: [Qemu-devel] [PULL 00/11] target/hppa patch queue, no-reply, 2019/03/12
- Re: [Qemu-devel] [PULL 00/11] target/hppa patch queue, Peter Maydell, 2019/03/13