45e84a0
From 37769d27270eff15d878a1c7df23407fc5f09b7f Mon Sep 17 00:00:00 2001
45e84a0
From: Aurelien Jarno <aurelien@aurel32.net>
45e84a0
Date: Sat, 7 Jan 2012 15:20:12 +0100
45e84a0
Subject: [PATCH 19/25] target-sh4: ignore ocbp and ocbwb instructions
45e84a0
45e84a0
ocbp and ocbwb controls the writeback of a cache line to memory. They
45e84a0
are supposed to do nothing in case of a cache miss. Given QEMU only
45e84a0
partially emulate caches, it is safe to ignore these instructions.
45e84a0
45e84a0
This fixes a kernel oops when trying to access an rtl8139 NIC with
45e84a0
recent versions.
45e84a0
45e84a0
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
45e84a0
(cherry picked from commit 0cdb95549fedc73e13c147ab9dcabcc303426a07)
45e84a0
---
45e84a0
 target-sh4/translate.c |   14 +++-----------
45e84a0
 1 files changed, 3 insertions(+), 11 deletions(-)
45e84a0
45e84a0
diff --git a/target-sh4/translate.c b/target-sh4/translate.c
45e84a0
index bad3577..e04a6e0 100644
45e84a0
--- a/target-sh4/translate.c
45e84a0
+++ b/target-sh4/translate.c
45e84a0
@@ -1652,18 +1652,10 @@ static void _decode_opc(DisasContext * ctx)
45e84a0
 	}
45e84a0
 	return;
45e84a0
     case 0x00a3:		/* ocbp @Rn */
45e84a0
-	{
45e84a0
-	    TCGv dummy = tcg_temp_new();
45e84a0
-	    tcg_gen_qemu_ld32s(dummy, REG(B11_8), ctx->memidx);
45e84a0
-	    tcg_temp_free(dummy);
45e84a0
-	}
45e84a0
-	return;
45e84a0
     case 0x00b3:		/* ocbwb @Rn */
45e84a0
-	{
45e84a0
-	    TCGv dummy = tcg_temp_new();
45e84a0
-	    tcg_gen_qemu_ld32s(dummy, REG(B11_8), ctx->memidx);
45e84a0
-	    tcg_temp_free(dummy);
45e84a0
-	}
45e84a0
+        /* These instructions are supposed to do nothing in case of
45e84a0
+           a cache miss. Given that we only partially emulate caches
45e84a0
+           it is safe to simply ignore them. */
45e84a0
 	return;
45e84a0
     case 0x0083:		/* pref @Rn */
45e84a0
 	return;
45e84a0
-- 
45e84a0
1.7.7.5
45e84a0