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 <m...@redhat.com> Cc: Rusty Russell <ru...@rustcorp.com.au> Signed-off-by: David Gibson <da...@gibson.dropbear.id.au> --- 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