From patchwork Mon Dec 19 13:21:17 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pavel Dovgalyuk X-Patchwork-Id: 9480261 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 0FEEA601C0 for ; Mon, 19 Dec 2016 13:21:53 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id EA33828487 for ; Mon, 19 Dec 2016 13:21:52 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id DF05D284C5; Mon, 19 Dec 2016 13:21:52 +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 94EA728487 for ; Mon, 19 Dec 2016 13:21:52 +0000 (UTC) Received: from localhost ([::1]:45397 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cIxt1-0007Bw-MX for patchwork-qemu-devel@patchwork.kernel.org; Mon, 19 Dec 2016 08:21:51 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:34170) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cIxsU-000799-Ii for qemu-devel@nongnu.org; Mon, 19 Dec 2016 08:21:21 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cIxsT-0007eg-Ik for qemu-devel@nongnu.org; Mon, 19 Dec 2016 08:21:18 -0500 Received: from mail.ispras.ru ([83.149.199.45]:46272) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cIxsT-0007eN-Ad for qemu-devel@nongnu.org; Mon, 19 Dec 2016 08:21:17 -0500 Received: from [10.10.150.205] (unknown [85.142.117.224]) by mail.ispras.ru (Postfix) with ESMTPSA id 93D41540071; Mon, 19 Dec 2016 16:21:16 +0300 (MSK) To: qemu-devel@nongnu.org From: Pavel Dovgalyuk Date: Mon, 19 Dec 2016 16:21:17 +0300 Message-ID: <20161219132116.3016.53630.stgit@PASHA-ISP> In-Reply-To: <20161219132102.3016.46687.stgit@PASHA-ISP> References: <20161219132102.3016.46687.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 v6 2/9] replay: improve interrupt handling 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, mst@redhat.com, jasowang@redhat.com, quintela@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 improves interrupt handling in record/replay mode. Now "interrupt" event is saved only when cc->cpu_exec_interrupt returns true. This patch also adds missing return to cpu_exec_interrupt function. Signed-off-by: Pavel Dovgalyuk --- cpu-exec.c | 2 +- target-i386/seg_helper.c | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/cpu-exec.c b/cpu-exec.c index 4188fed..fa08c73 100644 --- a/cpu-exec.c +++ b/cpu-exec.c @@ -508,8 +508,8 @@ static inline void cpu_handle_interrupt(CPUState *cpu, True when it is, and we should restart on a new TB, and via longjmp via cpu_loop_exit. */ else { - replay_interrupt(); if (cc->cpu_exec_interrupt(cpu, interrupt_request)) { + replay_interrupt(); *last_tb = NULL; } /* The target hook may have updated the 'cpu->interrupt_request'; diff --git a/target-i386/seg_helper.c b/target-i386/seg_helper.c index fb79f31..d24574d 100644 --- a/target-i386/seg_helper.c +++ b/target-i386/seg_helper.c @@ -1331,6 +1331,7 @@ bool x86_cpu_exec_interrupt(CPUState *cs, int interrupt_request) #endif if (interrupt_request & CPU_INTERRUPT_SIPI) { do_cpu_sipi(cpu); + ret = true; } else if (env->hflags2 & HF2_GIF_MASK) { if ((interrupt_request & CPU_INTERRUPT_SMI) && !(env->hflags & HF_SMM_MASK)) {