From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:57131) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YAeCL-0003bL-8Z for qemu-devel@nongnu.org; Mon, 12 Jan 2015 07:34:22 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YAeCI-0003H9-0a for qemu-devel@nongnu.org; Mon, 12 Jan 2015 07:34:21 -0500 Received: from mx1.redhat.com ([209.132.183.28]:60251) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YAeCH-0003G3-Pa for qemu-devel@nongnu.org; Mon, 12 Jan 2015 07:34:17 -0500 Message-ID: <54B3BF3B.7020403@redhat.com> Date: Mon, 12 Jan 2015 13:34:03 +0100 From: Paolo Bonzini MIME-Version: 1.0 References: <20150112115944.3504.66763.stgit@PASHA-ISP> <20150112120032.3504.11086.stgit@PASHA-ISP> In-Reply-To: <20150112120032.3504.11086.stgit@PASHA-ISP> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Subject: Re: [Qemu-devel] [RFC PATCH v7 08/21] replay: interrupts and exceptions List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Pavel Dovgalyuk , qemu-devel@nongnu.org Cc: peter.maydell@linaro.org, peter.crosthwaite@xilinx.com, alex.bennee@linaro.org, mark.burton@greensocs.com, real@ispras.ru, batuzovk@ispras.ru, maria.klimushenkova@ispras.ru, afaerber@suse.de, fred.konrad@greensocs.com On 12/01/2015 13:00, Pavel Dovgalyuk wrote: > > + if (replay_exception()) { > + cc->do_interrupt(cpu); > + cpu->exception_index = -1; I cannot see replay_exception() in the series? > @@ -419,21 +434,24 @@ int cpu_exec(CPUArchState *env) > cpu->exception_index = EXCP_DEBUG; > cpu_loop_exit(cpu); Why not for EXCP_DEBUG? > } > - if (interrupt_request & CPU_INTERRUPT_HALT) { > + if ((interrupt_request & CPU_INTERRUPT_HALT) > + && replay_interrupt()) { > cpu->interrupt_request &= ~CPU_INTERRUPT_HALT; > cpu->halted = 1; > cpu->exception_index = EXCP_HLT; > cpu_loop_exit(cpu); > } > #if defined(TARGET_I386) > - if (interrupt_request & CPU_INTERRUPT_INIT) { > + if ((interrupt_request & CPU_INTERRUPT_INIT) > + && replay_interrupt()) { > cpu_svm_check_intercept_param(env, SVM_EXIT_INIT, 0); > do_cpu_init(x86_cpu); > cpu->exception_index = EXCP_HALTED; > cpu_loop_exit(cpu); > } > #else > - if (interrupt_request & CPU_INTERRUPT_RESET) { > + if ((interrupt_request & CPU_INTERRUPT_RESET) > + && replay_interrupt()) { > cpu_reset(cpu); > } > #endif Perhaps check the replay_interrupt() outside, in an && with "if (unlikely(interrupt_request))"? > @@ -441,7 +459,10 @@ int cpu_exec(CPUArchState *env) > False when the interrupt isn't processed, > True when it is, and we should restart on a new TB, > and via longjmp via cpu_loop_exit. */ > - if (cc->cpu_exec_interrupt(cpu, interrupt_request)) { > + if ((replay_mode != REPLAY_MODE_PLAY > + || replay_has_interrupt()) > + && cc->cpu_exec_interrupt(cpu, interrupt_request)) { > + replay_interrupt(); Please put this in a separate function like: if (replay_mode == REPLAY_MODE_PLAY && !replay_has_interrupt()) { return false; } ret = cc->cpu_exec_interrupt(cpu, interrupt_request); if (ret) { replay_interrupt(); } return ret; Paolo > next_tb = 0; > } > /* Don't use the cached interrupt_request value, > @@ -453,7 +474,8 @@ int cpu_exec(CPUArchState *env)