qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v3 for-5.2 0/3] spapr: Cleanups for XIVE
@ 2020-08-07 11:31 Greg Kurz
  2020-08-07 11:32 ` [PATCH v3 for-5.2 1/3] ppc/xive: Rework setup of XiveSource::esb_mmio Greg Kurz
                   ` (2 more replies)
  0 siblings, 3 replies; 11+ messages in thread
From: Greg Kurz @ 2020-08-07 11:31 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 hasn't been created yet) without calling error_setg(),
which the caller doesn't expect when the above patch 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.

v3: - rework the ESB MMIO of the XIVE source in a preliminary patch.
      This gets rid of an anoying user of kvm_irqchip_in_kernel()
    - drop "spapr: Simplify error handling in spapr_phb_realize". Will
      be posted later with other "error handling" cleanups in a separate
      series

v2: - patch 1 and 2 already applied but not yet visible on github
    - new approach with abstract methods in the base XIVE classes

---

Greg Kurz (3):
      ppc/xive: Rework setup of XiveSource::esb_mmio
      ppc/xive: Introduce dedicated kvm_irqchip_in_kernel() wrappers
      spapr/xive: Convert KVM device fd checks to assert()


 hw/intc/spapr_xive.c     |   45 +++++++++++++++++++++++++++++++--------------
 hw/intc/spapr_xive_kvm.c |   39 +++++++++------------------------------
 hw/intc/xive.c           |   36 +++++++++++++++++++++++++-----------
 include/hw/ppc/xive.h    |    7 +++++++
 4 files changed, 72 insertions(+), 55 deletions(-)

--
Greg



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

end of thread, other threads:[~2020-08-13 11:11 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-08-07 11:31 [PATCH v3 for-5.2 0/3] spapr: Cleanups for XIVE Greg Kurz
2020-08-07 11:32 ` [PATCH v3 for-5.2 1/3] ppc/xive: Rework setup of XiveSource::esb_mmio Greg Kurz
2020-08-07 12:36   ` Cédric Le Goater
2020-08-13 10:50     ` David Gibson
2020-08-07 11:32 ` [PATCH v3 for-5.2 2/3] ppc/xive: Introduce dedicated kvm_irqchip_in_kernel() wrappers Greg Kurz
2020-08-07 12:42   ` Cédric Le Goater
2020-08-08 10:49   ` Cédric Le Goater
2020-08-13 10:56   ` David Gibson
2020-08-07 11:32 ` [PATCH v3 for-5.2 3/3] spapr/xive: Convert KVM device fd checks to assert() Greg Kurz
2020-08-07 12:37   ` Cédric Le Goater
2020-08-13 11:00   ` David Gibson

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