From: gleb@redhat.com (Gleb Natapov)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v5 07/14] KVM: ARM: World-switch implementation
Date: Wed, 16 Jan 2013 18:17:48 +0200 [thread overview]
Message-ID: <20130116161748.GY11529@redhat.com> (raw)
In-Reply-To: <CANM98qJ7O8RT_t0OinGDukdR5PNrObmU0rj6uFGEbT2hCvCjmA@mail.gmail.com>
On Wed, Jan 16, 2013 at 10:40:37AM -0500, Christoffer Dall wrote:
> [...]
>
> >>
> >
> > Agree. Lets merge it and change later. The vcpu run loop is simple
> > enough at this point. The question of using vcpu->requests is not
> > the question of "real benefit" though, of course you can introduce your
> > own mechanism to pass requests to vcpus instead of using whatever kvm
> > provides you. But from maintenance and code share point of view this
> > is wrong thing to do. Looks at this code for instance:
> >
> > /* Kick out any which are still running. */
> > kvm_for_each_vcpu(i, v, vcpu->kvm) {
> > /* Guest could exit now, making cpu wrong. That's OK. */
> > if (kvm_vcpu_exiting_guest_mode(v) == IN_GUEST_MODE) {
> > force_vm_exit(get_cpu_mask(v->cpu));
> > }
> > }
> >
> > Why not make_all_cpus_request(vcpu->kvm, KVM_REQ_PAUSE)?
>
> well for one, make_all_cpus_request is a static function in kvm_main.c
> and the semantics of that one is really tricky with respect to locking
> and requires (imho) a much clearer explanation with commenting (see
> separate e-mail to kvm list). And now is not the time to do this.
>
All current users add exported function that calls
make_all_cpus_request(). But this is very valid question why just not
export it directly. Patch is welcome :)
> >
> > And I am not sure KVM_REQ_UNHALT is so useless to you in the first
> > place. kvm_vcpu_block() can return even when vcpu is not runnable (if
> > signal is pending). KVM_REQ_UNHALT is the way to check for that. Hmm
> > this is actually looks like a BUG in the current code.
> >
> there's no guarantee that you won't be woken up from a WFI instruction
> for spurious interrupts on ARM, so we don't care about this, we simply
> return to the guest, and it must go back to sleep if that's what it
> wants to do.
>
If guest can handle it then we can ignore it (at least for now), but still
it's strange that signal unhalts vcpu.
--
Gleb.
WARNING: multiple messages have this Message-ID (diff)
From: Gleb Natapov <gleb@redhat.com>
To: Christoffer Dall <c.dall@virtualopensystems.com>
Cc: kvm@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
kvmarm@lists.cs.columbia.edu, Marc Zyngier <marc.zyngier@arm.com>,
Antonios Motakis <a.motakis@virtualopensystems.com>,
Marcelo Tosatti <mtosatti@redhat.com>,
Rusty Russell <rusty@rustcorp.com.au>,
nicolas@viennot.biz
Subject: Re: [PATCH v5 07/14] KVM: ARM: World-switch implementation
Date: Wed, 16 Jan 2013 18:17:48 +0200 [thread overview]
Message-ID: <20130116161748.GY11529@redhat.com> (raw)
In-Reply-To: <CANM98qJ7O8RT_t0OinGDukdR5PNrObmU0rj6uFGEbT2hCvCjmA@mail.gmail.com>
On Wed, Jan 16, 2013 at 10:40:37AM -0500, Christoffer Dall wrote:
> [...]
>
> >>
> >
> > Agree. Lets merge it and change later. The vcpu run loop is simple
> > enough at this point. The question of using vcpu->requests is not
> > the question of "real benefit" though, of course you can introduce your
> > own mechanism to pass requests to vcpus instead of using whatever kvm
> > provides you. But from maintenance and code share point of view this
> > is wrong thing to do. Looks at this code for instance:
> >
> > /* Kick out any which are still running. */
> > kvm_for_each_vcpu(i, v, vcpu->kvm) {
> > /* Guest could exit now, making cpu wrong. That's OK. */
> > if (kvm_vcpu_exiting_guest_mode(v) == IN_GUEST_MODE) {
> > force_vm_exit(get_cpu_mask(v->cpu));
> > }
> > }
> >
> > Why not make_all_cpus_request(vcpu->kvm, KVM_REQ_PAUSE)?
>
> well for one, make_all_cpus_request is a static function in kvm_main.c
> and the semantics of that one is really tricky with respect to locking
> and requires (imho) a much clearer explanation with commenting (see
> separate e-mail to kvm list). And now is not the time to do this.
>
All current users add exported function that calls
make_all_cpus_request(). But this is very valid question why just not
export it directly. Patch is welcome :)
> >
> > And I am not sure KVM_REQ_UNHALT is so useless to you in the first
> > place. kvm_vcpu_block() can return even when vcpu is not runnable (if
> > signal is pending). KVM_REQ_UNHALT is the way to check for that. Hmm
> > this is actually looks like a BUG in the current code.
> >
> there's no guarantee that you won't be woken up from a WFI instruction
> for spurious interrupts on ARM, so we don't care about this, we simply
> return to the guest, and it must go back to sleep if that's what it
> wants to do.
>
If guest can handle it then we can ignore it (at least for now), but still
it's strange that signal unhalts vcpu.
--
Gleb.
next prev parent reply other threads:[~2013-01-16 16:17 UTC|newest]
Thread overview: 160+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-01-08 18:38 [PATCH v5 00/14] KVM/ARM Implementation Christoffer Dall
2013-01-08 18:38 ` Christoffer Dall
2013-01-08 18:38 ` [PATCH v5 01/14] ARM: Add page table and page defines needed by KVM Christoffer Dall
2013-01-08 18:38 ` Christoffer Dall
2013-01-08 18:38 ` [PATCH v5 02/14] ARM: Section based HYP idmap Christoffer Dall
2013-01-08 18:38 ` Christoffer Dall
2013-01-14 10:27 ` Gleb Natapov
2013-01-14 10:27 ` Gleb Natapov
2013-01-14 10:49 ` Will Deacon
2013-01-14 10:49 ` Will Deacon
2013-01-14 11:07 ` Gleb Natapov
2013-01-14 11:07 ` Gleb Natapov
2013-01-14 13:07 ` Russell King - ARM Linux
2013-01-14 13:07 ` Russell King - ARM Linux
2013-01-14 16:13 ` Russell King - ARM Linux
2013-01-14 16:13 ` Russell King - ARM Linux
2013-01-14 17:09 ` Christoffer Dall
2013-01-14 17:09 ` Christoffer Dall
2013-01-08 18:38 ` [PATCH v5 03/14] KVM: ARM: Initial skeleton to compile KVM support Christoffer Dall
2013-01-08 18:38 ` Christoffer Dall
2013-01-14 15:09 ` Will Deacon
2013-01-14 15:09 ` Will Deacon
2013-01-14 15:40 ` Christoffer Dall
2013-01-14 15:40 ` Christoffer Dall
2013-01-14 16:24 ` Russell King - ARM Linux
2013-01-14 16:24 ` Russell King - ARM Linux
2013-01-14 17:33 ` Christoffer Dall
2013-01-14 17:33 ` Christoffer Dall
2013-01-16 2:56 ` Rusty Russell
2013-01-16 2:56 ` Rusty Russell
2013-01-16 9:44 ` Russell King - ARM Linux
2013-01-16 9:44 ` Russell King - ARM Linux
2013-01-17 2:11 ` Rusty Russell
2013-01-17 2:11 ` Rusty Russell
2013-01-14 18:49 ` Gleb Natapov
2013-01-14 18:49 ` Gleb Natapov
2013-01-14 22:17 ` Christoffer Dall
2013-01-14 22:17 ` Christoffer Dall
2013-01-15 13:32 ` Gleb Natapov
2013-01-15 13:32 ` Gleb Natapov
2013-01-15 13:43 ` [kvmarm] " Alexander Graf
2013-01-15 13:43 ` Alexander Graf
2013-01-15 15:35 ` Gleb Natapov
2013-01-15 15:35 ` Gleb Natapov
2013-01-15 16:21 ` Alexander Graf
2013-01-15 16:21 ` Alexander Graf
2013-01-08 18:39 ` [PATCH v5 04/14] KVM: ARM: Hypervisor initialization Christoffer Dall
2013-01-08 18:39 ` Christoffer Dall
2013-01-14 15:11 ` Will Deacon
2013-01-14 15:11 ` Will Deacon
2013-01-14 16:35 ` Christoffer Dall
2013-01-14 16:35 ` Christoffer Dall
2013-01-08 18:39 ` [PATCH v5 05/14] KVM: ARM: Memory virtualization setup Christoffer Dall
2013-01-08 18:39 ` Christoffer Dall
2013-01-08 18:39 ` [PATCH v5 06/14] KVM: ARM: Inject IRQs and FIQs from userspace Christoffer Dall
2013-01-08 18:39 ` Christoffer Dall
2013-01-15 9:56 ` Gleb Natapov
2013-01-15 9:56 ` Gleb Natapov
2013-01-15 12:15 ` [kvmarm] " Peter Maydell
2013-01-15 12:15 ` Peter Maydell
2013-01-15 12:52 ` Gleb Natapov
2013-01-15 12:52 ` Gleb Natapov
2013-01-15 14:04 ` Peter Maydell
2013-01-15 14:04 ` Peter Maydell
2013-01-15 14:40 ` Christoffer Dall
2013-01-15 14:40 ` Christoffer Dall
2013-01-15 15:17 ` Gleb Natapov
2013-01-15 15:17 ` Gleb Natapov
2013-01-15 16:25 ` Alexander Graf
2013-01-15 16:25 ` Alexander Graf
2013-01-16 10:40 ` Gleb Natapov
2013-01-16 10:40 ` Gleb Natapov
2013-01-08 18:39 ` [PATCH v5 07/14] KVM: ARM: World-switch implementation Christoffer Dall
2013-01-08 18:39 ` Christoffer Dall
2013-01-15 9:43 ` Gleb Natapov
2013-01-15 9:43 ` Gleb Natapov
2013-01-16 2:08 ` Christoffer Dall
2013-01-16 2:08 ` Christoffer Dall
2013-01-16 4:08 ` Christoffer Dall
2013-01-16 4:08 ` Christoffer Dall
2013-01-16 12:57 ` Gleb Natapov
2013-01-16 12:57 ` Gleb Natapov
2013-01-16 15:40 ` Christoffer Dall
2013-01-16 15:40 ` Christoffer Dall
2013-01-16 16:17 ` Gleb Natapov [this message]
2013-01-16 16:17 ` Gleb Natapov
2013-01-16 12:12 ` Gleb Natapov
2013-01-16 12:12 ` Gleb Natapov
2013-01-16 13:14 ` Russell King - ARM Linux
2013-01-16 13:14 ` Russell King - ARM Linux
2013-01-16 15:42 ` Christoffer Dall
2013-01-16 15:42 ` Christoffer Dall
2013-01-16 15:52 ` Gleb Natapov
2013-01-16 15:52 ` Gleb Natapov
2013-01-16 16:17 ` Christoffer Dall
2013-01-16 16:17 ` Christoffer Dall
2013-01-16 16:21 ` Gleb Natapov
2013-01-16 16:21 ` Gleb Natapov
2013-01-08 18:39 ` [PATCH v5 08/14] KVM: ARM: Emulation framework and CP15 emulation Christoffer Dall
2013-01-08 18:39 ` Christoffer Dall
2013-01-14 16:36 ` Russell King - ARM Linux
2013-01-14 16:36 ` Russell King - ARM Linux
2013-01-14 17:38 ` Christoffer Dall
2013-01-14 17:38 ` Christoffer Dall
2013-01-14 18:33 ` Russell King - ARM Linux
2013-01-14 18:33 ` Russell King - ARM Linux
2013-01-08 18:39 ` [PATCH v5 09/14] KVM: ARM: User space API for getting/setting co-proc registers Christoffer Dall
2013-01-08 18:39 ` Christoffer Dall
2013-01-08 18:39 ` [PATCH v5 10/14] KVM: ARM: Demux CCSIDR in the userspace API Christoffer Dall
2013-01-08 18:39 ` Christoffer Dall
2013-01-08 18:39 ` [PATCH v5 11/14] KVM: ARM: VFP userspace interface Christoffer Dall
2013-01-08 18:39 ` Christoffer Dall
2013-01-08 18:39 ` [PATCH v5 12/14] KVM: ARM: Handle guest faults in KVM Christoffer Dall
2013-01-08 18:39 ` Christoffer Dall
2013-01-08 18:40 ` [PATCH v5 13/14] KVM: ARM: Handle I/O aborts Christoffer Dall
2013-01-08 18:40 ` Christoffer Dall
2013-01-14 16:43 ` Russell King - ARM Linux
2013-01-14 16:43 ` Russell King - ARM Linux
2013-01-14 18:25 ` Christoffer Dall
2013-01-14 18:25 ` Christoffer Dall
2013-01-14 18:43 ` Russell King - ARM Linux
2013-01-14 18:43 ` Russell King - ARM Linux
2013-01-14 18:50 ` Will Deacon
2013-01-14 18:50 ` Will Deacon
2013-01-14 18:53 ` [kvmarm] " Alexander Graf
2013-01-14 18:53 ` Alexander Graf
2013-01-14 18:56 ` Christoffer Dall
2013-01-14 18:56 ` Christoffer Dall
2013-01-14 19:00 ` Will Deacon
2013-01-14 19:00 ` Will Deacon
2013-01-14 19:12 ` Christoffer Dall
2013-01-14 19:12 ` Christoffer Dall
2013-01-14 22:36 ` Will Deacon
2013-01-14 22:36 ` Will Deacon
2013-01-14 22:51 ` Christoffer Dall
2013-01-14 22:51 ` Christoffer Dall
2013-01-15 7:00 ` Gleb Natapov
2013-01-15 7:00 ` Gleb Natapov
2013-01-15 13:18 ` Gleb Natapov
2013-01-15 13:18 ` Gleb Natapov
2013-01-15 13:29 ` Marc Zyngier
2013-01-15 13:29 ` Marc Zyngier
2013-01-15 13:34 ` Gleb Natapov
2013-01-15 13:34 ` Gleb Natapov
2013-01-15 13:46 ` Marc Zyngier
2013-01-15 13:46 ` Marc Zyngier
2013-01-15 14:27 ` Gleb Natapov
2013-01-15 14:27 ` Gleb Natapov
2013-01-15 14:42 ` Christoffer Dall
2013-01-15 14:42 ` Christoffer Dall
2013-01-15 14:48 ` Marc Zyngier
2013-01-15 14:48 ` Marc Zyngier
2013-01-15 15:31 ` Gleb Natapov
2013-01-15 15:31 ` Gleb Natapov
2013-01-08 18:40 ` [PATCH v5 14/14] KVM: ARM: Add maintainer entry for KVM/ARM Christoffer Dall
2013-01-08 18:40 ` Christoffer Dall
2013-01-14 16:00 ` [PATCH v5 00/14] KVM/ARM Implementation Will Deacon
2013-01-14 16:00 ` Will Deacon
2013-01-14 22:31 ` Christoffer Dall
2013-01-14 22:31 ` Christoffer Dall
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=20130116161748.GY11529@redhat.com \
--to=gleb@redhat.com \
--cc=linux-arm-kernel@lists.infradead.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.