render / rpms / qemu

Forked from rpms/qemu 10 months ago
Clone

Blame 0019-target-sh4-ignore-ocbp-and-ocbwb-instructions.patch

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