From: "Andreas Färber" <afaerber@suse.de>
To: Peter Maydell <peter.maydell@linaro.org>,
"Edgar E. Iglesias" <edgar.iglesias@gmail.com>
Cc: QEMU Developers <qemu-devel@nongnu.org>, pcrost@xilinx.com
Subject: Re: [Qemu-devel] [PATCH] qom/cpu: Remove cpu->exit_request from reset state
Date: Wed, 12 Mar 2014 00:58:03 +0100 [thread overview]
Message-ID: <531FA30B.5020205@suse.de> (raw)
In-Reply-To: <CAFEAcA9XSdVmU+4F15HBZ_Es+VDX9E2UCQ=AVY=fWi1F86TO6A@mail.gmail.com>
Am 20.02.2014 16:58, schrieb Peter Maydell:
> On 16 February 2014 02:07, Edgar E. Iglesias <edgar.iglesias@gmail.com> wrote:
>> On Sat, Feb 15, 2014 at 03:42:56PM +0000, Peter Maydell wrote:
>>> On 13 February 2014 05:07, <edgar.iglesias@gmail.com> wrote:
>>>> From: "Edgar E. Iglesias" <edgar.iglesias@xilinx.com>
>>>>
>>>> cpu->exit_request is part of the execution environment and should
>>>> not be cleared when a CPU resets.
>>>>
>>>> Otherwise, we might deadlock QEMU if a CPU resets while there is
>>>> I/O going on.
>>>>
>>>> Signed-off-by: Edgar E. Iglesias <edgar.iglesias@xilinx.com>
>>>> ---
>>>> qom/cpu.c | 1 -
>>>> 1 file changed, 1 deletion(-)
>>>>
>>>> diff --git a/qom/cpu.c b/qom/cpu.c
>>>> index 9d62479..40d82dd 100644
>>>> --- a/qom/cpu.c
>>>> +++ b/qom/cpu.c
>>>> @@ -195,7 +195,6 @@ static void cpu_common_reset(CPUState *cpu)
>>>> log_cpu_state(cpu, cc->reset_dump_flags);
>>>> }
>>>>
>>>> - cpu->exit_request = 0;
>>>> cpu->interrupt_request = 0;
>>>> cpu->current_tb = NULL;
>>>> cpu->halted = 0;
>>>
>>> This looks kind of odd to me. What's the situation you see where
>>> this matters -- is the CPU resetting itself, or is some other device
>>> in another thread triggering the CPU reset? TCG or KVM?
>>
>> Seeing this in TCG. The CPU gets signaled by the IO thread while the
>> CPU is resetting itself. If the CPU looses the race, it clears its
>> exit_request leaving the IO thread waiting for the global lock
>> potentially forever.
>>
>> The CPU actually exits generated code but goes right back in because
>> there is no exit_request pending.
>
> Yes, having looked at the code I agree with you, so:
>
> Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Thanks, applied to qom-cpu (with clarified commit message):
https://github.com/afaerber/qemu-cpu/commits/qom-cpu
Andreas
--
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer; HRB 16746 AG Nürnberg
next prev parent reply other threads:[~2014-03-11 23:58 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-02-13 5:07 [Qemu-devel] [PATCH] qom/cpu: Remove cpu->exit_request from reset state edgar.iglesias
2014-02-15 15:42 ` Peter Maydell
2014-02-16 2:07 ` Edgar E. Iglesias
2014-02-20 15:58 ` Peter Maydell
2014-02-20 16:15 ` Andreas Färber
2014-02-20 16:34 ` Peter Maydell
2014-02-20 23:26 ` Edgar E. Iglesias
2014-02-20 23:50 ` Peter Maydell
2014-03-11 23:58 ` Andreas Färber [this message]
2014-03-12 0:03 ` Peter Maydell
2014-03-12 1:51 ` Edgar E. Iglesias
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=531FA30B.5020205@suse.de \
--to=afaerber@suse.de \
--cc=edgar.iglesias@gmail.com \
--cc=pcrost@xilinx.com \
--cc=peter.maydell@linaro.org \
--cc=qemu-devel@nongnu.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.