[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v6 00/26] qemu: generate acpi tables for the gue
From: |
Michael S. Tsirkin |
Subject: |
Re: [Qemu-devel] [PATCH v6 00/26] qemu: generate acpi tables for the guest |
Date: |
Tue, 1 Oct 2013 15:38:50 +0300 |
On Tue, Oct 01, 2013 at 12:03:57PM +0200, Igor Mammedov wrote:
> On Sun, 29 Sep 2013 13:58:21 +0300
> "Michael S. Tsirkin" <address@hidden> wrote:
>
> WS2008R2x64 BSODs with ACPI error on boot when 64bit PCI hole is present,
> but it boots fine with upstream QEMU [stock or acpi BIOS]
>
> QEMU cli:
>
> qemu-system-x86_64 -enable-kvm -monitor stdio -m 4096 test.qcow2 -device
> ivshmem,size=4G,chardev=cfoo -chardev
> socket,path=/tmp/sock,id=cfoo,server,nowait
>
Thanks!
This fixes it for me (below).
I'll roll this in the next revision.
diff --git a/hw/pci/pci.c b/hw/pci/pci.c
index 7d5d103..d359685 100644
--- a/hw/pci/pci.c
+++ b/hw/pci/pci.c
@@ -2281,7 +2281,7 @@ static void pci_dev_get_w64(PCIBus *b, PCIDevice *dev,
void *opaque)
Range *range = opaque;
PCIDeviceClass *pc = PCI_DEVICE_GET_CLASS(dev);
uint16_t cmd = pci_get_word(dev->config + PCI_COMMAND);
- int r;
+ int i;
if (!(cmd & PCI_COMMAND_MEMORY)) {
return;
@@ -2300,17 +2300,21 @@ static void pci_dev_get_w64(PCIBus *b, PCIDevice *dev,
void *opaque)
range_extend(range, &pref_range);
}
}
- for (r = 0; r < PCI_NUM_REGIONS; ++r) {
- PCIIORegion *region = &dev->io_regions[r];
+ for (i = 0; i < PCI_NUM_REGIONS; ++i) {
+ PCIIORegion *r = &dev->io_regions[i];
Range region_range;
- if (!region->size ||
- (region->type & PCI_BASE_ADDRESS_SPACE_IO) ||
- !(region->type & PCI_BASE_ADDRESS_MEM_TYPE_64)) {
+ if (!r->size ||
+ (r->type & PCI_BASE_ADDRESS_SPACE_IO) ||
+ !(r->type & PCI_BASE_ADDRESS_MEM_TYPE_64)) {
+ continue;
+ }
+ region_range.begin = pci_bar_address(dev, i, r->type, r->size);
+ region_range.end = region_range.begin + r->size;
+
+ if (region_range.begin == PCI_BAR_UNMAPPED) {
continue;
}
- region_range.begin = pci_get_quad(dev->config + pci_bar(dev, r));
- region_range.end = region_range.begin + region->size;
region_range.begin = MAX(region_range.begin, 0x1ULL << 32);