[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH V7 23/24] apci: fix PXB behaviour if used with unsup
From: |
Marcel Apfelbaum |
Subject: |
[Qemu-devel] [PATCH V7 23/24] apci: fix PXB behaviour if used with unsupported BIOS |
Date: |
Mon, 25 May 2015 18:34:01 +0300 |
PXB does not work with unsupported bioses, but should
not interfere with normal OS operation.
We don't ship them anymore, but it's reasonable
to keep the work-around until we update the bios in qemu.
Fix this by not adding PXB mem/IO chunks to _CRS
if they weren't configured by BIOS.
Signed-off-by: Marcel Apfelbaum <address@hidden>
---
hw/i386/acpi-build.c | 87 ++++++++++++++++++++++++++++++++++------------------
1 file changed, 58 insertions(+), 29 deletions(-)
diff --git a/hw/i386/acpi-build.c b/hw/i386/acpi-build.c
index f7d2c80..895d64c 100644
--- a/hw/i386/acpi-build.c
+++ b/hw/i386/acpi-build.c
@@ -784,6 +784,14 @@ static Aml *build_crs(PCIHostState *host,
range_base = r->addr;
range_limit = r->addr + r->size - 1;
+ /*
+ * Work-around for old bioses
+ * that do not support multiple root buses
+ */
+ if (!range_base || range_base > range_limit) {
+ continue;
+ }
+
if (r->type & PCI_BASE_ADDRESS_SPACE_IO) {
aml_append(crs,
aml_word_io(aml_min_fixed, aml_max_fixed,
@@ -817,45 +825,66 @@ static Aml *build_crs(PCIHostState *host,
range_base = pci_bridge_get_base(dev, PCI_BASE_ADDRESS_SPACE_IO);
range_limit = pci_bridge_get_limit(dev, PCI_BASE_ADDRESS_SPACE_IO);
- aml_append(crs,
- aml_word_io(aml_min_fixed, aml_max_fixed,
- aml_pos_decode, aml_entire_range,
- 0,
- range_base,
- range_limit,
- 0,
- range_limit - range_base + 1));
- crs_range_insert(io_ranges, range_base, range_limit);
+
+ /*
+ * Work-around for old bioses
+ * that do not support multiple root buses
+ */
+ if (range_base || range_base > range_limit) {
+ aml_append(crs,
+ aml_word_io(aml_min_fixed, aml_max_fixed,
+ aml_pos_decode, aml_entire_range,
+ 0,
+ range_base,
+ range_limit,
+ 0,
+ range_limit - range_base + 1));
+ crs_range_insert(io_ranges, range_base, range_limit);
+ }
range_base =
pci_bridge_get_base(dev, PCI_BASE_ADDRESS_SPACE_MEMORY);
range_limit =
pci_bridge_get_limit(dev, PCI_BASE_ADDRESS_SPACE_MEMORY);
- aml_append(crs,
- aml_dword_memory(aml_pos_decode, aml_min_fixed,
- aml_max_fixed, aml_non_cacheable,
- aml_ReadWrite,
- 0,
- range_base,
- range_limit,
- 0,
- range_limit - range_base + 1));
- crs_range_insert(mem_ranges, range_base, range_limit);
+
+ /*
+ * Work-around for old bioses
+ * that do not support multiple root buses
+ */
+ if (range_base || range_base > range_limit) {
+ aml_append(crs,
+ aml_dword_memory(aml_pos_decode, aml_min_fixed,
+ aml_max_fixed, aml_non_cacheable,
+ aml_ReadWrite,
+ 0,
+ range_base,
+ range_limit,
+ 0,
+ range_limit - range_base + 1));
+ crs_range_insert(mem_ranges, range_base, range_limit);
+ }
range_base =
pci_bridge_get_base(dev, PCI_BASE_ADDRESS_MEM_PREFETCH);
range_limit =
pci_bridge_get_limit(dev, PCI_BASE_ADDRESS_MEM_PREFETCH);
- aml_append(crs,
- aml_dword_memory(aml_pos_decode, aml_min_fixed,
- aml_max_fixed, aml_non_cacheable,
- aml_ReadWrite,
- 0,
- range_base,
- range_limit,
- 0,
- range_limit - range_base + 1));
- crs_range_insert(mem_ranges, range_base, range_limit);
+
+ /*
+ * Work-around for old bioses
+ * that do not support multiple root buses
+ */
+ if (range_base || range_base > range_limit) {
+ aml_append(crs,
+ aml_dword_memory(aml_pos_decode, aml_min_fixed,
+ aml_max_fixed, aml_non_cacheable,
+ aml_ReadWrite,
+ 0,
+ range_base,
+ range_limit,
+ 0,
+ range_limit - range_base + 1));
+ crs_range_insert(mem_ranges, range_base, range_limit);
+ }
}
}
--
2.1.0
- [Qemu-devel] [PATCH V7 14/24] hw/apci: add _PRT method for extra PCI root busses, (continued)
- [Qemu-devel] [PATCH V7 14/24] hw/apci: add _PRT method for extra PCI root busses, Marcel Apfelbaum, 2015/05/25
- [Qemu-devel] [PATCH V7 13/24] hw/acpi: add support for i440fx 'snooping' root busses, Marcel Apfelbaum, 2015/05/25
- [Qemu-devel] [PATCH V7 15/24] hw/acpi: add _CRS method for extra root busses, Marcel Apfelbaum, 2015/05/25
- [Qemu-devel] [PATCH V7 16/24] hw/acpi: remove from root bus 0 the crs resources used by other buses., Marcel Apfelbaum, 2015/05/25
- [Qemu-devel] [PATCH V7 17/24] hw/pci: removed 'rootbus nr is 0' assumption from qmp_pci_query, Marcel Apfelbaum, 2015/05/25
- [Qemu-devel] [PATCH V7 18/24] hw/pci: introduce PCI Expander Bridge (PXB), Marcel Apfelbaum, 2015/05/25
- [Qemu-devel] [PATCH V7 19/24] hw/pci: inform bios if the system has extra pci root buses, Marcel Apfelbaum, 2015/05/25
- [Qemu-devel] [PATCH V7 21/24] hw/pci: add support for NUMA nodes, Marcel Apfelbaum, 2015/05/25
- [Qemu-devel] [PATCH V7 20/24] hw/pxb: add map_irq func, Marcel Apfelbaum, 2015/05/25
- [Qemu-devel] [PATCH V7 22/24] hw/pxb: add numa_node parameter, Marcel Apfelbaum, 2015/05/25
- [Qemu-devel] [PATCH V7 23/24] apci: fix PXB behaviour if used with unsupported BIOS,
Marcel Apfelbaum <=
- [Qemu-devel] [PATCH V7 24/24] docs: Add PXB documentation, Marcel Apfelbaum, 2015/05/25