From: Jan Kiszka <jan.kiszka@web.de>
To: Marcelo Tosatti <mtosatti@redhat.com>
Cc: Avi Kivity <avi@redhat.com>, Jan Kiszka <jan.kiszka@web.de>,
kvm <kvm@vger.kernel.org>, Gleb Natapov <gleb@redhat.com>
Subject: Re: [PATCH v2] KVM: x86: Extend KVM_SET_VCPU_EVENTS with selective updates
Date: Tue, 08 Dec 2009 22:17:06 +0100 [thread overview]
Message-ID: <4B1EC252.9040009@web.de> (raw)
In-Reply-To: <20091208205240.GA24565@amt.cnet>
[-- Attachment #1: Type: text/plain, Size: 1985 bytes --]
Marcelo Tosatti wrote:
> On Tue, Dec 08, 2009 at 04:07:32PM +0200, Avi Kivity wrote:
>> On 12/08/2009 04:02 PM, Marcelo Tosatti wrote:
>>> On Sun, Dec 06, 2009 at 06:24:15PM +0100, Jan Kiszka wrote:
>>>
>>>> User space may not want to overwrite asynchronously changing VCPU event
>>>> states on write-back. So allow to skip nmi.pending and sipi_vector by
>>>> setting corresponding bits in the flags field of kvm_vcpu_events.
>>>>
>>>> Signed-off-by: Jan Kiszka<jan.kiszka@siemens.com>
>>>>
>>> Can't you handle this in userspace entirely, only updating vcpu_events
>>> state when appropriate?
>>>
>> For what we do now I think you're right, it can be handled in userspace.
>>
>> But in general, there's currently no way to update vcpu_events without
>> overwriting nmi and sipi_vector, which can also be written concurrently
>> by other vcpus. So there's a hole in the interface.
>>
>>> Shouldnt the vcpu be stopped in the first place, when its state is
>>> updated?
>>>
>> It is stopped, but other vcpus are not.
>
> I don't see the need for setting any state in kvm_vcpu_events
> automatically, on kernel entry (apparently there was consensus that
> saving similar state explicitly in qemu was the way to go).
(I don't think so. IMHO the cleaner way is to avoid loading critical
states unless we are resetting or vmloading.)
>
> kvm_arch_put_registers in qemu saves mpstate now that way,
> and the same problem is present.
>
> The sites to load vcpu_events would be machine reset and cpu_load
> only, right?
That is how qemu use it, currently. But this interface should be
designed with more flexibility. For the (yet theoretical) case you want
to update RIP of a single VCPU, you also have to reset all the
context-related states but maybe not the asynchronously changing ones
like nmi.pending. We have no such use case yet, but KVM should not
prevent them by design (if the change is so trivial).
Jan
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 257 bytes --]
next prev parent reply other threads:[~2009-12-08 21:17 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-12-06 16:55 [PATCH] KVM: x86: Extend KVM_SET_VCPU_EVENTS with selective updates Jan Kiszka
2009-12-06 17:05 ` Avi Kivity
2009-12-06 17:12 ` Jan Kiszka
2009-12-15 14:54 ` Avi Kivity
2009-12-15 16:41 ` Jan Kiszka
2009-12-15 17:08 ` Avi Kivity
2009-12-15 22:57 ` [PATCH] KVM: x86: Adjust KVM_VCPUEVENT flag names Jan Kiszka
2009-12-16 9:59 ` Avi Kivity
2009-12-06 17:24 ` [PATCH v2] KVM: x86: Extend KVM_SET_VCPU_EVENTS with selective updates Jan Kiszka
2009-12-08 14:02 ` Marcelo Tosatti
2009-12-08 14:07 ` Avi Kivity
2009-12-08 20:52 ` Marcelo Tosatti
2009-12-08 21:17 ` Jan Kiszka [this message]
2009-12-15 14:50 ` Avi Kivity
2009-12-15 16:43 ` Jan Kiszka
2009-12-15 17:10 ` Avi Kivity
2009-12-15 17:29 ` Jan Kiszka
2009-12-14 10:32 ` [PATCH] " Jan Kiszka
2009-12-14 10:34 ` 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=4B1EC252.9040009@web.de \
--to=jan.kiszka@web.de \
--cc=avi@redhat.com \
--cc=gleb@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.