]> xenbits.xensource.com Git - qemu-upstream-4.4-testing.git/commitdiff
target-sh4: ignore ocbp and ocbwb instructions
authorAurelien Jarno <aurelien@aurel32.net>
Sat, 7 Jan 2012 14:20:12 +0000 (15:20 +0100)
committerAurelien Jarno <aurelien@aurel32.net>
Tue, 10 Jan 2012 17:30:08 +0000 (18:30 +0100)
ocbp and ocbwb controls the writeback of a cache line to memory. They
are supposed to do nothing in case of a cache miss. Given QEMU only
partially emulate caches, it is safe to ignore these instructions.

This fixes a kernel oops when trying to access an rtl8139 NIC with
recent versions.

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
(cherry picked from commit 0cdb95549fedc73e13c147ab9dcabcc303426a07)

target-sh4/translate.c

index bad3577726e7918b5e8d2a23ebbeba5653762e29..e04a6e0f5cc5005310481fff12055d93bffd937b 100644 (file)
@@ -1652,18 +1652,10 @@ static void _decode_opc(DisasContext * ctx)
        }
        return;
     case 0x00a3:               /* ocbp @Rn */
-       {
-           TCGv dummy = tcg_temp_new();
-           tcg_gen_qemu_ld32s(dummy, REG(B11_8), ctx->memidx);
-           tcg_temp_free(dummy);
-       }
-       return;
     case 0x00b3:               /* ocbwb @Rn */
-       {
-           TCGv dummy = tcg_temp_new();
-           tcg_gen_qemu_ld32s(dummy, REG(B11_8), ctx->memidx);
-           tcg_temp_free(dummy);
-       }
+        /* These instructions are supposed to do nothing in case of
+           a cache miss. Given that we only partially emulate caches
+           it is safe to simply ignore them. */
        return;
     case 0x0083:               /* pref @Rn */
        return;