From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:58795) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b0DGU-0002xT-TR for qemu-devel@nongnu.org; Tue, 10 May 2016 15:24:20 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1b0DGP-0000Fh-So for qemu-devel@nongnu.org; Tue, 10 May 2016 15:24:16 -0400 Received: from mail-lf0-x244.google.com ([2a00:1450:4010:c07::244]:35726) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b0DGP-0000Er-Hz for qemu-devel@nongnu.org; Tue, 10 May 2016 15:24:13 -0400 Received: by mail-lf0-x244.google.com with SMTP id u64so2440733lff.2 for ; Tue, 10 May 2016 12:24:13 -0700 (PDT) References: <1462895205-8411-1-git-send-email-sergey.fedorov@linaro.org> <1462895205-8411-4-git-send-email-sergey.fedorov@linaro.org> From: Sergey Fedorov Message-ID: <5732355A.2090301@gmail.com> Date: Tue, 10 May 2016 22:24:10 +0300 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 3/5] cpu-exec: Move interrupt handling out of cpu_exec() List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Richard Henderson , Sergey Fedorov , qemu-devel@nongnu.org Cc: =?UTF-8?Q?Alex_Benn=c3=a9e?= , Paolo Bonzini , Peter Crosthwaite On 10/05/16 19:34, Richard Henderson wrote: > On 05/10/2016 05:46 AM, Sergey Fedorov wrote: >> From: Sergey Fedorov >> >> Simplify cpu_exec() by extracting interrupt handling code outside of >> cpu_exec() into a new static inline function cpu_handle_interrupt(). >> >> Signed-off-by: Sergey Fedorov >> Signed-off-by: Sergey Fedorov >> --- >> cpu-exec.c | 132 >> ++++++++++++++++++++++++++++++++----------------------------- >> 1 file changed, 70 insertions(+), 62 deletions(-) > > Reviewed-by: Richard Henderson > > >> + if (replay_mode == REPLAY_MODE_PLAY && >> !replay_has_interrupt()) { >> + /* Do nothing */ >> + } else if (interrupt_request & CPU_INTERRUPT_HALT) { >> + } >> + else if (interrupt_request & CPU_INTERRUPT_RESET) { >> + } >> + else { >> + replay_interrupt(); >> + if (cc->cpu_exec_interrupt(cpu, interrupt_request)) { >> + *last_tb = NULL; >> + } >> + } >> + /* Don't use the cached interrupt_request value, >> + do_interrupt may have updated the EXITTB flag. */ >> + if (cpu->interrupt_request & CPU_INTERRUPT_EXITTB) { > > Note for future cleanup: IMO this comment is cleaner if it's actually > put where it's meaningful (and updated to reflect that do_interrupt no > longer exists). E.g. > > else { > if (cc->cpu_exec_interrupt(cpu, interrupt_request)) { > *last_tb = NULL; > } > /* Reload the interrupt_request value as it may have > been updated by the target hook. */ > interrupt_request = cpu->interrupt_request; > } > if (interupt_request & CPU_INTERRUPT_EXITTB) { > ... > > But such a change of course belongs in a separate patch. Cool, thanks for the suggestion. I've had feeling this could be expressed in a better way, like you suggest :) Kind regards, Sergey