linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Balbir Singh <bsingharora@gmail.com>
To: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: linuxppc-dev@lists.ozlabs.org, Paul Mackerras <pmac@au1.ibm.com>
Subject: Re: [PATCH] powerpc/icp-opal: Fix missing KVM case and harden replay
Date: Mon, 16 Jan 2017 21:37:59 +0530	[thread overview]
Message-ID: <20170116160759.GA31332@localhost.localdomain> (raw)
In-Reply-To: <1484533171.11927.24.camel@kernel.crashing.org>

On Sun, Jan 15, 2017 at 08:19:31PM -0600, Benjamin Herrenschmidt wrote:
> The icp-opal call is missing the code from icp-native to recover
> interrupts snatched by KVM. Without that, when running KVM, we can
> get into a situation where an interrupt is lost and the CPU stuck
> with an elevated CPPR.
> 
> Also harden replay by always checking the return from opal_int_eoi
> 
> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
> ---
>  arch/powerpc/sysdev/xics/icp-opal.c | 31 ++++++++++++++++++++++++-------
>  1 file changed, 24 insertions(+), 7 deletions(-)
> 
> diff --git a/arch/powerpc/sysdev/xics/icp-opal.c b/arch/powerpc/sysdev/xics/icp-opal.c
> index d38e86f..60c5765 100644
> --- a/arch/powerpc/sysdev/xics/icp-opal.c
> +++ b/arch/powerpc/sysdev/xics/icp-opal.c
> @@ -20,6 +20,7 @@
>  #include 
>  #include 
>  #include 
> +#include 
>

??

<snip>

> @@ -39,7 +40,26 @@ static void icp_opal_flush_ipi(void)
>  	 * Should we be flagging idle loop instead?
>  	 * Or creating some task to be scheduled?
>  	 */
> -	opal_int_eoi((0x00 << 24) | XICS_IPI);
> +	if (opal_int_eoi((0x00 << 24) | XICS_IPI) > 0)
> +		force_external_irq_replay();
> +}

Shouldn't we also update kvm bits on icp_native_ipi_action
and icp_native_cause_ipi?

Balbir Singh.

  reply	other threads:[~2017-01-16 16:08 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-16  2:19 [PATCH] powerpc/icp-opal: Fix missing KVM case and harden replay Benjamin Herrenschmidt
2017-01-16 16:07 ` Balbir Singh [this message]
2017-01-16 17:57   ` Benjamin Herrenschmidt
  -- strict thread matches above, loose matches on Subject: below --
2017-01-16 17:58 Benjamin Herrenschmidt
2017-01-17  6:38 ` Balbir Singh

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=20170116160759.GA31332@localhost.localdomain \
    --to=bsingharora@gmail.com \
    --cc=benh@kernel.crashing.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=pmac@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;
as well as URLs for NNTP newsgroup(s).