From mboxrd@z Thu Jan 1 00:00:00 1970 From: Gregory Haskins Subject: [PATCH] qemu: fix pci_enable_capabilities to set the CAP feature in pci::status Date: Mon, 20 Apr 2009 11:20:57 -0400 Message-ID: <20090420152007.11870.76689.stgit@dev.haskins.net> Mime-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Cc: Sheng Yang To: kvm@vger.kernel.org Return-path: Received: from victor.provo.novell.com ([137.65.250.26]:45795 "EHLO victor.provo.novell.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755253AbZDTPVJ (ORCPT ); Mon, 20 Apr 2009 11:21:09 -0400 Sender: kvm-owner@vger.kernel.org List-ID: (Applies to kvm-userspace.git:a1075de527f309850df278484f2ef4127827c6f4) The PCI spec requires bit 4 of the config-space STATUS register to be set in order to indicate that the capabilities pointer and capabilities area are valid. We have a pci_enable_capabilities() routine to fill out the config-space metadata, but we leave the status bit cleared. It is not apparent if this was intentionally omitted as part of the related device-assignment support, or simply an oversight. This patch completes the function by also setting the status bit appropriately. Signed-off-by: Gregory Haskins CC: Sheng Yang --- qemu/hw/pci.c | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diff --git a/qemu/hw/pci.c b/qemu/hw/pci.c index bf97c8c..5bfc4df 100644 --- a/qemu/hw/pci.c +++ b/qemu/hw/pci.c @@ -1009,6 +1009,8 @@ int pci_enable_capability_support(PCIDevice *pci_dev, if (!pci_dev) return -ENODEV; + pci_dev->config[0x06] |= 0x10; // status = capabilities + if (config_start == 0) pci_dev->cap.start = PCI_CAPABILITY_CONFIG_DEFAULT_START_ADDR; else if (config_start >= 0x40 && config_start < 0xff)