From: Avi Kivity <avi@redhat.com>
To: Glauber Costa <glommer@redhat.com>
Cc: kvm@vger.kernel.org, Marcelo Tosatti <mtosatti@redhat.com>
Subject: Re: [PATCH v2 2/6] reuse env stop and stopped states
Date: Tue, 28 Jul 2009 16:45:46 +0300 [thread overview]
Message-ID: <4A6F010A.1090004@redhat.com> (raw)
In-Reply-To: <4A6E97E1.9050902@redhat.com>
On 07/28/2009 09:17 AM, Avi Kivity wrote:
>> I found out that doing kill -38<your_pid> makes it run again, so
>> we're likely
>> hanging somewhere while holding qemu_mutex. The state of the process
>> is "D",
>> so we're holding qemu_mutex, and then calling something that can block.
>
> Sounds like we call a vcpu ioctl from the iothread (or from a
> different vcpu thread).
That's indeed the case. We reload the local apic state from the
iothread instead of the vcpu thread. Please write a patch to fix this.
>> It's hard for me to believe that this patch introduced it. At best,
>> it might have
>> made it more likely. Also, I also verified that it sometimes takes a
>> while until
>> it happen for the first time. Are you sure this is the first patch
>> that makes it happen?
>
> I haven't been able to reproduce it before this patch. Maybe this
> patch doesn't introduce it, only exposes it.
>
It does. The root problem is that env->stopped is cleared during reset,
so pause_all_threads() doesn't work:
uint32_t stop; /* Stop request */ \
uint32_t stopped; /* Artificially stopped */ \
...
/* from this point: preserved by CPU reset */ \
This kind of bug is incredibly hard to find - you now owe Gleb a solar
mass worth of beer. IMO we shouldn't be coding like this, please patch
upstream to explicitly clear what needs clearing.
I'm now testing the simple fix (moving the variables after the memset
point).
--
error compiling committee.c: too many arguments to function
prev parent reply other threads:[~2009-07-28 13:41 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-07-21 22:13 [PATCH v2 0/6] Glauber Costa
2009-07-21 22:13 ` [PATCH v2 1/6] remove kvm_in* functions Glauber Costa
2009-07-21 22:13 ` [PATCH v2 2/6] reuse env stop and stopped states Glauber Costa
2009-07-21 22:13 ` [PATCH v2 3/6] remove kvm_abi variable Glauber Costa
2009-07-21 22:13 ` [PATCH v2 4/6] remove created from kvm_state Glauber Costa
2009-07-21 22:13 ` [PATCH v2 5/6] remove kvm_specific kvm_out* functions Glauber Costa
2009-07-21 22:13 ` [PATCH v2 6/6] remove kvm_mmio_read and kvm_mmio_write Glauber Costa
2009-07-25 15:24 ` Marcelo Tosatti
2009-07-27 17:47 ` Glauber Costa
2009-07-22 19:50 ` [PATCH v2 5/6] remove kvm_specific kvm_out* functions Marcelo Tosatti
2009-07-23 5:47 ` Gleb Natapov
2009-07-22 19:51 ` [PATCH v2 3/6] remove kvm_abi variable Marcelo Tosatti
2009-07-27 15:43 ` [PATCH v2 2/6] reuse env stop and stopped states Avi Kivity
2009-07-28 0:48 ` Glauber Costa
2009-07-28 6:17 ` Avi Kivity
2009-07-28 6:24 ` Gleb Natapov
2009-07-28 6:28 ` Avi Kivity
2009-07-28 6:29 ` Gleb Natapov
2009-07-28 6:31 ` Avi Kivity
2009-07-28 13:45 ` Avi Kivity [this message]
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=4A6F010A.1090004@redhat.com \
--to=avi@redhat.com \
--cc=glommer@redhat.com \
--cc=kvm@vger.kernel.org \
--cc=mtosatti@redhat.com \
/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.