diff mbox

e1000: Don't set the Capabilities List bit

Message ID 201210191302.48620.hahn@univention.de
State New
Headers show

Commit Message

Philipp Hahn Oct. 19, 2012, 11:02 a.m. UTC
Hello,

On Friday 19 October 2012 11:59:24 Philipp Hahn wrote:
> On Wednesday 21 September 2011 22:06:25 dann frazier wrote:
...
> > -    /* TODO: we have no capabilities, so why is this bit set? */
> > -    pci_set_word(pci_conf + PCI_STATUS, PCI_STATUS_CAP_LIST);
...
> Since cmask[PCI_STATUS=6] = PCI_STATUS_CAP_LIST=0x10 marks that bit as
> unmodifiable, the functions returns an error and aborts loading the saved
> state.
...
> Has somebody an idea how to fix this issue?

I'm no expert on PCI issues, but since e1000 drivers don't seem to much care 
about the Capability List bit, perhaps the attached patch to ignore the bit 
for e1000 would be in oder?
At least it fixes my problem.
Comments welcomed.

Sincerely
Philipp Hahn
diff mbox

Patch

e1000: Ignore the Capabilities List bit

dd8e93799f13ef82d83c185b8e71e049452f7d40 unconditionally removed the
PCI_STATUS_CAP_LIST bit from PCI_STATUS, because the e1000 does not have
capabilities. This breaks upgrades from before qemu-0.15, because there the bit
is still set and get_pci_config_device() refused to load incompatible save
states.

Remove the Capabilities List bit from the list of compatible bits, so it is not
validated for an exact match.

Signed-off-by: Philipp Hahn <hahn@univention.de>

--- a/hw/e1000.c
+++ b/hw/e1000.c
@@ -1224,6 +1224,9 @@  static int pci_e1000_init(PCIDevice *pci_dev)
 
     pci_conf = d->dev.config;
 
+    /* Ignore capability bit, which was set until qemu-0.15 */
+    d->dev.cmask[PCI_STATUS] &= ~PCI_STATUS_CAP_LIST;
+    d->dev.wmask[PCI_STATUS] &= ~PCI_STATUS_CAP_LIST;
     /* TODO: RST# value should be 0, PCI spec 6.2.4 */
     pci_conf[PCI_CACHE_LINE_SIZE] = 0x10;