From patchwork Thu Aug 30 17:51:15 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jason Baron X-Patchwork-Id: 180849 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 6E2182C026F for ; Fri, 31 Aug 2012 03:51:34 +1000 (EST) Received: from localhost ([::1]:57873 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T78tw-0004c3-H8 for incoming@patchwork.ozlabs.org; Thu, 30 Aug 2012 13:51:32 -0400 Received: from eggs.gnu.org ([208.118.235.92]:57413) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T78ti-0004Vb-DR for qemu-devel@nongnu.org; Thu, 30 Aug 2012 13:51:19 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1T78th-0002c3-Cs for qemu-devel@nongnu.org; Thu, 30 Aug 2012 13:51:18 -0400 Received: from mx1.redhat.com ([209.132.183.28]:6120) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T78th-0002bs-4k for qemu-devel@nongnu.org; Thu, 30 Aug 2012 13:51:17 -0400 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q7UHpG95008212 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Thu, 30 Aug 2012 13:51:16 -0400 Received: from redhat.com (dhcp-185-114.bos.redhat.com [10.16.185.114]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id q7UHpFdg008918; Thu, 30 Aug 2012 13:51:15 -0400 Date: Thu, 30 Aug 2012 13:51:15 -0400 From: Jason Baron To: mst@redhat.com, quintela@redhat.com Message-Id: In-Reply-To: References: X-Scanned-By: MIMEDefang 2.68 on 10.5.11.24 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 209.132.183.28 Cc: yamahata@valinux.co.jp, alex.williamson@redhat.com, qemu-devel@nongnu.org, jan.kiszka@siemens.com Subject: [Qemu-devel] [PATCH 2/2] pcie_aer: clear cmask for Advanced Error Interrupt Message Number 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 The Advanced Error Interrupt Message Number (bits 31:27 of the Root Error Status Register) is updated when the number of msi messages assigned to a device changes. Migration of windows 7 on q35 chipset failed because the check in get_pci_config_device() fails due to wmask being set on these bits. Its valid to update these bits and we must restore this state across migration. Signed-off-by: Jason Baron --- hw/pcie_aer.c | 6 ++++++ 1 files changed, 6 insertions(+), 0 deletions(-) diff --git a/hw/pcie_aer.c b/hw/pcie_aer.c index 3b6981c..6edcd79 100644 --- a/hw/pcie_aer.c +++ b/hw/pcie_aer.c @@ -738,6 +738,12 @@ void pcie_aer_root_init(PCIDevice *dev) PCI_ERR_ROOT_CMD_EN_MASK); pci_set_long(dev->w1cmask + pos + PCI_ERR_ROOT_STATUS, PCI_ERR_ROOT_STATUS_REPORT_MASK); + /* Bits 31:27 - Advanced Error Interrupt Message Number + * These bits are updated when the number of MSI messages changes. + * By clearing the cmask, pcie devices can be migrated. + */ + pci_set_long(dev->cmask + pos + PCI_ERR_ROOT_STATUS, + (1 << PCI_ERR_ROOT_IRQ_SHIFT) - 1); } void pcie_aer_root_reset(PCIDevice *dev)