From patchwork Fri Oct 19 11:02:43 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Philipp Hahn X-Patchwork-Id: 192643 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 353332C0089 for ; Fri, 19 Oct 2012 22:03:09 +1100 (EST) Received: from localhost ([::1]:41132 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TPAM7-0001Qk-6l for incoming@patchwork.ozlabs.org; Fri, 19 Oct 2012 07:03:07 -0400 Received: from eggs.gnu.org ([208.118.235.92]:53908) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TPALv-0001NS-Iw for qemu-devel@nongnu.org; Fri, 19 Oct 2012 07:02:56 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TPALt-0002pl-4P for qemu-devel@nongnu.org; Fri, 19 Oct 2012 07:02:55 -0400 Received: from mail.univention.de ([82.198.197.8]:1278) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TPALs-0002of-R8 for qemu-devel@nongnu.org; Fri, 19 Oct 2012 07:02:53 -0400 Received: from localhost (localhost [127.0.0.1]) by slugis.knut.univention.de (Postfix) with ESMTP id 23C796EA165; Fri, 19 Oct 2012 13:02:53 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by slugis.knut.univention.de (Postfix) with ESMTP id E4E746EA180; Fri, 19 Oct 2012 13:02:52 +0200 (CEST) X-Virus-Scanned: by amavisd-new-2.6.1 (20080629) (Debian) at knut.univention.de Received: from mail.univention.de ([127.0.0.1]) by localhost (slugis.knut.univention.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id fFWmJutPsL7y; Fri, 19 Oct 2012 13:02:52 +0200 (CEST) Received: from stave.knut.univention.de (mail.univention.de [82.198.197.8]) by slugis.knut.univention.de (Postfix) with ESMTPSA id DAE516EA165; Fri, 19 Oct 2012 13:02:51 +0200 (CEST) From: Philipp Hahn Organization: Univention.de To: qemu-devel@nongnu.org Date: Fri, 19 Oct 2012 13:02:43 +0200 User-Agent: KMail/1.9.10 (enterprise35 20100903.1171286) References: <1316635586-4586-1-git-send-email-dann.frazier@canonical.com> <201210191159.29855.hahn@univention.de> In-Reply-To: <201210191159.29855.hahn@univention.de> X-KMail-QuotePrefix: > MIME-Version: 1.0 Message-Id: <201210191302.48620.hahn@univention.de> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Received-From: 82.198.197.8 Cc: dann frazier , Anthony Liguori Subject: Re: [Qemu-devel] [PATCH] e1000: Don't set the Capabilities List bit X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org 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 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 --- 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;