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