From patchwork Thu Jan 26 12:34:18 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pavel Dovgalyuk X-Patchwork-Id: 720135 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3v8LxC3P9Hz9t8j for ; Thu, 26 Jan 2017 23:35:43 +1100 (AEDT) Received: from localhost ([::1]:38016 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cWjHB-00046I-2Y for incoming@patchwork.ozlabs.org; Thu, 26 Jan 2017 07:35:41 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:49560) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cWjFn-0003BR-TR for qemu-devel@nongnu.org; Thu, 26 Jan 2017 07:34:16 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cWjFm-0004xS-MS for qemu-devel@nongnu.org; Thu, 26 Jan 2017 07:34:15 -0500 Received: from mail.ispras.ru ([83.149.199.45]:42466) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cWjFm-0004wo-Fo for qemu-devel@nongnu.org; Thu, 26 Jan 2017 07:34:14 -0500 Received: from [10.10.150.6] (unknown [85.142.117.226]) by mail.ispras.ru (Postfix) with ESMTPSA id BE554540068; Thu, 26 Jan 2017 15:34:13 +0300 (MSK) To: qemu-devel@nongnu.org From: Pavel Dovgalyuk Date: Thu, 26 Jan 2017 15:34:18 +0300 Message-ID: <20170126123418.5412.33815.stgit@PASHA-ISP> In-Reply-To: <20170126123411.5412.44769.stgit@PASHA-ISP> References: <20170126123411.5412.44769.stgit@PASHA-ISP> User-Agent: StGit/0.16 MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [fuzzy] X-Received-From: 83.149.199.45 Subject: [Qemu-devel] [PATCH v8 1/9] replay: exception replay fix X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: kwolf@redhat.com, peter.maydell@linaro.org, quintela@redhat.com, jasowang@redhat.com, mst@redhat.com, dovgaluk@ispras.ru, kraxel@redhat.com, pbonzini@redhat.com Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" This patch fixes replaying the exception when TB cache is full. It breaks cpu loop execution through setting exception_index to process such queued work as TB flush. v8: moved setting of exeption_index to tb_gen_code Signed-off-by: Pavel Dovgalyuk --- translate-all.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/translate-all.c b/translate-all.c index 2026293..abce8f1 100644 --- a/translate-all.c +++ b/translate-all.c @@ -1290,6 +1290,9 @@ TranslationBlock *tb_gen_code(CPUState *cpu, /* flush must be done */ tb_flush(cpu); mmap_unlock(); + /* Set exception index to make sure that the execution loop + will exit and go to flushing and other queued work. */ + cpu->exception_index = EXCP_INTERRUPT; cpu_loop_exit(cpu); }