From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:52354) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xu2KZ-0004EJ-H7 for qemu-devel@nongnu.org; Thu, 27 Nov 2014 11:54:17 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Xu2KT-0007FV-C6 for qemu-devel@nongnu.org; Thu, 27 Nov 2014 11:54:11 -0500 Received: from mx1.redhat.com ([209.132.183.28]:56081) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xu2KT-0007FD-4p for qemu-devel@nongnu.org; Thu, 27 Nov 2014 11:54:05 -0500 Message-ID: <5477570C.70607@redhat.com> Date: Thu, 27 Nov 2014 17:53:32 +0100 From: Paolo Bonzini MIME-Version: 1.0 References: <20141126103841.7772.11864.stgit@PASHA-ISP> <20141126104049.7772.3594.stgit@PASHA-ISP> <5475B3AB.1040402@redhat.com> <001301d00a22$1d21bae0$576530a0$@Dovgaluk@ispras.ru> In-Reply-To: <001301d00a22$1d21bae0$576530a0$@Dovgaluk@ispras.ru> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [RFC PATCH v5 22/31] timer: introduce new QEMU_CLOCK_VIRTUAL_RT clock List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Pavel Dovgaluk , qemu-devel@nongnu.org Cc: peter.maydell@linaro.org, peter.crosthwaite@xilinx.com, rbilson@qnx.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 27/11/2014 10:11, Pavel Dovgaluk wrote: > When POLL interrupt request is processed by x86_cpu_exec_interrupt function, as it were before, > everything is ok, because I ensure that these calls occur at the same moments in record/replay. Does this partial revert work? Paolo diff --git a/cpu-exec.c b/cpu-exec.c index 3913de0..c976095 100644 --- a/cpu-exec.c +++ b/cpu-exec.c @@ -331,6 +331,12 @@ int cpu_exec(CPUArchState *env) volatile bool have_tb_lock = false; if (cpu->halted) { +#ifdef TARGET_I386 + if (cpu->interrupt_request & CPU_INTERRUPT_POLL) { + apic_poll_irq(x86_cpu->apic_state); + cpu_reset_interrupt(cpu, CPU_INTERRUPT_POLL); + } +#endif if (!cpu_has_work(cpu)) { return EXCP_HALTED; } diff --git a/target-i386/cpu.c b/target-i386/cpu.c index e9df33e..3f13dfe 100644 --- a/target-i386/cpu.c +++ b/target-i386/cpu.c @@ -2912,14 +2912,8 @@ static bool x86_cpu_has_work(CPUState *cs) X86CPU *cpu = X86_CPU(cs); CPUX86State *env = &cpu->env; -#if !defined(CONFIG_USER_ONLY) - if (cs->interrupt_request & CPU_INTERRUPT_POLL) { - apic_poll_irq(cpu->apic_state); - cpu_reset_interrupt(cs, CPU_INTERRUPT_POLL); - } -#endif - - return ((cs->interrupt_request & CPU_INTERRUPT_HARD) && + return ((cs->interrupt_request & (CPU_INTERRUPT_HARD | + CPU_INTERRUPT_POLL)) && (env->eflags & IF_MASK)) || (cs->interrupt_request & (CPU_INTERRUPT_NMI | CPU_INTERRUPT_INIT |