public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: "\"“tiejun.chen”\"" <tiejun.chen@windriver.com>
To: <agraf@suse.de>
Cc: <scottwood@freescale.com>, <kvm@vger.kernel.org>,
	<kvm-ppc@vger.kernel.org>
Subject: Re: [v5][PATCH] KVM: PPC: Book3E HV: call RECONCILE_IRQ_STATE to sync the software state
Date: Mon, 18 Nov 2013 16:34:21 +0800	[thread overview]
Message-ID: <5289D10D.5020506@windriver.com> (raw)
In-Reply-To: <1382491608-4535-1-git-send-email-tiejun.chen@windriver.com>

On 10/23/2013 09:26 AM, Tiejun Chen wrote:
> We enter with interrupts disabled in hardware, but we need to
> call RECONCILE_IRQ_STATE anyway to ensure that the software state
> is kept in sync instead of calling hard_irq_disable() directly.
>
> Signed-off-by: Tiejun Chen <tiejun.chen@windriver.com>
> ---
> v5:
>
> Fix one typo in the comment.

Alex,

I already addressed Scott's comment, any further feedback?

Tiejun

>
> v4:
>
> Fix one typo in the patch description.
>
> v3:
>
> Base on the latest tree, now we can use RECONCILE_IRQ_STATE instead of SOFT_DISABLE_INTS.
>
> v2:
>
> Move SOFT_DISABLE_INTS[1] earlier to avoid clobbering the arguments we want to pass to kvmppc_handle_exit.
>
>   arch/powerpc/kvm/booke.c              |   11 -----------
>   arch/powerpc/kvm/bookehv_interrupts.S |   11 +++++++++++
>   2 files changed, 11 insertions(+), 11 deletions(-)
>
> diff --git a/arch/powerpc/kvm/booke.c b/arch/powerpc/kvm/booke.c
> index 15d0149..0d211ff 100644
> --- a/arch/powerpc/kvm/booke.c
> +++ b/arch/powerpc/kvm/booke.c
> @@ -899,17 +899,6 @@ int kvmppc_handle_exit(struct kvm_run *run, struct kvm_vcpu *vcpu,
>   	int s;
>   	int idx;
>
> -#ifdef CONFIG_PPC64
> -	WARN_ON(local_paca->irq_happened != 0);
> -#endif
> -
> -	/*
> -	 * We enter with interrupts disabled in hardware, but
> -	 * we need to call hard_irq_disable anyway to ensure that
> -	 * the software state is kept in sync.
> -	 */
> -	hard_irq_disable();
> -
>   	/* update before a new last_exit_type is rewritten */
>   	kvmppc_update_timing_stats(vcpu);
>
> diff --git a/arch/powerpc/kvm/bookehv_interrupts.S b/arch/powerpc/kvm/bookehv_interrupts.S
> index e8ed7d6..191c32b 100644
> --- a/arch/powerpc/kvm/bookehv_interrupts.S
> +++ b/arch/powerpc/kvm/bookehv_interrupts.S
> @@ -33,6 +33,8 @@
>
>   #ifdef CONFIG_64BIT
>   #include <asm/exception-64e.h>
> +#include <asm/hw_irq.h>
> +#include <asm/irqflags.h>
>   #else
>   #include "../kernel/head_booke.h" /* for THREAD_NORMSAVE() */
>   #endif
> @@ -465,6 +467,15 @@ _GLOBAL(kvmppc_resume_host)
>   	mtspr	SPRN_EPCR, r3
>   	isync
>
> +#ifdef CONFIG_64BIT
> +	/*
> +	 * We enter with interrupts disabled in hardware, but
> +	 * we need to call RECONCILE_IRQ_STATE anyway to ensure
> +	 * that the software state is kept in sync.
> +	 */
> +	RECONCILE_IRQ_STATE(r3,r5)
> +#endif
> +
>   	/* Switch to kernel stack and jump to handler. */
>   	PPC_LL	r3, HOST_RUN(r1)
>   	mr	r5, r14 /* intno */
>

  reply	other threads:[~2013-11-18  8:34 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-10-23  1:26 [v5][PATCH] KVM: PPC: Book3E HV: call RECONCILE_IRQ_STATE to sync the software state Tiejun Chen
2013-11-18  8:34 ` "“tiejun.chen”" [this message]
2013-11-18 21:09   ` Alexander Graf
2013-11-18 23:49     ` Scott Wood
2013-11-19  9:51       ` Alexander Graf
2013-11-19 18:32         ` Scott Wood
2013-11-29  2:01     ` "“tiejun.chen”"
2013-12-18 22:05       ` 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=5289D10D.5020506@windriver.com \
    --to=tiejun.chen@windriver.com \
    --cc=agraf@suse.de \
    --cc=kvm-ppc@vger.kernel.org \
    --cc=kvm@vger.kernel.org \
    --cc=scottwood@freescale.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