From: Avi Kivity <avi@redhat.com>
To: Marcelo Tosatti <mtosatti@redhat.com>
Cc: kvm@vger.kernel.org, quintela@redhat.com,
Gleb Natapov <gleb@redhat.com>, Alexander Graf <agraf@suse.de>
Subject: Re: qemu-kvm: do not allow vcpu stop with in progress PIO
Date: Wed, 10 Feb 2010 18:40:11 +0200 [thread overview]
Message-ID: <4B72E16B.7080704@redhat.com> (raw)
In-Reply-To: <20100210162523.GD23089@amt.cnet>
On 02/10/2010 06:25 PM, Marcelo Tosatti wrote:
> On Wed, Feb 10, 2010 at 09:02:00AM +0200, Avi Kivity wrote:
>
>> On 02/09/2010 10:58 PM, Marcelo Tosatti wrote:
>>
>>> You're right... this should be enough to avoid a stop with uncomplete
>>> PIO (and this is what happens for MMIO already). The signal will not
>>> be dequeued, so KVM will complete_pio and exit before entering with
>>> -EAGAIN. Please review and queue for stable.
>>>
>>>
>> Not right enough. This is very fragile, we depend on the kernel
>> noticing the signal after completing pio but before starting
>> execution. I don't think we guarantee that.
>>
> As long as the signal is blocked, we do (and for older kernels too).
>
I meant, that was not an intentional part of the design, but rather a
side effect of the implementation. We can pretend it was all part of a
master plan and document it, though.
>> Maybe we should turn complete_pio/complete_mmio to an ioctl, so that
>> we can control what happens exactly. Or maybe it's simplest to
>> document it as a feature and guarantee it. There's some merit in it
>> - only guest execution is the nonatomic part, so we only interrupt
>> that.
>>
> Right. So would you like a patch to x86.c to comment on this, on top of
> complete_pio / mmio completion?
>
Documentation/kvm/api.txt. Note it's not x86 specific. Alex, can you
check if ppc complies?
>>> qemu upstream needs a bit more work.
>>>
>> Could be as simple as raising a blocked exception that is unmasked
>> by kvm, then entering the guest.
>>
> The vcpu inner loop is not atomic in upstream as it is in qemu-kvm. It
> breaks out to process pending events way too easily.
>
Hmm. We can add an explicit call to KVM_RUN.
Note we need to loop there. My 16-byte mmio patches (which never saw
the light of day) split 16-byte mmios into two 8-byte mmios issued back
to back, and we have to be prepared for that eventuality.
--
error compiling committee.c: too many arguments to function
next prev parent reply other threads:[~2010-02-10 16:40 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-01-28 19:03 [patch 0/3] save/restore in-progress PIO Marcelo Tosatti
2010-01-28 19:03 ` [patch 1/3] KVM: x86: add ioctls to get/set PIO state Marcelo Tosatti
2010-02-04 19:16 ` Avi Kivity
2010-02-04 21:36 ` Marcelo Tosatti
2010-02-04 21:46 ` Avi Kivity
2010-02-04 22:12 ` Marcelo Tosatti
2010-02-04 22:45 ` Marcelo Tosatti
2010-02-08 22:41 ` Marcelo Tosatti
2010-02-09 6:38 ` Avi Kivity
2010-02-09 18:23 ` Marcelo Tosatti
2010-02-09 20:58 ` qemu-kvm: do not allow vcpu stop with in progress PIO Marcelo Tosatti
2010-02-10 7:02 ` Avi Kivity
2010-02-10 16:25 ` Marcelo Tosatti
2010-02-10 16:40 ` Avi Kivity [this message]
2010-02-10 16:52 ` Alexander Graf
2010-02-10 17:01 ` Avi Kivity
2010-02-10 17:03 ` Alexander Graf
2010-02-10 17:08 ` Avi Kivity
2010-02-10 17:07 ` Gleb Natapov
2010-02-10 17:08 ` Avi Kivity
2010-02-13 18:10 ` KVM: add doc note about PIO/MMIO completion API Marcelo Tosatti
2010-02-14 8:17 ` Avi Kivity
2010-02-17 9:22 ` Avi Kivity
2010-02-18 13:24 ` qemu-kvm: do not allow vcpu stop with in progress PIO Avi Kivity
2010-01-28 19:03 ` [patch 2/3] uqmaster: save/restore pio state Marcelo Tosatti
2010-01-28 19:03 ` [patch 3/3] uqmaster: save/restore PIO page Marcelo Tosatti
2010-01-28 20:24 ` Anthony Liguori
2010-01-28 21:10 ` Marcelo Tosatti
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=4B72E16B.7080704@redhat.com \
--to=avi@redhat.com \
--cc=agraf@suse.de \
--cc=gleb@redhat.com \
--cc=kvm@vger.kernel.org \
--cc=mtosatti@redhat.com \
--cc=quintela@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox