Blame SOURCES/e1000-Keep-capabilities-list-bit-on-for-older-RHEL-machine-types.patch

218e99
From 5278c98d70ef98926e47b226cf5e40decc7ac7ca Mon Sep 17 00:00:00 2001
218e99
From: Miroslav Rezanina <mrezanin@redhat.com>
218e99
Date: Wed, 31 Jul 2013 08:06:40 +0200
218e99
Subject: e1000: Keep capabilities list bit on for older RHEL machine types
218e99
218e99
Message-id: <1375201922-6794-16-git-send-email-armbru@redhat.com>
218e99
Patchwork-id: 52825
218e99
O-Subject: [RHEL-7 PATCH v3 15/15] e1000: Keep capabilities list bit on for older RHEL machine types
218e99
Bugzilla: 983991
218e99
RH-Acked-by: Paolo Bonzini <pbonzini@redhat.com>
218e99
RH-Acked-by: Bandan Das <bsd@redhat.com>
218e99
RH-Acked-by: Miroslav Rezanina <mrezanin@redhat.com>
218e99
218e99
Upstream commit dd8e937 "e1000: Don't set the Capabilities List bit"
218e99
switched it off.  The necessary compat_props to keep it on for old
218e99
machine types were forgotten.
218e99
218e99
The RHEL-6 backport commit 2d76e3e added property
218e99
e1000.x-__com_redhat_rhel630_compat, set it for 6.3 and older via
218e99
compat_props, and made setting the capabilities list bit depend on it
218e99
being set.
218e99
218e99
Instead of porting the RHEL-only property forward to RHEL-7, use
218e99
upstream's e1000.autonegotiation, which is on for 6.4 and newer, else
218e99
off.  This is admittedly a hack.
218e99
218e99
Signed-off-by: Markus Armbruster <armbru@redhat.com>
218e99
218e99
diff --git a/hw/net/e1000.c b/hw/net/e1000.c
218e99
index e6f46f0..661b461 100644
218e99
--- a/hw/net/e1000.c
218e99
+++ b/hw/net/e1000.c
218e99
@@ -1324,6 +1324,16 @@ static int pci_e1000_init(PCIDevice *pci_dev)
218e99
 
218e99
     pci_conf = d->dev.config;
218e99
 
218e99
+    if (!(d->compat_flags & E1000_FLAG_AUTONEG)) {
218e99
+        /*
218e99
+         * We have no capabilities, so capability list bit should normally be 0.
218e99
+         * Keep it on for compat machine types to avoid breaking migration.
218e99
+         * HACK: abuse E1000_FLAG_AUTONEG, which is off exactly for
218e99
+         * the machine types that need this.
218e99
+         */
218e99
+        pci_set_word(pci_conf + PCI_STATUS, PCI_STATUS_CAP_LIST);
218e99
+    }
218e99
+
218e99
     /* TODO: RST# value should be 0, PCI spec 6.2.4 */
218e99
     pci_conf[PCI_CACHE_LINE_SIZE] = 0x10;
218e99