From: Scott Wood <scottwood@freescale.com>
To: Alexander Graf <agraf@suse.de>
Cc: linuxppc-dev@lists.ozlabs.org, kvm@vger.kernel.org,
kvm-ppc@vger.kernel.org
Subject: Re: [PATCH 24/37] KVM: PPC: booke: rework rescheduling checks
Date: Mon, 27 Feb 2012 13:28:27 -0600 [thread overview]
Message-ID: <4F4BD95B.9010809@freescale.com> (raw)
In-Reply-To: <1330093591-19523-25-git-send-email-agraf@suse.de>
On 02/24/2012 08:26 AM, Alexander Graf wrote:
> -void kvmppc_core_prepare_to_enter(struct kvm_vcpu *vcpu)
> +int kvmppc_core_prepare_to_enter(struct kvm_vcpu *vcpu)
> {
> unsigned long *pending = &vcpu->arch.pending_exceptions;
> unsigned long old_pending = vcpu->arch.pending_exceptions;
> @@ -283,6 +283,8 @@ void kvmppc_core_prepare_to_enter(struct kvm_vcpu *vcpu)
>
> /* Tell the guest about our interrupt status */
> kvmppc_update_int_pending(vcpu, *pending, old_pending);
> +
> + return 0;
> }
>
> pfn_t kvmppc_gfn_to_pfn(struct kvm_vcpu *vcpu, gfn_t gfn)
> diff --git a/arch/powerpc/kvm/booke.c b/arch/powerpc/kvm/booke.c
> index 9979be1..3fcec2c 100644
> --- a/arch/powerpc/kvm/booke.c
> +++ b/arch/powerpc/kvm/booke.c
> @@ -439,8 +439,9 @@ static void kvmppc_core_check_exceptions(struct kvm_vcpu *vcpu)
> }
>
> /* Check pending exceptions and deliver one, if possible. */
> -void kvmppc_core_prepare_to_enter(struct kvm_vcpu *vcpu)
> +int kvmppc_core_prepare_to_enter(struct kvm_vcpu *vcpu)
> {
> + int r = 0;
> WARN_ON_ONCE(!irqs_disabled());
>
> kvmppc_core_check_exceptions(vcpu);
> @@ -451,8 +452,44 @@ void kvmppc_core_prepare_to_enter(struct kvm_vcpu *vcpu)
> local_irq_disable();
>
> kvmppc_set_exit_type(vcpu, EMULATED_MTMSRWE_EXITS);
> - kvmppc_core_check_exceptions(vcpu);
> + r = 1;
> };
> +
> + return r;
> +}
> +
> +/*
> + * Common checks before entering the guest world. Call with interrupts
> + * disabled.
> + *
> + * returns !0 if a signal is pending and check_signal is true
> + */
> +static int kvmppc_prepare_to_enter(struct kvm_vcpu *vcpu, bool check_signal)
> +{
> + int r = 0;
> +
> + WARN_ON_ONCE(!irqs_disabled());
> + while (true) {
> + if (need_resched()) {
> + local_irq_enable();
> + cond_resched();
> + local_irq_disable();
> + continue;
> + }
> +
> + if (kvmppc_core_prepare_to_enter(vcpu)) {
> + /* interrupts got enabled in between, so we
> + are back at square 1 */
> + continue;
> + }
> +
> +
> + if (check_signal && signal_pending(current))
> + r = 1;
If there is a signal pending and MSR[WE] is set, we'll loop forever
without reaching this check.
-Scott
next prev parent reply other threads:[~2012-02-27 19:28 UTC|newest]
Thread overview: 51+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-02-24 14:25 [PATCH 00/37] KVM: PPC: e500mc support v2 Alexander Graf
2012-02-24 14:25 ` [PATCH 01/37] powerpc/booke: Set CPU_FTR_DEBUG_LVL_EXC on 32-bit Alexander Graf
2012-02-24 14:25 ` [PATCH 02/37] powerpc/e500: split CPU_FTRS_ALWAYS/CPU_FTRS_POSSIBLE Alexander Graf
2012-02-24 14:25 ` [PATCH 03/37] KVM: PPC: factor out lpid allocator from book3s_64_mmu_hv Alexander Graf
2012-02-24 14:25 ` [PATCH 04/37] KVM: PPC: booke: add booke-level vcpu load/put Alexander Graf
2012-02-24 14:25 ` [PATCH 05/37] KVM: PPC: booke: Move vm core init/destroy out of booke.c Alexander Graf
2012-02-24 14:26 ` [PATCH 06/37] KVM: PPC: e500: rename e500_tlb.h to e500.h Alexander Graf
2012-02-24 14:26 ` [PATCH 07/37] KVM: PPC: e500: merge <asm/kvm_e500.h> into arch/powerpc/kvm/e500.h Alexander Graf
2012-02-24 14:26 ` [PATCH 08/37] KVM: PPC: e500: clean up arch/powerpc/kvm/e500.h Alexander Graf
2012-02-24 14:26 ` [PATCH 09/37] KVM: PPC: e500: refactor core-specific TLB code Alexander Graf
2012-02-24 14:26 ` [PATCH 10/37] KVM: PPC: e500: Track TLB1 entries with a bitmap Alexander Graf
2012-02-24 14:26 ` [PATCH 11/37] KVM: PPC: e500: emulate tlbilx Alexander Graf
2012-02-24 14:26 ` [PATCH 12/37] powerpc/booke: Provide exception macros with interrupt name Alexander Graf
2012-02-24 14:26 ` [PATCH 13/37] KVM: PPC: booke: category E.HV (GS-mode) support Alexander Graf
2012-02-24 14:26 ` [PATCH 14/37] KVM: PPC: booke: standard PPC floating point support Alexander Graf
2012-02-24 14:26 ` [PATCH 15/37] KVM: PPC: e500mc support Alexander Graf
2012-02-24 14:26 ` [PATCH 16/37] KVM: PPC: e500mc: Add doorbell emulation support Alexander Graf
2012-02-24 14:26 ` [PATCH 17/37] KVM: PPC: e500mc: implicitly set MSR_GS Alexander Graf
2012-02-24 14:26 ` [PATCH 18/37] KVM: PPC: e500mc: Move r1/r2 restoration very early Alexander Graf
2012-02-24 14:26 ` [PATCH 19/37] KVM: PPC: e500mc: add load inst fixup Alexander Graf
2012-02-24 14:26 ` [PATCH 20/37] KVM: PPC: rename CONFIG_KVM_E500 -> CONFIG_KVM_E500V2 Alexander Graf
2012-02-24 14:26 ` [PATCH 21/37] KVM: PPC: make e500v2 kvm and e500mc cpu mutually exclusive Alexander Graf
2012-02-24 14:26 ` [PATCH 22/37] KVM: PPC: booke: remove leftover debugging Alexander Graf
2012-02-24 14:26 ` [PATCH 23/37] KVM: PPC: booke: deliver program int on emulation failure Alexander Graf
2012-02-24 14:26 ` [PATCH 24/37] KVM: PPC: booke: rework rescheduling checks Alexander Graf
2012-02-27 16:34 ` Bhushan Bharat-R65777
2012-02-27 17:33 ` Alexander Graf
2012-02-27 18:23 ` Alexander Graf
2012-02-27 18:29 ` Bhushan Bharat-R65777
2012-02-27 19:28 ` Scott Wood [this message]
2012-02-28 11:03 ` Alexander Graf
2012-02-28 17:21 ` Scott Wood
2012-02-24 14:26 ` [PATCH 25/37] KVM: PPC: booke: BOOKE_IRQPRIO_MAX is n+1 Alexander Graf
2012-02-24 14:26 ` [PATCH 26/37] KVM: PPC: bookehv: fix exit timing Alexander Graf
2012-02-24 14:26 ` [PATCH 27/37] KVM: PPC: bookehv: remove negation for CONFIG_64BIT Alexander Graf
2012-02-24 14:26 ` [PATCH 28/37] KVM: PPC: bookehv: remove SET_VCPU Alexander Graf
2012-02-24 14:26 ` [PATCH 29/37] KVM: PPC: bookehv: disable MAS register updates early Alexander Graf
2012-02-24 14:26 ` [PATCH 30/37] KVM: PPC: bookehv: add comment about shadow_msr Alexander Graf
2012-02-24 14:26 ` [PATCH 31/37] KVM: PPC: booke: Readd debug abort code for machine check Alexander Graf
2012-02-24 14:26 ` [PATCH 32/37] KVM: PPC: booke: add GS documentation for program interrupt Alexander Graf
2012-02-24 14:26 ` [PATCH 33/37] KVM: PPC: bookehv: remove unused code Alexander Graf
2012-02-24 23:31 ` Scott Wood
2012-02-24 14:26 ` [PATCH 34/37] KVM: PPC: e500: fix typo in tlb code Alexander Graf
2012-02-24 14:26 ` [PATCH 35/37] KVM: PPC: booke: Support perfmon interrupts Alexander Graf
2012-02-24 23:33 ` Scott Wood
2012-02-26 11:58 ` Alexander Graf
2012-02-24 14:26 ` [PATCH 36/37] KVM: PPC: booke: expose guest registers on irq reinject Alexander Graf
2012-02-24 23:40 ` Scott Wood
2012-02-26 11:59 ` Alexander Graf
2012-02-27 19:45 ` Scott Wood
2012-02-24 14:26 ` [PATCH 37/37] KVM: PPC: booke: Reinject performance monitor interrupts Alexander Graf
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=4F4BD95B.9010809@freescale.com \
--to=scottwood@freescale.com \
--cc=agraf@suse.de \
--cc=kvm-ppc@vger.kernel.org \
--cc=kvm@vger.kernel.org \
--cc=linuxppc-dev@lists.ozlabs.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).