spapr/xive: fix multiple resets when using the 'dual' interrupt mode
commitcdd71c8e9dffc97c5e0569b6ea14dfb65fc74851
authorCédric Le Goater <clg@kaod.org>
Wed, 22 May 2019 07:40:15 +0000 (22 09:40 +0200)
committerDavid Gibson <david@gibson.dropbear.id.au>
Wed, 29 May 2019 01:39:47 +0000 (29 11:39 +1000)
tree3ee24311d9b8df74cf557b12fc8740a0689f977b
parent24563a587f964ff16477feab54686ccf617d3570
spapr/xive: fix multiple resets when using the 'dual' interrupt mode

Today, when a reset occurs on a pseries machine using the 'dual'
interrupt mode, the KVM devices are released and recreated depending
on the interrupt mode selected by CAS. If XIVE is selected, the SysBus
memory regions of the SpaprXive model are initialized by the KVM
backend initialization routine each time a reset occurs. This leads to
a crash after a couple of resets because the machine reaches the
QDEV_MAX_MMIO limit of SysBusDevice :

qemu-system-ppc64: hw/core/sysbus.c:193: sysbus_init_mmio: Assertion `dev->num_mmio < QDEV_MAX_MMIO' failed.

To fix, initialize the SysBus memory regions in spapr_xive_realize()
called only once and remove the same inits from the QEMU and KVM
backend initialization routines which are called at each reset.

Reported-by: Satheesh Rajendran <sathnaga@linux.vnet.ibm.com>
Signed-off-by: Cédric Le Goater <clg@kaod.org>
Message-Id: <20190522074016.10521-2-clg@kaod.org>
Reviewed-by: Greg Kurz <groug@kaod.org>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
hw/intc/spapr_xive.c
hw/intc/spapr_xive_kvm.c