qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH v2] taget-ppc: Fix read access to IBAT registers higher than IBAT3
@ 2015-10-14 17:43 Julio Guerra
  2015-11-03  8:00 ` Julio Guerra
  2015-11-06  8:04 ` Michael Tokarev
  0 siblings, 2 replies; 7+ messages in thread
From: Julio Guerra @ 2015-10-14 17:43 UTC (permalink / raw)
  To: qemu-devel, qemu-ppc, qemu-trivial; +Cc: christophe, Alexander Graf

Fix the index used to read the IBAT's vector which results in IBAT0..3 instead
of IBAT4..N.

The bug appeared by saving/restoring contexts including IBATs values.

Signed-off-by: Julio Guerra <julio@farjump.io>
---
 target-ppc/translate_init.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/target-ppc/translate_init.c b/target-ppc/translate_init.c
index b541473..76d9a02 100644
--- a/target-ppc/translate_init.c
+++ b/target-ppc/translate_init.c
@@ -305,7 +305,7 @@ static void spr_read_ibat (DisasContext *ctx, int gprn, int sprn)
 
 static void spr_read_ibat_h (DisasContext *ctx, int gprn, int sprn)
 {
-    tcg_gen_ld_tl(cpu_gpr[gprn], cpu_env, offsetof(CPUPPCState, IBAT[sprn & 1][(sprn - SPR_IBAT4U) / 2]));
+    tcg_gen_ld_tl(cpu_gpr[gprn], cpu_env, offsetof(CPUPPCState, IBAT[sprn & 1][((sprn - SPR_IBAT4U) / 2) + 4]));
 }
 
 static void spr_write_ibatu (DisasContext *ctx, int sprn, int gprn)
-- 
2.5.2

^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2015-11-11  1:07 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-10-14 17:43 [Qemu-devel] [PATCH v2] taget-ppc: Fix read access to IBAT registers higher than IBAT3 Julio Guerra
2015-11-03  8:00 ` Julio Guerra
2015-11-03 12:16   ` Michael Tokarev
2015-11-03 13:29     ` Mark Cave-Ayland
2015-11-03 16:52       ` Julio Guerra
2015-11-06  8:04 ` Michael Tokarev
2015-11-11  1:03   ` [Qemu-devel] [Qemu-ppc] " David Gibson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).