From: Sergey Fedorov <serge.fdrv@gmail.com>
To: Richard Henderson <rth@twiddle.net>,
Sergey Fedorov <sergey.fedorov@linaro.org>,
qemu-devel@nongnu.org
Cc: "Alex Bennée" <alex.bennee@linaro.org>,
"Paolo Bonzini" <pbonzini@redhat.com>,
"Peter Crosthwaite" <crosthwaite.peter@gmail.com>
Subject: Re: [Qemu-devel] [PATCH 3/5] cpu-exec: Move interrupt handling out of cpu_exec()
Date: Tue, 10 May 2016 22:24:10 +0300 [thread overview]
Message-ID: <5732355A.2090301@gmail.com> (raw)
In-Reply-To: <f847a946-0a75-abbb-f7db-87712b135545@twiddle.net>
On 10/05/16 19:34, Richard Henderson wrote:
> On 05/10/2016 05:46 AM, Sergey Fedorov wrote:
>> From: Sergey Fedorov <serge.fdrv@gmail.com>
>>
>> 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 <serge.fdrv@gmail.com>
>> Signed-off-by: Sergey Fedorov <sergey.fedorov@linaro.org>
>> ---
>> cpu-exec.c | 132
>> ++++++++++++++++++++++++++++++++-----------------------------
>> 1 file changed, 70 insertions(+), 62 deletions(-)
>
> Reviewed-by: Richard Henderson <rth@twiddle.net>
>
>
>> + 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
next prev parent reply other threads:[~2016-05-10 19:24 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-05-10 15:46 [Qemu-devel] [PATCH 0/5] cpu-exec: Restructure cpu_exec() Sergey Fedorov
2016-05-10 15:46 ` [Qemu-devel] [PATCH 1/5] cpu-exec: Move halt handling out of cpu_exec() Sergey Fedorov
2016-05-10 16:13 ` Richard Henderson
2016-05-10 19:13 ` Sergey Fedorov
2016-05-10 15:46 ` [Qemu-devel] [PATCH 2/5] cpu-exec: Move exception " Sergey Fedorov
2016-05-10 16:21 ` Richard Henderson
2016-05-10 19:21 ` Sergey Fedorov
2016-05-10 15:46 ` [Qemu-devel] [PATCH 3/5] cpu-exec: Move interrupt " Sergey Fedorov
2016-05-10 16:34 ` Richard Henderson
2016-05-10 19:24 ` Sergey Fedorov [this message]
2016-05-10 15:46 ` [Qemu-devel] [PATCH 4/5] cpu-exec: Move TB execution stuff " Sergey Fedorov
2016-05-10 16:56 ` Richard Henderson
2016-05-10 15:46 ` [Qemu-devel] [PATCH 5/5] cpu-exec: Remove unused 'x86_cpu' and 'env' from cpu_exec() Sergey Fedorov
2016-05-10 16:57 ` Richard Henderson
2016-05-10 15:49 ` [Qemu-devel] [PATCH 0/5] cpu-exec: Restructure cpu_exec() Sergey Fedorov
-- strict thread matches above, loose matches on Subject: below --
2016-05-11 10:21 Sergey Fedorov
2016-05-11 10:21 ` [Qemu-devel] [PATCH 3/5] cpu-exec: Move interrupt handling out of cpu_exec() Sergey Fedorov
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=5732355A.2090301@gmail.com \
--to=serge.fdrv@gmail.com \
--cc=alex.bennee@linaro.org \
--cc=crosthwaite.peter@gmail.com \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=rth@twiddle.net \
--cc=sergey.fedorov@linaro.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).