From mboxrd@z Thu Jan 1 00:00:00 1970 From: Paul Mackerras Date: Tue, 13 Aug 2019 09:58:45 +0000 Subject: [PATCH v2 0/3] powerpc/xive: Fix race condition leading to host crashes and hangs Message-Id: <20190813095845.GA9567@blackberry> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable To: linuxppc-dev@ozlabs.org, kvm@vger.kernel.org Cc: kvm-ppc@vger.kernel.org, David Gibson This series fixes a race condition that has been observed in testing on POWER9 machines running KVM guests. An interrupt being freed by free_irq() can have an instance present in a XIVE interrupt queue, which can then be presented to the generic interrupt code after the data structures for it have been freed, leading to a variety of crashes and hangs. This series is based on current upstream kernel source plus C=E9dric Le Goater's patch "KVM: PPC: Book3S HV: XIVE: Free escalation interrupts before disabling the VP", which is a pre-requisite for this series. As it touches both KVM and generic PPC code, this series will probably go in via Michael Ellerman's powerpc tree. V2 of this patch series adds a patch fixing a bug noticed by C=E9dric, and also fixes a bug in patch 1/2 of the v1 series. Paul. arch/powerpc/include/asm/xive.h | 8 +++ arch/powerpc/kvm/book3s_hv_rmhandlers.S | 38 +++++++++----- arch/powerpc/kvm/book3s_xive.c | 42 +++++++++++++++- arch/powerpc/kvm/book3s_xive.h | 2 + arch/powerpc/kvm/book3s_xive_native.c | 6 +++ arch/powerpc/sysdev/xive/common.c | 87 ++++++++++++++++++++++++-----= ---- 6 files changed, 146 insertions(+), 37 deletions(-)