From patchwork Sat Jan 7 20:17:41 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aurelien Jarno X-Patchwork-Id: 134868 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [140.186.70.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 3B9DAB6F74 for ; Sun, 8 Jan 2012 07:17:58 +1100 (EST) Received: from localhost ([::1]:56950 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RjciA-000072-54 for incoming@patchwork.ozlabs.org; Sat, 07 Jan 2012 15:17:54 -0500 Received: from eggs.gnu.org ([140.186.70.92]:44416) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Rjci5-00006s-EV for qemu-devel@nongnu.org; Sat, 07 Jan 2012 15:17:50 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Rjci4-0002W4-DH for qemu-devel@nongnu.org; Sat, 07 Jan 2012 15:17:49 -0500 Received: from hall.aurel32.net ([88.191.126.93]:58715) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Rjci4-0002W0-7N for qemu-devel@nongnu.org; Sat, 07 Jan 2012 15:17:48 -0500 Received: from [2001:470:d4ed:0:5e26:aff:fe2b:6f5b] (helo=volta.aurel32.net) by hall.aurel32.net with esmtpsa (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.72) (envelope-from ) id 1Rjci3-0004gj-JX; Sat, 07 Jan 2012 21:17:47 +0100 Received: from aurel32 by volta.aurel32.net with local (Exim 4.77) (envelope-from ) id 1Rjci2-0000X0-HL; Sat, 07 Jan 2012 21:17:46 +0100 From: Aurelien Jarno To: qemu-devel@nongnu.org Date: Sat, 7 Jan 2012 21:17:41 +0100 Message-Id: <1325967461-2000-1-git-send-email-aurelien@aurel32.net> X-Mailer: git-send-email 1.7.7.3 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 88.191.126.93 Cc: Aurelien Jarno Subject: [Qemu-devel] [PATCH] target-sh4: ignore ocbp and ocbwb instructions X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org 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 --- target-sh4/translate.c | 14 +++----------- 1 files changed, 3 insertions(+), 11 deletions(-) diff --git a/target-sh4/translate.c b/target-sh4/translate.c index 2ecb236..aacf96d 100644 --- a/target-sh4/translate.c +++ b/target-sh4/translate.c @@ -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;