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: 9539179 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id DA1EB604A9 for ; Thu, 26 Jan 2017 12:34:45 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C117127F99 for ; Thu, 26 Jan 2017 12:34:45 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B62E42819A; Thu, 26 Jan 2017 12:34:45 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id A10CA2818E for ; Thu, 26 Jan 2017 12:34:44 +0000 (UTC) Received: from localhost ([::1]:38003 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cWjGF-0003C3-79 for patchwork-qemu-devel@patchwork.kernel.org; Thu, 26 Jan 2017 07:34:43 -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+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP 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); }