Skip to contentSkip to conversation

e1000e: correctly tear down MSI-X memory regions

PATCH Applied Paolo Bonzini 3 participants 3 messages Mar 9, 2017 – Mar 10, 2017

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 e1000e: correctly tear down MSI-X memory regions

MSI-X has been disabled by the time the e1000e device is unrealized, hence msix_uninit is never called. This causes the object to be leaked, which shows up as a RAMBlock with empty name when attempting migration.

---
 hw/net/e1000e.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
hw/net/e1000e.c +1 -1
index b0f429b..6e23493 100644
@@ -306,7 +306,7 @@ e1000e_init_msix(E1000EState *s)
 static void
 e1000e_cleanup_msix(E1000EState *s)
 {
-    if (msix_enabled(PCI_DEVICE(s))) {
+    if (msix_present(PCI_DEVICE(s))) {
         e1000e_unuse_msix_vectors(s, E1000E_MSIX_VEC_NUM);
         msix_uninit(PCI_DEVICE(s), &s->msix, &s->msix);
     }
Signature · 1 line
2.9.3
Tested-by on v1 1/1
#1 lore raw
Quoted 18 lines · Paolo Bonzini

MSI-X has been disabled by the time the e1000e device is unrealized, hence msix_uninit is never called. This causes the object to be leaked, which shows up as a RAMBlock with empty name when attempting migration.

---
 hw/net/e1000e.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
hw/net/e1000e.c +0 -0
index b0f429b..6e23493 100644

hw/net/e1000e.c e1000e_init_msix(E1000EState *s) · line 312

Quoted 8 lines
hw/net/e1000e.c +1 -1
@@ -306,7 +306,7 @@ e1000e_init_msix(E1000EState *s)
 static void
 e1000e_cleanup_msix(E1000EState *s)
 {
-    if (msix_enabled(PCI_DEVICE(s))) {
+    if (msix_present(PCI_DEVICE(s))) {
         e1000e_unuse_msix_vectors(s, E1000E_MSIX_VEC_NUM);
         msix_uninit(PCI_DEVICE(s), &s->msix, &s->msix);
     }
Applied
#2 lore raw
Quoted 13 lines · Laurent Vivier
Quoted 12 lines · Paolo Bonzini

MSI-X has been disabled by the time the e1000e device is unrealized, hence msix_uninit is never called. This causes the object to be leaked, which shows up as a RAMBlock with empty name when attempting migration.

---
  hw/net/e1000e.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
Quoted 16 lines
Quoted 6 lines
hw/net/e1000e.c +0 -0
index b0f429b..6e23493 100644

hw/net/e1000e.c e1000e_init_msix(E1000EState *s) · line 312

Quoted 8 lines
hw/net/e1000e.c +1 -1
@@ -306,7 +306,7 @@ e1000e_init_msix(E1000EState *s)
  static void
  e1000e_cleanup_msix(E1000EState *s)
  {
-    if (msix_enabled(PCI_DEVICE(s))) {
+    if (msix_present(PCI_DEVICE(s))) {
          e1000e_unuse_msix_vectors(s, E1000E_MSIX_VEC_NUM);
          msix_uninit(PCI_DEVICE(s), &s->msix, &s->msix);
      }

Applied, thanks.