qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH for-5.2 0/5] spapr: Cleanups for XIVE and PHB
@ 2020-08-05 17:35 Greg Kurz
  2020-08-05 17:35 ` [PATCH for-5.2 1/5] spapr/xive: Fix xive->fd if kvm_create_device() fails Greg Kurz
                   ` (5 more replies)
  0 siblings, 6 replies; 13+ messages in thread
From: Greg Kurz @ 2020-08-05 17:35 UTC (permalink / raw)
  To: David Gibson
  Cc: Daniel Henrique Barboza, qemu-ppc, Cédric Le Goater,
	qemu-devel

Recent cleanup patch "spapr: Simplify error handling in spapr_phb_realize"
had to be dropped from ppc-for-5.2 because it would cause QEMU to crash
at init time on some POWER9 setups (eg. Boston systems), as reported by
Daniel.

The crash was happening because the kvmppc_xive_source_reset_one() function
would get called at some point (eg. initializing the LSI table of PHB0) and
fail (because XIVE KVM isn't supported on Bostons) without calling
error_setg(), which the caller doesn't expect when the patch above is applied.

The issue isn't really about a missing call to error_setg() but why do
we end up trying to claim an IRQ number in a XIVE KVM device that doesn't
exist ? The root cause for this is that we guard calls to the XIVE KVM
code with kvm_irqchip_in_kernel(), which might return true when the XICS
KVM device is active, even though the XIVE one is not. This series
upgrade the guarding code to also check if the device is actually open.

A similar cleanup could be performed on XICS.

---

Greg Kurz (5):
      spapr/xive: Fix xive->fd if kvm_create_device() fails
      spapr/xive: Simplify kvmppc_xive_disconnect()
      ppc/xive: Introduce dedicated kvm_irqchip_in_kernel() wrappers
      spapr/xive: Convert KVM device fd checks to assert()
      spapr: Simplify error handling in spapr_phb_realize()


 hw/intc/spapr_xive.c        |   39 +++++++++++++++++---------
 hw/intc/spapr_xive_kvm.c    |   64 +++++++++++++++++++------------------------
 hw/intc/xive.c              |   30 +++++++++++++++-----
 hw/ppc/spapr_pci.c          |   16 +++++------
 include/hw/ppc/spapr_xive.h |    1 +
 include/hw/ppc/xive.h       |    2 +
 6 files changed, 87 insertions(+), 65 deletions(-)

--
Greg



^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2020-08-06 12:24 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-08-05 17:35 [PATCH for-5.2 0/5] spapr: Cleanups for XIVE and PHB Greg Kurz
2020-08-05 17:35 ` [PATCH for-5.2 1/5] spapr/xive: Fix xive->fd if kvm_create_device() fails Greg Kurz
2020-08-06  5:05   ` David Gibson
2020-08-05 17:35 ` [PATCH for-5.2 2/5] spapr/xive: Simplify kvmppc_xive_disconnect() Greg Kurz
2020-08-06  5:05   ` David Gibson
2020-08-05 17:35 ` [PATCH for-5.2 3/5] ppc/xive: Introduce dedicated kvm_irqchip_in_kernel() wrappers Greg Kurz
2020-08-06  5:08   ` David Gibson
2020-08-06  9:23     ` Greg Kurz
2020-08-05 17:35 ` [PATCH for-5.2 4/5] spapr/xive: Convert KVM device fd checks to assert() Greg Kurz
2020-08-06  5:09   ` David Gibson
2020-08-05 17:35 ` [PATCH for-5.2 5/5] spapr: Simplify error handling in spapr_phb_realize() Greg Kurz
2020-08-06  5:10   ` David Gibson
2020-08-05 17:43 ` [PATCH for-5.2 0/5] spapr: Cleanups for XIVE and PHB no-reply

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).