From: Marcelo Tosatti <mtosatti@redhat.com>
To: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Avi Kivity <avi@redhat.com>,
kvm@vger.kernel.org, Alexander Graf <agraf@suse.de>,
Paul Mackerras <paulus@au1.ibm.com>,
kvm-ppc@vger.kernel.org
Subject: Re: Reset problem vs. MMIO emulation, hypercalls, etc...
Date: Fri, 03 Aug 2012 17:41:13 +0000 [thread overview]
Message-ID: <20120803174113.GA13174@amt.cnet> (raw)
In-Reply-To: <1343938818.6911.9.camel@pasglop>
On Fri, Aug 03, 2012 at 06:20:18AM +1000, Benjamin Herrenschmidt wrote:
> On Thu, 2012-08-02 at 15:35 +0300, Avi Kivity wrote:
> > This is actually documented in api.txt, though not in relation to
> > reset:
> >
> > NOTE: For KVM_EXIT_IO, KVM_EXIT_MMIO and KVM_EXIT_OSI, the
> > corresponding operations are complete (and guest state is
> > consistent)
> > only after userspace has re-entered the kernel with KVM_RUN. The
> > kernel side will first finish incomplete operations and then check
> > for pending signals. Userspace can re-enter the guest with an
> > unmasked signal pending to complete pending operations.
> >
> > For x86 the issue was with live migration - you can't copy guest
> > register state in the middle of an I/O operation. Reset is actually
> > similar, but it involves writing state (which can then be overwritten)
> > instead of reading it.
>
> Hrm, except that doing KVM_RUN with a signal is very cumbersome to do
> and I couldn't quite find the logic in qemu to do it ... but I might
> just have missed it. I can see indeed that in the migration case you
> want to actually complete the operation rather than just "abort it".
>
> Any chance you can point me to the code that performs that trick qemu
> side for migration ?
kvm-all.c:
kvm_arch_pre_run(env, run);
if (env->exit_request) {
DPRINTF("interrupt exit requested\n");
/*
* KVM requires us to reenter the kernel after IO exits to
* complete
* instruction emulation. This self-signal will ensure that
* we
* leave ASAP again.
*/
qemu_cpu_kick_self();
}
> Anthony seems to think that for reset we can just abort the operation
> state in the kernel when the MP state changes.
>
> Cheers,
> Ben.
next prev parent reply other threads:[~2012-08-03 17:41 UTC|newest]
Thread overview: 31+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-08-01 3:17 Reset problem vs. MMIO emulation, hypercalls, etc Benjamin Herrenschmidt
2012-08-02 10:46 ` Alexander Graf
2012-08-02 12:22 ` Benjamin Herrenschmidt
2012-08-02 12:35 ` Avi Kivity
2012-08-02 12:59 ` Alexander Graf
2012-08-02 13:05 ` Avi Kivity
2012-08-02 20:29 ` Benjamin Herrenschmidt
2012-08-05 8:55 ` Avi Kivity
2012-08-05 20:45 ` Benjamin Herrenschmidt
2012-08-02 20:20 ` Benjamin Herrenschmidt
2012-08-03 17:41 ` Marcelo Tosatti [this message]
2012-08-03 18:05 ` Marcelo Tosatti
2012-08-03 22:32 ` Benjamin Herrenschmidt
2012-08-05 9:00 ` Avi Kivity
2012-08-06 20:25 ` Scott Wood
2012-08-07 8:44 ` Avi Kivity
2012-08-06 20:54 ` Benjamin Herrenschmidt
2012-08-03 22:30 ` Benjamin Herrenschmidt
2012-08-06 3:13 ` David Gibson
2012-08-06 20:57 ` Benjamin Herrenschmidt
2012-08-07 1:32 ` David Gibson
2012-08-07 8:46 ` Avi Kivity
2012-08-07 12:14 ` David Gibson
2012-08-07 13:13 ` Avi Kivity
2012-08-07 21:09 ` Benjamin Herrenschmidt
2012-08-08 8:52 ` Avi Kivity
2012-08-08 9:27 ` Benjamin Herrenschmidt
2012-08-08 0:49 ` David Gibson
2012-08-08 8:58 ` Avi Kivity
2012-08-08 11:59 ` David Gibson
2012-08-08 12:42 ` Avi Kivity
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=20120803174113.GA13174@amt.cnet \
--to=mtosatti@redhat.com \
--cc=agraf@suse.de \
--cc=avi@redhat.com \
--cc=benh@kernel.crashing.org \
--cc=kvm-ppc@vger.kernel.org \
--cc=kvm@vger.kernel.org \
--cc=paulus@au1.ibm.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