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

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