From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:38354) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T7Mmw-0001TZ-U5 for qemu-devel@nongnu.org; Fri, 31 Aug 2012 04:41:15 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1T7Mmv-0003o2-KA for qemu-devel@nongnu.org; Fri, 31 Aug 2012 04:41:14 -0400 Received: from mx1.redhat.com ([209.132.183.28]:23426) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T7Mmv-0003nx-AX for qemu-devel@nongnu.org; Fri, 31 Aug 2012 04:41:13 -0400 Date: Fri, 31 Aug 2012 11:42:27 +0300 From: "Michael S. Tsirkin" Message-ID: <20120831084227.GA24072@redhat.com> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Subject: Re: [Qemu-devel] [PATCH 2/2] pcie_aer: clear cmask for Advanced Error Interrupt Message Number List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Jason Baron Cc: yamahata@valinux.co.jp, alex.williamson@redhat.com, jan.kiszka@siemens.com, qemu-devel@nongnu.org, quintela@redhat.com Some minor nits below. If you dont get to it I will tweak this patch when I apply it early next week. On Thu, Aug 30, 2012 at 01:51:15PM -0400, Jason Baron wrote: > 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. I think you actually mean 'not 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 This line is better moved to near definition of PCI_ERR_ROOT_IRQ. Then here we can say 'PCI_ERR_ROOT_IRQ is RO but devices change it using a device-specific method.' > + * 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); ~PCI_ERR_ROOT_IRQ would be clearer I think. > } > > void pcie_aer_root_reset(PCIDevice *dev) > -- > 1.7.1