From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:37150) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S8LZo-00073a-TG for qemu-devel@nongnu.org; Thu, 15 Mar 2012 21:03:40 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1S8LZl-0003NX-DK for qemu-devel@nongnu.org; Thu, 15 Mar 2012 21:03:28 -0400 From: David Gibson Date: Fri, 16 Mar 2012 12:03:08 +1100 Message-Id: <1331859788-6522-1-git-send-email-david@gibson.dropbear.id.au> Subject: [Qemu-devel] [PATCH] Remove PCI class code from virtio balloon device List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: aliguori@us.ibm.com Cc: qemu-trivial@nongnu.org, Rusty Russell , "Michael S. Tsirkin" , qemu-devel@nongnu.org, David Gibson Currently the virtio balloon device, when using the virtio-pci interface advertises itself with PCI class code MEMORY_RAM. This is wrong; the balloon is vaguely related to memory, but is nothing like a PCI memory device in the meaning of the class code, and this code is not required or suggested by the virtio PCI specification. Worse, this patch causes problems on the pseries machine, because the firmware, seeing this class code, advertises the device as memory in the device tree, and then a guest kernel bug causes it to see this "memory" before the real system memory, leading to a crash in early boot. This patch fixes the problem by removing the bogus PCI class code on the balloon device. Cc: Michael S. Tsirkin Cc: Rusty Russell Signed-off-by: David Gibson --- hw/virtio-pci.c | 1 - 1 files changed, 0 insertions(+), 1 deletions(-) diff --git a/hw/virtio-pci.c b/hw/virtio-pci.c index a0fb7c1..3c3907a 100644 --- a/hw/virtio-pci.c +++ b/hw/virtio-pci.c @@ -919,7 +919,6 @@ static void virtio_balloon_class_init(ObjectClass *klass, void *data) k->vendor_id = PCI_VENDOR_ID_REDHAT_QUMRANET; k->device_id = PCI_DEVICE_ID_VIRTIO_BALLOON; k->revision = VIRTIO_PCI_ABI_VERSION; - k->class_id = PCI_CLASS_MEMORY_RAM; dc->reset = virtio_pci_reset; dc->props = virtio_balloon_properties; } -- 1.7.9.1