All of lore.kernel.org
 help / color / mirror / Atom feed
From: Greg KH <greg@kroah.com>
To: Paul Mackerras <paulus@ozlabs.org>
Cc: stable@vger.kernel.org
Subject: Re: [PATCH v4.14 1/4] KVM: PPC: Book3S HV: Fix trap number return from __kvmppc_vcore_entry
Date: Fri, 11 May 2018 08:58:50 +0200	[thread overview]
Message-ID: <20180511065850.GD13558@kroah.com> (raw)
In-Reply-To: <20180511061906.GA30116@fergus.ozlabs.ibm.com>

On Fri, May 11, 2018 at 04:19:06PM +1000, Paul Mackerras wrote:
> commit a8b48a4dccea77e29462e59f1dbf0d5aa1ff167c upstream.
> 
> This fixes a bug where the trap number that is returned by
> __kvmppc_vcore_entry gets corrupted.  The effect of the corruption
> is that IPIs get ignored on POWER9 systems when the IPI is sent via
> a doorbell interrupt to a CPU which is executing in a KVM guest.
> The effect of the IPI being ignored is often that another CPU locks
> up inside smp_call_function_many() (and if that CPU is holding a
> spinlock, other CPUs then lock up inside raw_spin_lock()).
> 
> The trap number is currently held in register r12 for most of the
> assembly-language part of the guest exit path.  In that path, we
> call kvmppc_subcore_exit_guest(), which is a C function, without
> restoring r12 afterwards.  Depending on the kernel config and the
> compiler, it may modify r12 or it may not, so some config/compiler
> combinations see the bug and others don't.
> 
> To fix this, we arrange for the trap number to be stored on the
> stack from the point where kvmhv_commence_exit is called until the
> end of the function, then the trap number is loaded and returned in
> r12 as before.
> 
> Cc: stable@vger.kernel.org # v4.8+
> Fixes: fd7bacbca47a ("KVM: PPC: Book3S HV: Fix TB corruption in guest exit path on HMI interrupt")
> Signed-off-by: Paul Mackerras <paulus@ozlabs.org>
> ---
>  arch/powerpc/kvm/book3s_hv_rmhandlers.S | 8 +++++---
>  1 file changed, 5 insertions(+), 3 deletions(-)

Now applied, thanks.


greg k-h

      parent reply	other threads:[~2018-05-11  6:59 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-11  6:19 [PATCH v4.14 1/4] KVM: PPC: Book3S HV: Fix trap number return from __kvmppc_vcore_entry Paul Mackerras
2018-05-11  6:20 ` [PATCH v4.14 2/4] KVM: PPC: Book3S HV: Fix handling of large pages in radix page fault handler Paul Mackerras
2018-05-11  6:58   ` Greg KH
2018-05-13 23:41     ` Paul Mackerras
2018-05-11  6:20 ` [PATCH v4.14 3/4] KVM: PPC: Book3S HV: Fix VRMA initialization with 2MB or 1GB memory backing Paul Mackerras
2018-05-11  6:59   ` Greg KH
2018-05-11  6:21 ` [PATCH v4.14 4/4] KVM: PPC: Book3S HV: Fix guest time accounting with VIRT_CPU_ACCOUNTING_GEN Paul Mackerras
2018-05-11  6:59   ` Greg KH
2018-05-11  6:58 ` Greg KH [this message]

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=20180511065850.GD13558@kroah.com \
    --to=greg@kroah.com \
    --cc=paulus@ozlabs.org \
    --cc=stable@vger.kernel.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.