spapr/pci: Free MSIs during reset
authorGreg Kurz <groug@kaod.org>
Fri, 26 Jul 2019 14:44:44 +0000 (16:44 +0200)
committerDavid Gibson <david@gibson.dropbear.id.au>
Wed, 21 Aug 2019 07:17:39 +0000 (17:17 +1000)
When the machine is reset, the MSI bitmap is cleared but the allocated
MSIs are not freed. Some operating systems, such as AIX, can detect the
previous configuration and assert.

Empty the MSI cache, this performs the needed cleanup.

Signed-off-by: Greg Kurz <groug@kaod.org>
Message-Id: <156415228410.1064338.4486161194061636096.stgit@bahia.lan>
Reviewed-by: Cédric Le Goater <clg@kaod.org>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
hw/ppc/spapr_pci.c

index 6e6b4d0f6061eb5593dd8842d15466bba0f354b4..deb0b0c80c069291ade560c77afd707d6988f715 100644 (file)
@@ -2080,6 +2080,8 @@ static void spapr_phb_reset(DeviceState *qdev)
     if (spapr_phb_eeh_available(SPAPR_PCI_HOST_BRIDGE(qdev))) {
         spapr_phb_vfio_reset(qdev);
     }
+
+    g_hash_table_remove_all(sphb->msi);
 }
 
 static Property spapr_phb_properties[] = {