* [Qemu-devel] [PATCH V4 1/6] tests/acpi: add pxb/pxb-pcie tests
2016-06-30 19:07 [Qemu-devel] [PATCH V4 0/6] pxb: fix 64-bit MMIO allocation Marcel Apfelbaum
@ 2016-06-30 19:07 ` Marcel Apfelbaum
2016-06-30 19:07 ` [Qemu-devel] [PATCH V4 2/6] hw/pxb: declare pxb devices as not hot-pluggable Marcel Apfelbaum
` (5 subsequent siblings)
6 siblings, 0 replies; 9+ messages in thread
From: Marcel Apfelbaum @ 2016-06-30 19:07 UTC (permalink / raw)
To: qemu-devel; +Cc: marcel, mst, pbonzini, imammedo, lersek, ehabkost
Add an ivshmem device with 4G shared memory to
pxb in order to check the ACPI code of 64bit MMIO allocation.
Suggested-by: Igor Mammedov <imammedo@redhat.com>
Signed-off-by: Marcel Apfelbaum <marcel@redhat.com>
---
tests/bios-tables-test.c | 37 +++++++++++++++++++++++++++++++++++++
1 file changed, 37 insertions(+)
diff --git a/tests/bios-tables-test.c b/tests/bios-tables-test.c
index 92c90dd..3d87f9e 100644
--- a/tests/bios-tables-test.c
+++ b/tests/bios-tables-test.c
@@ -838,6 +838,41 @@ static void test_acpi_piix4_tcg_ipmi(void)
free_test_data(&data);
}
+static void test_acpi_piix4_tcg_pxb(void)
+{
+ test_data data;
+
+ memset(&data, 0, sizeof(data));
+ data.machine = MACHINE_PC;
+ data.variant = ".pxb";
+ data.required_struct_types = base_required_struct_types;
+ data.required_struct_types_len = ARRAY_SIZE(base_required_struct_types);
+ test_acpi_one("-machine accel=tcg"
+ " -device pxb,id=pxb,bus_nr=0x80,bus=pci.0"
+ " -object memory-backend-file,size=4G,mem-path=/tmp/shmem,share,id=mb"
+ " -device ivshmem-plain,memdev=mb,bus=pxb",
+ &data);
+ free_test_data(&data);
+}
+
+static void test_acpi_q35_tcg_pxb_pcie(void)
+{
+ test_data data;
+
+ memset(&data, 0, sizeof(data));
+ data.machine = MACHINE_Q35;
+ data.variant = ".pxb_pcie";
+ data.required_struct_types = base_required_struct_types;
+ data.required_struct_types_len = ARRAY_SIZE(ipmi_required_struct_types);
+ test_acpi_one("-machine q35,accel=tcg"
+ " -device pxb-pcie,id=pxb,bus_nr=0x80,bus=pcie.0"
+ " -device ioh3420,id=rp,bus=pxb,slot=1"
+ " -object memory-backend-file,size=4G,mem-path=/tmp/shmem,share,id=mb"
+ " -device ivshmem-plain,memdev=mb,bus=rp",
+ &data);
+ free_test_data(&data);
+}
+
int main(int argc, char *argv[])
{
const char *arch = qtest_get_arch();
@@ -856,6 +891,8 @@ int main(int argc, char *argv[])
qtest_add_func("acpi/q35/tcg/bridge", test_acpi_q35_tcg_bridge);
qtest_add_func("acpi/piix4/tcg/ipmi", test_acpi_piix4_tcg_ipmi);
qtest_add_func("acpi/q35/tcg/ipmi", test_acpi_q35_tcg_ipmi);
+ qtest_add_func("acpi/piix4/tcg/pxb", test_acpi_piix4_tcg_pxb);
+ qtest_add_func("acpi/q35/tcg/pxb-pcie", test_acpi_q35_tcg_pxb_pcie);
}
ret = g_test_run();
boot_sector_cleanup(disk);
--
2.4.3
^ permalink raw reply related [flat|nested] 9+ messages in thread
* [Qemu-devel] [PATCH V4 2/6] hw/pxb: declare pxb devices as not hot-pluggable
2016-06-30 19:07 [Qemu-devel] [PATCH V4 0/6] pxb: fix 64-bit MMIO allocation Marcel Apfelbaum
2016-06-30 19:07 ` [Qemu-devel] [PATCH V4 1/6] tests/acpi: add pxb/pxb-pcie tests Marcel Apfelbaum
@ 2016-06-30 19:07 ` Marcel Apfelbaum
2016-06-30 19:07 ` [Qemu-devel] [PATCH V4 3/6] hw/acpi: fix a DSDT table issue when a pxb is present Marcel Apfelbaum
` (4 subsequent siblings)
6 siblings, 0 replies; 9+ messages in thread
From: Marcel Apfelbaum @ 2016-06-30 19:07 UTC (permalink / raw)
To: qemu-devel; +Cc: marcel, mst, pbonzini, imammedo, lersek, ehabkost
Prevent future issues when hotplug will work for devices
attached to pxbs.
Suggested-by: Igor Mammedov <imammedo@redhat.com>
Signed-off-by: Marcel Apfelbaum <marcel@redhat.com>
---
hw/pci-bridge/pci_expander_bridge.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/hw/pci-bridge/pci_expander_bridge.c b/hw/pci-bridge/pci_expander_bridge.c
index ba320bd..9136a23 100644
--- a/hw/pci-bridge/pci_expander_bridge.c
+++ b/hw/pci-bridge/pci_expander_bridge.c
@@ -308,6 +308,7 @@ static void pxb_dev_class_init(ObjectClass *klass, void *data)
dc->desc = "PCI Expander Bridge";
dc->props = pxb_dev_properties;
+ dc->hotpluggable = false;
set_bit(DEVICE_CATEGORY_BRIDGE, dc->categories);
}
@@ -341,6 +342,7 @@ static void pxb_pcie_dev_class_init(ObjectClass *klass, void *data)
dc->desc = "PCI Express Expander Bridge";
dc->props = pxb_dev_properties;
+ dc->hotpluggable = false;
set_bit(DEVICE_CATEGORY_BRIDGE, dc->categories);
}
--
2.4.3
^ permalink raw reply related [flat|nested] 9+ messages in thread
* [Qemu-devel] [PATCH V4 3/6] hw/acpi: fix a DSDT table issue when a pxb is present.
2016-06-30 19:07 [Qemu-devel] [PATCH V4 0/6] pxb: fix 64-bit MMIO allocation Marcel Apfelbaum
2016-06-30 19:07 ` [Qemu-devel] [PATCH V4 1/6] tests/acpi: add pxb/pxb-pcie tests Marcel Apfelbaum
2016-06-30 19:07 ` [Qemu-devel] [PATCH V4 2/6] hw/pxb: declare pxb devices as not hot-pluggable Marcel Apfelbaum
@ 2016-06-30 19:07 ` Marcel Apfelbaum
2016-06-30 19:07 ` [Qemu-devel] [PATCH V4 4/6] acpi: refactor pxb crs computation Marcel Apfelbaum
` (3 subsequent siblings)
6 siblings, 0 replies; 9+ messages in thread
From: Marcel Apfelbaum @ 2016-06-30 19:07 UTC (permalink / raw)
To: qemu-devel; +Cc: marcel, mst, pbonzini, imammedo, lersek, ehabkost
PXBs do not support hotplug so they don't have a PCNT function.
Since the PXB's PCI root-bus is a child bus of bus 0, the
build_dsdt code will add a call to the corresponding PCNT function.
Fix this by skipping the PCNT call for the above case.
While at it skip also PCIe child buses.
Reported-by: Igor Mammedov <imammedo@redhat.com>
Signed-off-by: Marcel Apfelbaum <marcel@redhat.com>
---
hw/i386/acpi-build.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/hw/i386/acpi-build.c b/hw/i386/acpi-build.c
index 5a594be..675a3dc 100644
--- a/hw/i386/acpi-build.c
+++ b/hw/i386/acpi-build.c
@@ -596,6 +596,10 @@ static void build_append_pci_bus_devices(Aml *parent_scope, PCIBus *bus,
QLIST_FOREACH(sec, &bus->child, sibling) {
int32_t devfn = sec->parent_dev->devfn;
+ if (pci_bus_is_root(sec) || pci_bus_is_express(sec)) {
+ continue;
+ }
+
aml_append(method, aml_name("^S%.02X.PCNT", devfn));
}
}
--
2.4.3
^ permalink raw reply related [flat|nested] 9+ messages in thread
* [Qemu-devel] [PATCH V4 4/6] acpi: refactor pxb crs computation
2016-06-30 19:07 [Qemu-devel] [PATCH V4 0/6] pxb: fix 64-bit MMIO allocation Marcel Apfelbaum
` (2 preceding siblings ...)
2016-06-30 19:07 ` [Qemu-devel] [PATCH V4 3/6] hw/acpi: fix a DSDT table issue when a pxb is present Marcel Apfelbaum
@ 2016-06-30 19:07 ` Marcel Apfelbaum
2016-06-30 19:07 ` [Qemu-devel] [PATCH V4 5/6] hw/apci: handle 64-bit MMIO regions correctly Marcel Apfelbaum
` (2 subsequent siblings)
6 siblings, 0 replies; 9+ messages in thread
From: Marcel Apfelbaum @ 2016-06-30 19:07 UTC (permalink / raw)
To: qemu-devel; +Cc: marcel, mst, pbonzini, imammedo, lersek, ehabkost
Instead of always passing both IO and MEM ranges when
computing CRS ranges, define a new CrsRangeSet structure
that include them both.
This is done before introducing a third type of range,
64-bit MEM, so it will be easier to pass them all around.
Reviewed-by: Igor Mammedov <imammedo@redhat.com>
Signed-off-by: Marcel Apfelbaum <marcel@redhat.com>
---
hw/i386/acpi-build.c | 82 ++++++++++++++++++++++++++++++++--------------------
1 file changed, 51 insertions(+), 31 deletions(-)
diff --git a/hw/i386/acpi-build.c b/hw/i386/acpi-build.c
index 675a3dc..eca195d 100644
--- a/hw/i386/acpi-build.c
+++ b/hw/i386/acpi-build.c
@@ -747,6 +747,23 @@ static void crs_range_free(gpointer data)
g_free(entry);
}
+typedef struct CrsRangeSet {
+ GPtrArray *io_ranges;
+ GPtrArray *mem_ranges;
+ } CrsRangeSet;
+
+static void crs_range_set_init(CrsRangeSet *range_set)
+{
+ range_set->io_ranges = g_ptr_array_new_with_free_func(crs_range_free);
+ range_set->mem_ranges = g_ptr_array_new_with_free_func(crs_range_free);
+}
+
+static void crs_range_set_free(CrsRangeSet *range_set)
+{
+ g_ptr_array_free(range_set->io_ranges, true);
+ g_ptr_array_free(range_set->mem_ranges, true);
+}
+
static gint crs_range_compare(gconstpointer a, gconstpointer b)
{
CrsRangeEntry *entry_a = *(CrsRangeEntry **)a;
@@ -831,18 +848,17 @@ static void crs_range_merge(GPtrArray *range)
g_ptr_array_free(tmp, true);
}
-static Aml *build_crs(PCIHostState *host,
- GPtrArray *io_ranges, GPtrArray *mem_ranges)
+static Aml *build_crs(PCIHostState *host, CrsRangeSet *range_set)
{
Aml *crs = aml_resource_template();
- GPtrArray *host_io_ranges = g_ptr_array_new_with_free_func(crs_range_free);
- GPtrArray *host_mem_ranges = g_ptr_array_new_with_free_func(crs_range_free);
+ CrsRangeSet temp_range_set;
CrsRangeEntry *entry;
uint8_t max_bus = pci_bus_num(host->bus);
uint8_t type;
int devfn;
int i;
+ crs_range_set_init(&temp_range_set);
for (devfn = 0; devfn < ARRAY_SIZE(host->bus->devices); devfn++) {
uint64_t range_base, range_limit;
PCIDevice *dev = host->bus->devices[devfn];
@@ -866,9 +882,11 @@ static Aml *build_crs(PCIHostState *host,
}
if (r->type & PCI_BASE_ADDRESS_SPACE_IO) {
- crs_range_insert(host_io_ranges, range_base, range_limit);
+ crs_range_insert(temp_range_set.io_ranges,
+ range_base, range_limit);
} else { /* "memory" */
- crs_range_insert(host_mem_ranges, range_base, range_limit);
+ crs_range_insert(temp_range_set.mem_ranges,
+ range_base, range_limit);
}
}
@@ -887,7 +905,8 @@ static Aml *build_crs(PCIHostState *host,
* that do not support multiple root buses
*/
if (range_base && range_base <= range_limit) {
- crs_range_insert(host_io_ranges, range_base, range_limit);
+ crs_range_insert(temp_range_set.io_ranges,
+ range_base, range_limit);
}
range_base =
@@ -900,7 +919,8 @@ static Aml *build_crs(PCIHostState *host,
* that do not support multiple root buses
*/
if (range_base && range_base <= range_limit) {
- crs_range_insert(host_mem_ranges, range_base, range_limit);
+ crs_range_insert(temp_range_set.mem_ranges,
+ range_base, range_limit);
}
range_base =
@@ -913,35 +933,36 @@ static Aml *build_crs(PCIHostState *host,
* that do not support multiple root buses
*/
if (range_base && range_base <= range_limit) {
- crs_range_insert(host_mem_ranges, range_base, range_limit);
+ crs_range_insert(temp_range_set.mem_ranges,
+ range_base, range_limit);
}
}
}
- crs_range_merge(host_io_ranges);
- for (i = 0; i < host_io_ranges->len; i++) {
- entry = g_ptr_array_index(host_io_ranges, i);
+ crs_range_merge(temp_range_set.io_ranges);
+ for (i = 0; i < temp_range_set.io_ranges->len; i++) {
+ entry = g_ptr_array_index(temp_range_set.io_ranges, i);
aml_append(crs,
aml_word_io(AML_MIN_FIXED, AML_MAX_FIXED,
AML_POS_DECODE, AML_ENTIRE_RANGE,
0, entry->base, entry->limit, 0,
entry->limit - entry->base + 1));
- crs_range_insert(io_ranges, entry->base, entry->limit);
+ crs_range_insert(range_set->io_ranges, entry->base, entry->limit);
}
- g_ptr_array_free(host_io_ranges, true);
- crs_range_merge(host_mem_ranges);
- for (i = 0; i < host_mem_ranges->len; i++) {
- entry = g_ptr_array_index(host_mem_ranges, i);
+ crs_range_merge(temp_range_set.mem_ranges);
+ for (i = 0; i < temp_range_set.mem_ranges->len; i++) {
+ entry = g_ptr_array_index(temp_range_set.mem_ranges, i);
aml_append(crs,
aml_dword_memory(AML_POS_DECODE, AML_MIN_FIXED,
AML_MAX_FIXED, AML_NON_CACHEABLE,
AML_READ_WRITE,
0, entry->base, entry->limit, 0,
entry->limit - entry->base + 1));
- crs_range_insert(mem_ranges, entry->base, entry->limit);
+ crs_range_insert(range_set->mem_ranges, entry->base, entry->limit);
}
- g_ptr_array_free(host_mem_ranges, true);
+
+ crs_range_set_free(&temp_range_set);
aml_append(crs,
aml_word_bus_number(AML_MIN_FIXED, AML_MAX_FIXED, AML_POS_DECODE,
@@ -1898,8 +1919,7 @@ build_dsdt(GArray *table_data, BIOSLinker *linker,
{
CrsRangeEntry *entry;
Aml *dsdt, *sb_scope, *scope, *dev, *method, *field, *pkg, *crs;
- GPtrArray *mem_ranges = g_ptr_array_new_with_free_func(crs_range_free);
- GPtrArray *io_ranges = g_ptr_array_new_with_free_func(crs_range_free);
+ CrsRangeSet crs_range_set;
PCMachineState *pcms = PC_MACHINE(machine);
PCMachineClass *pcmc = PC_MACHINE_GET_CLASS(machine);
uint32_t nr_mem = machine->ram_slots;
@@ -1988,6 +2008,7 @@ build_dsdt(GArray *table_data, BIOSLinker *linker,
}
aml_append(dsdt, scope);
+ crs_range_set_init(&crs_range_set);
bus = PC_MACHINE(machine)->bus;
if (bus) {
QLIST_FOREACH(bus, &bus->child, sibling) {
@@ -2014,8 +2035,7 @@ build_dsdt(GArray *table_data, BIOSLinker *linker,
}
aml_append(dev, build_prt(false));
- crs = build_crs(PCI_HOST_BRIDGE(BUS(bus)->parent),
- io_ranges, mem_ranges);
+ crs = build_crs(PCI_HOST_BRIDGE(BUS(bus)->parent), &crs_range_set);
aml_append(dev, aml_name_decl("_CRS", crs));
aml_append(scope, dev);
aml_append(dsdt, scope);
@@ -2036,9 +2056,9 @@ build_dsdt(GArray *table_data, BIOSLinker *linker,
AML_POS_DECODE, AML_ENTIRE_RANGE,
0x0000, 0x0000, 0x0CF7, 0x0000, 0x0CF8));
- crs_replace_with_free_ranges(io_ranges, 0x0D00, 0xFFFF);
- for (i = 0; i < io_ranges->len; i++) {
- entry = g_ptr_array_index(io_ranges, i);
+ crs_replace_with_free_ranges(crs_range_set.io_ranges, 0x0D00, 0xFFFF);
+ for (i = 0; i < crs_range_set.io_ranges->len; i++) {
+ entry = g_ptr_array_index(crs_range_set.io_ranges, i);
aml_append(crs,
aml_word_io(AML_MIN_FIXED, AML_MAX_FIXED,
AML_POS_DECODE, AML_ENTIRE_RANGE,
@@ -2051,9 +2071,10 @@ build_dsdt(GArray *table_data, BIOSLinker *linker,
AML_CACHEABLE, AML_READ_WRITE,
0, 0x000A0000, 0x000BFFFF, 0, 0x00020000));
- crs_replace_with_free_ranges(mem_ranges, pci->w32.begin, pci->w32.end - 1);
- for (i = 0; i < mem_ranges->len; i++) {
- entry = g_ptr_array_index(mem_ranges, i);
+ crs_replace_with_free_ranges(crs_range_set.mem_ranges,
+ pci->w32.begin, pci->w32.end - 1);
+ for (i = 0; i < crs_range_set. mem_ranges->len; i++) {
+ entry = g_ptr_array_index(crs_range_set.mem_ranges, i);
aml_append(crs,
aml_dword_memory(AML_POS_DECODE, AML_MIN_FIXED, AML_MAX_FIXED,
AML_NON_CACHEABLE, AML_READ_WRITE,
@@ -2088,8 +2109,7 @@ build_dsdt(GArray *table_data, BIOSLinker *linker,
aml_append(dev, aml_name_decl("_CRS", crs));
aml_append(scope, dev);
- g_ptr_array_free(io_ranges, true);
- g_ptr_array_free(mem_ranges, true);
+ crs_range_set_free(&crs_range_set);
/* reserve PCIHP resources */
if (pm->pcihp_io_len) {
--
2.4.3
^ permalink raw reply related [flat|nested] 9+ messages in thread
* [Qemu-devel] [PATCH V4 5/6] hw/apci: handle 64-bit MMIO regions correctly
2016-06-30 19:07 [Qemu-devel] [PATCH V4 0/6] pxb: fix 64-bit MMIO allocation Marcel Apfelbaum
` (3 preceding siblings ...)
2016-06-30 19:07 ` [Qemu-devel] [PATCH V4 4/6] acpi: refactor pxb crs computation Marcel Apfelbaum
@ 2016-06-30 19:07 ` Marcel Apfelbaum
2016-06-30 19:07 ` [Qemu-devel] [PATCH V4 6/6] tests/acpi: Add pxb/pxb-pcie tests blobs Marcel Apfelbaum
2016-07-01 13:57 ` [Qemu-devel] [PATCH V4 0/6] pxb: fix 64-bit MMIO allocation Laszlo Ersek
6 siblings, 0 replies; 9+ messages in thread
From: Marcel Apfelbaum @ 2016-06-30 19:07 UTC (permalink / raw)
To: qemu-devel; +Cc: marcel, mst, pbonzini, imammedo, lersek, ehabkost
In build_crs(), the calculation and merging of the ranges already happens
in 64-bit, but the entry boundaries are silently truncated to 32-bit in the
call to aml_dword_memory(). Fix it by handling the 64-bit MMIO ranges separately.
This fixes 64-bit BARs behind PXBs.
Reviewed-by: Igor Mammedov <imammedo@redhat.com>
Signed-off-by: Marcel Apfelbaum <marcel@redhat.com>
---
hw/i386/acpi-build.c | 53 +++++++++++++++++++++++++++++++++++++++++++---------
1 file changed, 44 insertions(+), 9 deletions(-)
diff --git a/hw/i386/acpi-build.c b/hw/i386/acpi-build.c
index eca195d..cfcca71 100644
--- a/hw/i386/acpi-build.c
+++ b/hw/i386/acpi-build.c
@@ -750,18 +750,22 @@ static void crs_range_free(gpointer data)
typedef struct CrsRangeSet {
GPtrArray *io_ranges;
GPtrArray *mem_ranges;
+ GPtrArray *mem_64bit_ranges;
} CrsRangeSet;
static void crs_range_set_init(CrsRangeSet *range_set)
{
range_set->io_ranges = g_ptr_array_new_with_free_func(crs_range_free);
range_set->mem_ranges = g_ptr_array_new_with_free_func(crs_range_free);
+ range_set->mem_64bit_ranges =
+ g_ptr_array_new_with_free_func(crs_range_free);
}
static void crs_range_set_free(CrsRangeSet *range_set)
{
g_ptr_array_free(range_set->io_ranges, true);
g_ptr_array_free(range_set->mem_ranges, true);
+ g_ptr_array_free(range_set->mem_64bit_ranges, true);
}
static gint crs_range_compare(gconstpointer a, gconstpointer b)
@@ -919,8 +923,14 @@ static Aml *build_crs(PCIHostState *host, CrsRangeSet *range_set)
* that do not support multiple root buses
*/
if (range_base && range_base <= range_limit) {
- crs_range_insert(temp_range_set.mem_ranges,
- range_base, range_limit);
+ uint64_t length = range_limit - range_base + 1;
+ if (range_limit <= UINT32_MAX && length <= UINT32_MAX) {
+ crs_range_insert(temp_range_set.mem_ranges,
+ range_base, range_limit);
+ } else {
+ crs_range_insert(temp_range_set.mem_64bit_ranges,
+ range_base, range_limit);
+ }
}
range_base =
@@ -933,8 +943,14 @@ static Aml *build_crs(PCIHostState *host, CrsRangeSet *range_set)
* that do not support multiple root buses
*/
if (range_base && range_base <= range_limit) {
- crs_range_insert(temp_range_set.mem_ranges,
- range_base, range_limit);
+ uint64_t length = range_limit - range_base + 1;
+ if (range_limit <= UINT32_MAX && length <= UINT32_MAX) {
+ crs_range_insert(temp_range_set.mem_ranges,
+ range_base, range_limit);
+ } else {
+ crs_range_insert(temp_range_set.mem_64bit_ranges,
+ range_base, range_limit);
+ }
}
}
}
@@ -962,6 +978,19 @@ static Aml *build_crs(PCIHostState *host, CrsRangeSet *range_set)
crs_range_insert(range_set->mem_ranges, entry->base, entry->limit);
}
+ crs_range_merge(temp_range_set.mem_64bit_ranges);
+ for (i = 0; i < temp_range_set.mem_64bit_ranges->len; i++) {
+ entry = g_ptr_array_index(temp_range_set.mem_64bit_ranges, i);
+ aml_append(crs,
+ aml_qword_memory(AML_POS_DECODE, AML_MIN_FIXED,
+ AML_MAX_FIXED, AML_NON_CACHEABLE,
+ AML_READ_WRITE,
+ 0, entry->base, entry->limit, 0,
+ entry->limit - entry->base + 1));
+ crs_range_insert(range_set->mem_64bit_ranges,
+ entry->base, entry->limit);
+ }
+
crs_range_set_free(&temp_range_set);
aml_append(crs,
@@ -2083,11 +2112,17 @@ build_dsdt(GArray *table_data, BIOSLinker *linker,
}
if (pci->w64.begin) {
- aml_append(crs,
- aml_qword_memory(AML_POS_DECODE, AML_MIN_FIXED, AML_MAX_FIXED,
- AML_CACHEABLE, AML_READ_WRITE,
- 0, pci->w64.begin, pci->w64.end - 1, 0,
- pci->w64.end - pci->w64.begin));
+ crs_replace_with_free_ranges(crs_range_set.mem_64bit_ranges,
+ pci->w64.begin, pci->w64.end - 1);
+ for (i = 0; i < crs_range_set.mem_64bit_ranges->len; i++) {
+ entry = g_ptr_array_index(crs_range_set.mem_64bit_ranges, i);
+ aml_append(crs,
+ aml_qword_memory(AML_POS_DECODE, AML_MIN_FIXED,
+ AML_MAX_FIXED,
+ AML_CACHEABLE, AML_READ_WRITE,
+ 0, entry->base, entry->limit,
+ 0, entry->limit - entry->base + 1));
+ }
}
if (misc->tpm_version != TPM_VERSION_UNSPEC) {
--
2.4.3
^ permalink raw reply related [flat|nested] 9+ messages in thread
* [Qemu-devel] [PATCH V4 6/6] tests/acpi: Add pxb/pxb-pcie tests blobs
2016-06-30 19:07 [Qemu-devel] [PATCH V4 0/6] pxb: fix 64-bit MMIO allocation Marcel Apfelbaum
` (4 preceding siblings ...)
2016-06-30 19:07 ` [Qemu-devel] [PATCH V4 5/6] hw/apci: handle 64-bit MMIO regions correctly Marcel Apfelbaum
@ 2016-06-30 19:07 ` Marcel Apfelbaum
2016-07-01 13:57 ` [Qemu-devel] [PATCH V4 0/6] pxb: fix 64-bit MMIO allocation Laszlo Ersek
6 siblings, 0 replies; 9+ messages in thread
From: Marcel Apfelbaum @ 2016-06-30 19:07 UTC (permalink / raw)
To: qemu-devel; +Cc: marcel, mst, pbonzini, imammedo, lersek, ehabkost
Signed-off-by: Marcel Apfelbaum <marcel@redhat.com>
---
tests/acpi-test-data/pc/DSDT.pxb | Bin 0 -> 6280 bytes
tests/acpi-test-data/q35/DSDT.pxb_pcie | Bin 0 -> 9098 bytes
2 files changed, 0 insertions(+), 0 deletions(-)
create mode 100644 tests/acpi-test-data/pc/DSDT.pxb
create mode 100644 tests/acpi-test-data/q35/DSDT.pxb_pcie
diff --git a/tests/acpi-test-data/pc/DSDT.pxb b/tests/acpi-test-data/pc/DSDT.pxb
new file mode 100644
index 0000000000000000000000000000000000000000..1733aeceb843c449d7560d4728115b096e709da2
GIT binary patch
literal 6280
zcmb_gZEqXL5uW9XbX-!>Q98@=TTIAy+@!J17e{u`q7ZpUiL`js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`wBF41%gc>x_WT1VV+@Qv!M_2&xIKrv>zMAXI2QBcNx3phcne
ztbm>kgbJ<a1oT`GbU|o+Pe9)bgbJ<a1@!!JP-W?~cBfhobrVmT_yf@nHLwkjND*<f
zN6aIEO~{wDh#<+>lV%)G<sB0{NskH<)t5z(!hX<`NksK!WDKjiCnIZfeHod<+U&{5
z-VKsXJZWM>#WQQi#2OPco?1vB%JJ;lF|k^N93L@AAIfE-G4F*u<<W=od7?3cg}mj_
zhjK4s%tax`Q)0(d2jmnrW>sHKaccu|iX8K!FHaFYAfHDXce*cc5sh-?Jlz}dmumXS
Pk#-Fau@%-EXgvHs$6*Lt
literal 0
HcmV?d00001
diff --git a/tests/acpi-test-data/q35/DSDT.pxb_pcie b/tests/acpi-test-data/q35/DSDT.pxb_pcie
new file mode 100644
index 0000000000000000000000000000000000000000..838ca876dece056934ed511197c2a8fa0d27fd11
GIT binary patch
literal 9098
zcmb7KU2hx56`dt1YB{8&rL>aeuZXaVrb*+3l3XX~M__W7B3W@Iilp;V8XzSrt(>&T
zLa~83Mi5B>62}h(62?LMRNByU{zCH;^40)->SOy_6!BBkb7yww8BzjbJ}l?Xo^$V<
z-Pt+IUHVPGb^jt`*1wDEUZt5UzESsl^jVBCYSXt<O<ZT~J-=A)Sm{{8YVW5-8=Io-
zzTg+Hm94+*bie9$Z++UeHbb`c$a%1}8Gd}PyTu4}dn@Fe8qRZ_X0g-Wt9#9sm1bY_
zjA$3FbmnVHi~i!(x>qgQ&U!{b56T(DdAn1o`kBJF+_pQOY{l(P!EZ3TbFJ!IcJo@j
z&TOyMs4>@1b=I3+;{H3#^Iu==uZ;J0vNPOi2mf6De&O8JuU@}Z_~tkN`2GENcmjYW
zeB1b54k@5K)L5oecWJ}V)3)z?(YtAVh&_t}z1W}oqNi}O+o7EyfvNvtM)p#P#lv@;
zz?OPScBNiwDLoccVEj0`m3k{+8OFZ-A<Yu)eTU+i*Gg-CuHNuFIrmDZ*($J*db%NX
zZGO<@PPd==yw_#D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(5 preceding siblings ...)
2016-06-30 19:07 ` [Qemu-devel] [PATCH V4 6/6] tests/acpi: Add pxb/pxb-pcie tests blobs Marcel Apfelbaum
@ 2016-07-01 13:57 ` Laszlo Ersek
2016-07-01 14:15 ` Marcel Apfelbaum
6 siblings, 1 reply; 9+ messages in thread
From: Laszlo Ersek @ 2016-07-01 13:57 UTC (permalink / raw)
To: Marcel Apfelbaum, qemu-devel; +Cc: ehabkost, mst, imammedo, pbonzini
On 06/30/16 21:07, Marcel Apfelbaum wrote:
> 64-bit BARs allocations fix for devices behind PXBs/PXB-PCIEs.
>
> In build_crs() the calculation and merging of the ranges already happens
> in 64-bit, but the entry boundaries are silently truncated to 32-bit in the
> call to aml_dword_memory(). Fix it by handling the 64-bit MMIO ranges separately.
>
> v3 -> v4:
> Addressed Igor's comments (thanks for the productive review!)
> - Split pxb test patch (previously patch 3/3) into the test itself (patch 1/6) and the blobs (patch 6/6).
> - New patch declaring pxb/pxb-pxie as not hot-pluggable.
> - Note that it does not solve the DSDT issue, but it is a prerequisite for the next patch.
> - New patch solving the DSDT issue spotted by Igor.
> - Using V=1 DIFF=diff make check does make it easier to review the ACPI changes, thanks.
> - Patches 4 and 5 untouched (previously patches 1/3 and 2/3)
>
> v2 -> v3:
> - split original series "pci: better support for 64-bit MMIO allocation" into 2 series:
> - this is the first part dealing with correct 64-bit MMIO ACPI computation
> - the second one will include 64-bit MMIO reservation for PCI hotplug
> - Add pxb/pxb-pcie tests (Igor) - See diffs below (*)
> - Re-based on latest master.
>
> v1 -> v2:
> - resolved some styling issues (Laszlo)
> - rebase on latest master (Laszlo)
>
> Thank you,
> Marcel
>
> Marcel Apfelbaum (6):
> tests/acpi: add pxb/pxb-pcie tests
> hw/pxb: declare pxb devices as not hot-pluggable
> hw/acpi: fix a DSDT table issue when a pxb is present.
> acpi: refactor pxb crs computation
> hw/apci: handle 64-bit MMIO regions correctly
> tests/acpi: Add pxb/pxb-pcie tests blobs
>
> hw/i386/acpi-build.c | 131 ++++++++++++++++++++++++---------
> hw/pci-bridge/pci_expander_bridge.c | 2 +
> tests/acpi-test-data/pc/DSDT.pxb | Bin 0 -> 6280 bytes
> tests/acpi-test-data/q35/DSDT.pxb_pcie | Bin 0 -> 9098 bytes
> tests/bios-tables-test.c | 37 ++++++++++
> 5 files changed, 134 insertions(+), 36 deletions(-)
> create mode 100644 tests/acpi-test-data/pc/DSDT.pxb
> create mode 100644 tests/acpi-test-data/q35/DSDT.pxb_pcie
>
I used the following commands to test (part of) the series:
> VIRTIO10=1
> ISO=/mnt/data/isos/iso-fedora/Fedora-Workstation-Live-x86_64-24-1.2.iso
> CODE=/home/virt-images/OVMF_CODE.fd
> TMPL=/home/virt-images/OVMF_VARS.fd
> TFTP=/var/lib/dnsmasq
> BF=shim.efi
>
> if [ $VIRTIO10 -eq 0 ]; then
> MODERN=disable-legacy=off,disable-modern=on
> else
> MODERN=disable-legacy=on,disable-modern=off
> fi
>
> cp $TMPL vars3.fd
>
> qemu-system-x86_64 \
> -m 2048 \
> -M pc \
> -enable-kvm \
> -device qxl-vga \
> -drive if=pflash,readonly,format=raw,file=$CODE \
> -drive if=pflash,format=raw,file=vars3.fd \
> -drive id=cdrom,if=none,readonly,format=raw,cache=writethrough,file=$ISO \
> \
> -debugcon file:debug3.log \
> -global isa-debugcon.iobase=0x402 \
> \
> -chardev stdio,signal=off,mux=on,id=char0 \
> -mon chardev=char0,mode=readline,default \
> -serial chardev:char0 \
> \
> -device pxb,bus=pci.0,id=bridge1,bus_nr=11 \
> -device pxb,bus=pci.0,id=bridge2,bus_nr=7 \
> -device pxb,bus=pci.0,id=bridge3,bus_nr=15 \
> \
> -device virtio-scsi-pci,id=scsi0,$MODERN,bus=pci.0 \
> -device scsi-cd,bus=scsi0.0,drive=cdrom,bootindex=1 \
> \
> -netdev user,id=netdev0,hostfwd=tcp:127.0.0.1:2227-:22,tftp=$TFTP,bootfile=$BF,net=10.0.2.0/24 \
> -device virtio-net-pci,netdev=netdev0,romfile=,$MODERN,bootindex=2,bus=bridge1,addr=2 \
> \
> -netdev user,id=netdev1,hostfwd=tcp:127.0.0.1:2228-:22,net=10.0.3.0/24 \
> -device virtio-net-pci,netdev=netdev1,romfile=,$MODERN,bootindex=3,bus=bridge2,addr=3 \
> \
> -netdev user,id=netdev2,hostfwd=tcp:127.0.0.1:2229-:22,net=10.0.4.0/24 \
> -device virtio-net-pci,netdev=netdev2,romfile=,$MODERN,bootindex=4,bus=bridge3,addr=4 \
> \
> -global PIIX4_PM.disable_s3=0 \
>
This is /proc/iomem from within the guest:
> 00000000-00000fff : reserved
> 00001000-0009ffff : System RAM
> 000a0000-000bffff : PCI Bus 0000:00
> 000f0000-000fffff : System ROM
> 00100000-007fffff : System RAM
> 00800000-00807fff : ACPI Non-volatile Storage
> 00808000-0080ffff : System RAM
> 00810000-008fffff : ACPI Non-volatile Storage
> 00900000-7e529017 : System RAM
> 02000000-027d3cf3 : Kernel code
> 027d3cf4-02d4dfff : Kernel data
> 02edc000-0305dfff : Kernel bss
> 7e529018-7e532857 : System RAM
> 7e532858-7e800fff : System RAM
> 7e801000-7e820fff : ACPI Non-volatile Storage
> 7e821000-7e84afff : reserved
> 7e84b000-7ebe1fff : System RAM
> 7ebe2000-7ebfdfff : reserved
> 7ebfe000-7ec22fff : System RAM
> 7ec23000-7ec35fff : reserved
> 7ec36000-7ec99fff : System RAM
> 7ec9a000-7ee16fff : reserved
> 7ee17000-7fe96fff : System RAM
> 7fe97000-7feeefff : reserved
> 7feef000-7fef6fff : ACPI Tables
> 7fef7000-7fefafff : ACPI Non-volatile Storage
> 7fefb000-7ffcffff : System RAM
> 7ffd0000-7ffeffff : reserved
> 7fff0000-7fffffff : System RAM
> 80000000-880fffff : PCI Bus 0000:00
> 80000000-83ffffff : 0000:00:02.0
> 84000000-87ffffff : 0000:00:02.0
> 88000000-88001fff : 0000:00:02.0
> 88002000-88002fff : 0000:00:06.0
> 88010000-8801ffff : 0000:00:02.0
> 88100000-881fffff : PCI Bus 0000:07
> 88100000-881fffff : PCI Bus 0000:08
> 88100000-88100fff : 0000:08:03.0
> 88200000-882fffff : PCI Bus 0000:0b
> 88200000-882fffff : PCI Bus 0000:0c
> 88200000-88200fff : 0000:0c:02.0
> 88300000-883fffff : PCI Bus 0000:0f
> 88300000-883fffff : PCI Bus 0000:10
> 88300000-88300fff : 0000:10:04.0
> 88400000-febfffff : PCI Bus 0000:00
> fec00000-fec003ff : IOAPIC 0
> fed00000-fed003ff : HPET 0
> fed00000-fed003ff : PNP0103:00
> fee00000-fee00fff : Local APIC
> ffe00000-ffffffff : reserved
> 800000000-8007fffff : PCI Bus 0000:00
> 800000000-8007fffff : 0000:00:06.0
> 800000000-8007fffff : virtio-pci-modern
> 800800000-800ffffff : PCI Bus 0000:07
> 800800000-800ffffff : PCI Bus 0000:08
> 800800000-800ffffff : 0000:08:03.0
> 800800000-800ffffff : virtio-pci-modern
> 801000000-8017fffff : PCI Bus 0000:0b
> 801000000-8017fffff : PCI Bus 0000:0c
> 801000000-8017fffff : 0000:0c:02.0
> 801000000-8017fffff : virtio-pci-modern
> 801800000-801ffffff : PCI Bus 0000:0f
> 801800000-801ffffff : PCI Bus 0000:10
> 801800000-801ffffff : 0000:10:04.0
> 801800000-801ffffff : virtio-pci-modern
It looks good to me. I also checked the _CRS objects in the DSDT in the guest (cursorily), it seemed okay.
Guest dmesg contains no problems.
The virtio-scsi CD obviously worked (booted Fedora 24 Live off of it). I also logged into the guest through all three NICs, with ssh.
Below an excerpt from the OVMF debug log -- it appears consistent with the guest's /proc/iomem:
> PciHostBridgeGetRootBridges: 3 extra root buses reported by QEMU
> InitRootBridge: populated root bus 0, with room for 6 subordinate bus(es)
> InitRootBridge: populated root bus 7, with room for 3 subordinate bus(es)
> InitRootBridge: populated root bus 11, with room for 3 subordinate bus(es)
> InitRootBridge: populated root bus 15, with room for 240 subordinate bus(es)
> RootBridge: PciRoot(0x0)
> Support/Attr: 70069 / 70069
> DmaAbove4G: No
> NoExtConfSpace: Yes
> AllocAttr: 3 (CombineMemPMem Mem64Decode)
> Bus: 0 - 6
> Io: C000 - FFFF
> Mem: 80000000 - FBFFFFFF
> MemAbove4G: 800000000 - FFFFFFFFF
> PMem: FFFFFFFFFFFFFFFF - 0
> PMemAbove4G: FFFFFFFFFFFFFFFF - 0
> PciHostBridgeDxe: IntersectMemoryDescriptor: add [800000000, 1000000000): Success
> RootBridge: PciRoot(0x7)
> Support/Attr: 70069 / 70069
> DmaAbove4G: No
> NoExtConfSpace: Yes
> AllocAttr: 3 (CombineMemPMem Mem64Decode)
> Bus: 7 - A
> Io: C000 - FFFF
> Mem: 80000000 - FBFFFFFF
> MemAbove4G: 800000000 - FFFFFFFFF
> PMem: FFFFFFFFFFFFFFFF - 0
> PMemAbove4G: FFFFFFFFFFFFFFFF - 0
> RootBridge: PciRoot(0xB)
> Support/Attr: 70069 / 70069
> DmaAbove4G: No
> NoExtConfSpace: Yes
> AllocAttr: 3 (CombineMemPMem Mem64Decode)
> Bus: B - E
> Io: C000 - FFFF
> Mem: 80000000 - FBFFFFFF
> MemAbove4G: 800000000 - FFFFFFFFF
> PMem: FFFFFFFFFFFFFFFF - 0
> PMemAbove4G: FFFFFFFFFFFFFFFF - 0
> RootBridge: PciRoot(0xF)
> Support/Attr: 70069 / 70069
> DmaAbove4G: No
> NoExtConfSpace: Yes
> AllocAttr: 3 (CombineMemPMem Mem64Decode)
> Bus: F - FF
> Io: C000 - FFFF
> Mem: 80000000 - FBFFFFFF
> MemAbove4G: 800000000 - FFFFFFFFF
> PMem: FFFFFFFFFFFFFFFF - 0
> PMemAbove4G: FFFFFFFFFFFFFFFF - 0
>
> [...]
>
> PCI Bus First Scanning
> PciBus: Discovered PCI @ [00|00|00]
>
> PciBus: Discovered PCI @ [00|01|00]
>
> PciBus: Discovered PCI @ [00|01|01]
> BAR[4]: Type = Io32; Alignment = 0xF; Length = 0x10; Offset = 0x20
>
> PciBus: Discovered PCI @ [00|01|03]
>
> PciBus: Discovered PCI @ [00|02|00]
> BAR[0]: Type = Mem32; Alignment = 0x3FFFFFF; Length = 0x4000000; Offset = 0x10
> BAR[1]: Type = Mem32; Alignment = 0x3FFFFFF; Length = 0x4000000; Offset = 0x14
> BAR[2]: Type = Mem32; Alignment = 0x1FFF; Length = 0x2000; Offset = 0x18
> BAR[3]: Type = Io32; Alignment = 0x1F; Length = 0x20; Offset = 0x1C
>
> PciBus: Discovered PCI @ [00|03|00]
>
> PciBus: Discovered PCI @ [00|04|00]
>
> PciBus: Discovered PCI @ [00|05|00]
>
> PciBus: Discovered PCI @ [00|06|00]
> BAR[1]: Type = Mem32; Alignment = 0xFFF; Length = 0x1000; Offset = 0x14
> BAR[4]: Type = PMem64; Alignment = 0x7FFFFF; Length = 0x800000; Offset = 0x20
>
> PciBus: Discovered PPB @ [07|00|00]
>
> PciBus: Discovered PCI @ [08|03|00]
> BAR[1]: Type = Mem32; Alignment = 0xFFF; Length = 0x1000; Offset = 0x14
> BAR[4]: Type = PMem64; Alignment = 0x7FFFFF; Length = 0x800000; Offset = 0x20
>
> PciBus: Discovered PPB @ [0B|00|00]
>
> PciBus: Discovered PCI @ [0C|02|00]
> BAR[1]: Type = Mem32; Alignment = 0xFFF; Length = 0x1000; Offset = 0x14
> BAR[4]: Type = PMem64; Alignment = 0x7FFFFF; Length = 0x800000; Offset = 0x20
>
> PciBus: Discovered PPB @ [0F|00|00]
>
> PciBus: Discovered PCI @ [10|04|00]
> BAR[1]: Type = Mem32; Alignment = 0xFFF; Length = 0x1000; Offset = 0x14
> BAR[4]: Type = PMem64; Alignment = 0x7FFFFF; Length = 0x800000; Offset = 0x20
>
> PciBus: Discovered PCI @ [00|00|00]
>
> PciBus: Discovered PCI @ [00|01|00]
>
> PciBus: Discovered PCI @ [00|01|01]
> BAR[4]: Type = Io32; Alignment = 0xF; Length = 0x10; Offset = 0x20
>
> PciBus: Discovered PCI @ [00|01|03]
>
> PciBus: Discovered PCI @ [00|02|00]
> BAR[0]: Type = Mem32; Alignment = 0x3FFFFFF; Length = 0x4000000; Offset = 0x10
> BAR[1]: Type = Mem32; Alignment = 0x3FFFFFF; Length = 0x4000000; Offset = 0x14
> BAR[2]: Type = Mem32; Alignment = 0x1FFF; Length = 0x2000; Offset = 0x18
> BAR[3]: Type = Io32; Alignment = 0x1F; Length = 0x20; Offset = 0x1C
>
> PciBus: Discovered PCI @ [00|03|00]
>
> PciBus: Discovered PCI @ [00|04|00]
>
> PciBus: Discovered PCI @ [00|05|00]
>
> PciBus: Discovered PCI @ [00|06|00]
> BAR[1]: Type = Mem32; Alignment = 0xFFF; Length = 0x1000; Offset = 0x14
> BAR[4]: Type = PMem64; Alignment = 0x7FFFFF; Length = 0x800000; Offset = 0x20
>
> PciBus: Discovered PPB @ [07|00|00]
>
> PciBus: Discovered PCI @ [08|03|00]
> BAR[1]: Type = Mem32; Alignment = 0xFFF; Length = 0x1000; Offset = 0x14
> BAR[4]: Type = PMem64; Alignment = 0x7FFFFF; Length = 0x800000; Offset = 0x20
>
> PciBus: Discovered PPB @ [0B|00|00]
>
> PciBus: Discovered PCI @ [0C|02|00]
> BAR[1]: Type = Mem32; Alignment = 0xFFF; Length = 0x1000; Offset = 0x14
> BAR[4]: Type = PMem64; Alignment = 0x7FFFFF; Length = 0x800000; Offset = 0x20
>
> PciBus: Discovered PPB @ [0F|00|00]
>
> PciBus: Discovered PCI @ [10|04|00]
> BAR[1]: Type = Mem32; Alignment = 0xFFF; Length = 0x1000; Offset = 0x14
> BAR[4]: Type = PMem64; Alignment = 0x7FFFFF; Length = 0x800000; Offset = 0x20
>
> PciHostBridge: SubmitResources for PciRoot(0x0)
> I/O: Granularity/SpecificFlag = 0 / 01
> Length/Alignment = 0x1000 / 0xFFF
> Mem: Granularity/SpecificFlag = 32 / 00
> Length/Alignment = 0x8100000 / 0x3FFFFFF
> Mem: Granularity/SpecificFlag = 64 / 00
> Length/Alignment = 0x800000 / 0x7FFFFF
> PciBus: HostBridge->SubmitResources() - Success
> PciHostBridge: SubmitResources for PciRoot(0x7)
> Mem: Granularity/SpecificFlag = 32 / 00
> Length/Alignment = 0x100000 / 0xFFFFF
> Mem: Granularity/SpecificFlag = 64 / 00
> Length/Alignment = 0x800000 / 0x7FFFFF
> PciBus: HostBridge->SubmitResources() - Success
> PciHostBridge: SubmitResources for PciRoot(0xB)
> Mem: Granularity/SpecificFlag = 32 / 00
> Length/Alignment = 0x100000 / 0xFFFFF
> Mem: Granularity/SpecificFlag = 64 / 00
> Length/Alignment = 0x800000 / 0x7FFFFF
> PciBus: HostBridge->SubmitResources() - Success
> PciHostBridge: SubmitResources for PciRoot(0xF)
> Mem: Granularity/SpecificFlag = 32 / 00
> Length/Alignment = 0x100000 / 0xFFFFF
> Mem: Granularity/SpecificFlag = 64 / 00
> Length/Alignment = 0x800000 / 0x7FFFFF
> PciBus: HostBridge->SubmitResources() - Success
> PciHostBridge: NotifyPhase (AllocateResources)
> RootBridge: PciRoot(0x0)
> Mem: Base/Length/Alignment = 80000000/8100000/3FFFFFF - Success
> Mem64: Base/Length/Alignment = 800000000/800000/7FFFFF - Success
> I/O: Base/Length/Alignment = C000/1000/FFF - Success
> RootBridge: PciRoot(0x7)
> Mem64: Base/Length/Alignment = 800800000/800000/7FFFFF - Success
> Mem: Base/Length/Alignment = 88100000/100000/FFFFF - Success
> RootBridge: PciRoot(0xB)
> Mem64: Base/Length/Alignment = 801000000/800000/7FFFFF - Success
> Mem: Base/Length/Alignment = 88200000/100000/FFFFF - Success
> RootBridge: PciRoot(0xF)
> Mem64: Base/Length/Alignment = 801800000/800000/7FFFFF - Success
> Mem: Base/Length/Alignment = 88300000/100000/FFFFF - Success
> PciBus: HostBridge->NotifyPhase(AllocateResources) - Success
> PciBus: Resource Map for Root Bridge PciRoot(0x0)
> Type = Io16; Base = 0xC000; Length = 0x1000; Alignment = 0xFFF
> Base = 0xC000; Length = 0x20; Alignment = 0x1F; Owner = PCI [00|02|00:1C]
> Base = 0xC020; Length = 0x10; Alignment = 0xF; Owner = PCI [00|01|01:20]
> Type = Mem32; Base = 0x80000000; Length = 0x8100000; Alignment = 0x3FFFFFF
> Base = 0x80000000; Length = 0x4000000; Alignment = 0x3FFFFFF; Owner = PCI [00|02|00:14]
> Base = 0x84000000; Length = 0x4000000; Alignment = 0x3FFFFFF; Owner = PCI [00|02|00:10]
> Base = 0x88000000; Length = 0x2000; Alignment = 0x1FFF; Owner = PCI [00|02|00:18]
> Base = 0x88002000; Length = 0x1000; Alignment = 0xFFF; Owner = PCI [00|06|00:14]
> Type = Mem64; Base = 0x800000000; Length = 0x800000; Alignment = 0x7FFFFF
> Base = 0x800000000; Length = 0x800000; Alignment = 0x7FFFFF; Owner = PCI [00|06|00:20]; Type = PMem64
>
> PciBus: Resource Map for Root Bridge PciRoot(0x7)
> Type = Mem32; Base = 0x88100000; Length = 0x100000; Alignment = 0xFFFFF
> Base = 0x88100000; Length = 0x100000; Alignment = 0xFFFFF; Owner = PPB [07|00|00:**]
> Type = Mem64; Base = 0x800800000; Length = 0x800000; Alignment = 0x7FFFFF
> Base = 0x800800000; Length = 0x800000; Alignment = 0x7FFFFF; Owner = PPB [07|00|00:**]; Type = PMem64
>
> PciBus: Resource Map for Bridge [07|00|00]
> Type = Mem32; Base = 0x88100000; Length = 0x100000; Alignment = 0xFFFFF
> Base = 0x88100000; Length = 0x1000; Alignment = 0xFFF; Owner = PCI [08|03|00:14]
> Type = PMem64; Base = 0x800800000; Length = 0x800000; Alignment = 0x7FFFFF
> Base = 0x800800000; Length = 0x800000; Alignment = 0x7FFFFF; Owner = PCI [08|03|00:20]
>
> PciBus: Resource Map for Root Bridge PciRoot(0xB)
> Type = Mem32; Base = 0x88200000; Length = 0x100000; Alignment = 0xFFFFF
> Base = 0x88200000; Length = 0x100000; Alignment = 0xFFFFF; Owner = PPB [0B|00|00:**]
> Type = Mem64; Base = 0x801000000; Length = 0x800000; Alignment = 0x7FFFFF
> Base = 0x801000000; Length = 0x800000; Alignment = 0x7FFFFF; Owner = PPB [0B|00|00:**]; Type = PMem64
>
> PciBus: Resource Map for Bridge [0B|00|00]
> Type = Mem32; Base = 0x88200000; Length = 0x100000; Alignment = 0xFFFFF
> Base = 0x88200000; Length = 0x1000; Alignment = 0xFFF; Owner = PCI [0C|02|00:14]
> Type = PMem64; Base = 0x801000000; Length = 0x800000; Alignment = 0x7FFFFF
> Base = 0x801000000; Length = 0x800000; Alignment = 0x7FFFFF; Owner = PCI [0C|02|00:20]
>
> PciBus: Resource Map for Root Bridge PciRoot(0xF)
> Type = Mem32; Base = 0x88300000; Length = 0x100000; Alignment = 0xFFFFF
> Base = 0x88300000; Length = 0x100000; Alignment = 0xFFFFF; Owner = PPB [0F|00|00:**]
> Type = Mem64; Base = 0x801800000; Length = 0x800000; Alignment = 0x7FFFFF
> Base = 0x801800000; Length = 0x800000; Alignment = 0x7FFFFF; Owner = PPB [0F|00|00:**]; Type = PMem64
>
> PciBus: Resource Map for Bridge [0F|00|00]
> Type = Mem32; Base = 0x88300000; Length = 0x100000; Alignment = 0xFFFFF
> Base = 0x88300000; Length = 0x1000; Alignment = 0xFFF; Owner = PCI [10|04|00:14]
> Type = PMem64; Base = 0x801800000; Length = 0x800000; Alignment = 0x7FFFFF
> Base = 0x801800000; Length = 0x800000; Alignment = 0x7FFFFF; Owner = PCI [10|04|00:20]
For patches #2 through #5:
Tested-by: Laszlo Ersek <lersek@redhat.com>
I also ran "make check". The "check-qtest-i386" step (like all others) succeeded, which should cover patch #1 and #6 via "bios-tables-test.c". For those as well:
Tested-by: Laszlo Ersek <lersek@redhat.com>
Thanks
Laszlo
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [Qemu-devel] [PATCH V4 0/6] pxb: fix 64-bit MMIO allocation
2016-07-01 13:57 ` [Qemu-devel] [PATCH V4 0/6] pxb: fix 64-bit MMIO allocation Laszlo Ersek
@ 2016-07-01 14:15 ` Marcel Apfelbaum
0 siblings, 0 replies; 9+ messages in thread
From: Marcel Apfelbaum @ 2016-07-01 14:15 UTC (permalink / raw)
To: Laszlo Ersek, qemu-devel; +Cc: ehabkost, mst, imammedo, pbonzini
On 07/01/2016 04:57 PM, Laszlo Ersek wrote:
> On 06/30/16 21:07, Marcel Apfelbaum wrote:
>> 64-bit BARs allocations fix for devices behind PXBs/PXB-PCIEs.
>>
>> In build_crs() the calculation and merging of the ranges already happens
>> in 64-bit, but the entry boundaries are silently truncated to 32-bit in the
>> call to aml_dword_memory(). Fix it by handling the 64-bit MMIO ranges separately.
>>
>> v3 -> v4:
>> Addressed Igor's comments (thanks for the productive review!)
>> - Split pxb test patch (previously patch 3/3) into the test itself (patch 1/6) and the blobs (patch 6/6).
>> - New patch declaring pxb/pxb-pxie as not hot-pluggable.
>> - Note that it does not solve the DSDT issue, but it is a prerequisite for the next patch.
>> - New patch solving the DSDT issue spotted by Igor.
>> - Using V=1 DIFF=diff make check does make it easier to review the ACPI changes, thanks.
>> - Patches 4 and 5 untouched (previously patches 1/3 and 2/3)
>>
>> v2 -> v3:
>> - split original series "pci: better support for 64-bit MMIO allocation" into 2 series:
>> - this is the first part dealing with correct 64-bit MMIO ACPI computation
>> - the second one will include 64-bit MMIO reservation for PCI hotplug
>> - Add pxb/pxb-pcie tests (Igor) - See diffs below (*)
>> - Re-based on latest master.
>>
>> v1 -> v2:
>> - resolved some styling issues (Laszlo)
>> - rebase on latest master (Laszlo)
>>
>> Thank you,
>> Marcel
>>
>> Marcel Apfelbaum (6):
>> tests/acpi: add pxb/pxb-pcie tests
>> hw/pxb: declare pxb devices as not hot-pluggable
>> hw/acpi: fix a DSDT table issue when a pxb is present.
>> acpi: refactor pxb crs computation
>> hw/apci: handle 64-bit MMIO regions correctly
>> tests/acpi: Add pxb/pxb-pcie tests blobs
>>
>> hw/i386/acpi-build.c | 131 ++++++++++++++++++++++++---------
>> hw/pci-bridge/pci_expander_bridge.c | 2 +
>> tests/acpi-test-data/pc/DSDT.pxb | Bin 0 -> 6280 bytes
>> tests/acpi-test-data/q35/DSDT.pxb_pcie | Bin 0 -> 9098 bytes
>> tests/bios-tables-test.c | 37 ++++++++++
>> 5 files changed, 134 insertions(+), 36 deletions(-)
>> create mode 100644 tests/acpi-test-data/pc/DSDT.pxb
>> create mode 100644 tests/acpi-test-data/q35/DSDT.pxb_pcie
>>
>
> I used the following commands to test (part of) the series:
>
>> VIRTIO10=1
>> ISO=/mnt/data/isos/iso-fedora/Fedora-Workstation-Live-x86_64-24-1.2.iso
>> CODE=/home/virt-images/OVMF_CODE.fd
>> TMPL=/home/virt-images/OVMF_VARS.fd
>> TFTP=/var/lib/dnsmasq
>> BF=shim.efi
>>
>> if [ $VIRTIO10 -eq 0 ]; then
>> MODERN=disable-legacy=off,disable-modern=on
>> else
>> MODERN=disable-legacy=on,disable-modern=off
>> fi
>>
>> cp $TMPL vars3.fd
>>
>> qemu-system-x86_64 \
>> -m 2048 \
>> -M pc \
>> -enable-kvm \
>> -device qxl-vga \
>> -drive if=pflash,readonly,format=raw,file=$CODE \
>> -drive if=pflash,format=raw,file=vars3.fd \
>> -drive id=cdrom,if=none,readonly,format=raw,cache=writethrough,file=$ISO \
>> \
>> -debugcon file:debug3.log \
>> -global isa-debugcon.iobase=0x402 \
>> \
>> -chardev stdio,signal=off,mux=on,id=char0 \
>> -mon chardev=char0,mode=readline,default \
>> -serial chardev:char0 \
>> \
>> -device pxb,bus=pci.0,id=bridge1,bus_nr=11 \
>> -device pxb,bus=pci.0,id=bridge2,bus_nr=7 \
>> -device pxb,bus=pci.0,id=bridge3,bus_nr=15 \
>> \
>> -device virtio-scsi-pci,id=scsi0,$MODERN,bus=pci.0 \
>> -device scsi-cd,bus=scsi0.0,drive=cdrom,bootindex=1 \
>> \
>> -netdev user,id=netdev0,hostfwd=tcp:127.0.0.1:2227-:22,tftp=$TFTP,bootfile=$BF,net=10.0.2.0/24 \
>> -device virtio-net-pci,netdev=netdev0,romfile=,$MODERN,bootindex=2,bus=bridge1,addr=2 \
>> \
>> -netdev user,id=netdev1,hostfwd=tcp:127.0.0.1:2228-:22,net=10.0.3.0/24 \
>> -device virtio-net-pci,netdev=netdev1,romfile=,$MODERN,bootindex=3,bus=bridge2,addr=3 \
>> \
>> -netdev user,id=netdev2,hostfwd=tcp:127.0.0.1:2229-:22,net=10.0.4.0/24 \
>> -device virtio-net-pci,netdev=netdev2,romfile=,$MODERN,bootindex=4,bus=bridge3,addr=4 \
>> \
>> -global PIIX4_PM.disable_s3=0 \
>>
>
> This is /proc/iomem from within the guest:
>
>> 00000000-00000fff : reserved
>> 00001000-0009ffff : System RAM
>> 000a0000-000bffff : PCI Bus 0000:00
>> 000f0000-000fffff : System ROM
>> 00100000-007fffff : System RAM
>> 00800000-00807fff : ACPI Non-volatile Storage
>> 00808000-0080ffff : System RAM
>> 00810000-008fffff : ACPI Non-volatile Storage
>> 00900000-7e529017 : System RAM
>> 02000000-027d3cf3 : Kernel code
>> 027d3cf4-02d4dfff : Kernel data
>> 02edc000-0305dfff : Kernel bss
>> 7e529018-7e532857 : System RAM
>> 7e532858-7e800fff : System RAM
>> 7e801000-7e820fff : ACPI Non-volatile Storage
>> 7e821000-7e84afff : reserved
>> 7e84b000-7ebe1fff : System RAM
>> 7ebe2000-7ebfdfff : reserved
>> 7ebfe000-7ec22fff : System RAM
>> 7ec23000-7ec35fff : reserved
>> 7ec36000-7ec99fff : System RAM
>> 7ec9a000-7ee16fff : reserved
>> 7ee17000-7fe96fff : System RAM
>> 7fe97000-7feeefff : reserved
>> 7feef000-7fef6fff : ACPI Tables
>> 7fef7000-7fefafff : ACPI Non-volatile Storage
>> 7fefb000-7ffcffff : System RAM
>> 7ffd0000-7ffeffff : reserved
>> 7fff0000-7fffffff : System RAM
>> 80000000-880fffff : PCI Bus 0000:00
>> 80000000-83ffffff : 0000:00:02.0
>> 84000000-87ffffff : 0000:00:02.0
>> 88000000-88001fff : 0000:00:02.0
>> 88002000-88002fff : 0000:00:06.0
>> 88010000-8801ffff : 0000:00:02.0
>> 88100000-881fffff : PCI Bus 0000:07
>> 88100000-881fffff : PCI Bus 0000:08
>> 88100000-88100fff : 0000:08:03.0
>> 88200000-882fffff : PCI Bus 0000:0b
>> 88200000-882fffff : PCI Bus 0000:0c
>> 88200000-88200fff : 0000:0c:02.0
>> 88300000-883fffff : PCI Bus 0000:0f
>> 88300000-883fffff : PCI Bus 0000:10
>> 88300000-88300fff : 0000:10:04.0
>> 88400000-febfffff : PCI Bus 0000:00
>> fec00000-fec003ff : IOAPIC 0
>> fed00000-fed003ff : HPET 0
>> fed00000-fed003ff : PNP0103:00
>> fee00000-fee00fff : Local APIC
>> ffe00000-ffffffff : reserved
>> 800000000-8007fffff : PCI Bus 0000:00
>> 800000000-8007fffff : 0000:00:06.0
>> 800000000-8007fffff : virtio-pci-modern
>> 800800000-800ffffff : PCI Bus 0000:07
>> 800800000-800ffffff : PCI Bus 0000:08
>> 800800000-800ffffff : 0000:08:03.0
>> 800800000-800ffffff : virtio-pci-modern
>> 801000000-8017fffff : PCI Bus 0000:0b
>> 801000000-8017fffff : PCI Bus 0000:0c
>> 801000000-8017fffff : 0000:0c:02.0
>> 801000000-8017fffff : virtio-pci-modern
>> 801800000-801ffffff : PCI Bus 0000:0f
>> 801800000-801ffffff : PCI Bus 0000:10
>> 801800000-801ffffff : 0000:10:04.0
>> 801800000-801ffffff : virtio-pci-modern
>
> It looks good to me. I also checked the _CRS objects in the DSDT in the guest (cursorily), it seemed okay.
>
> Guest dmesg contains no problems.
>
> The virtio-scsi CD obviously worked (booted Fedora 24 Live off of it). I also logged into the guest through all three NICs, with ssh.
>
> Below an excerpt from the OVMF debug log -- it appears consistent with the guest's /proc/iomem:
>
>> PciHostBridgeGetRootBridges: 3 extra root buses reported by QEMU
>> InitRootBridge: populated root bus 0, with room for 6 subordinate bus(es)
>> InitRootBridge: populated root bus 7, with room for 3 subordinate bus(es)
>> InitRootBridge: populated root bus 11, with room for 3 subordinate bus(es)
>> InitRootBridge: populated root bus 15, with room for 240 subordinate bus(es)
>> RootBridge: PciRoot(0x0)
>> Support/Attr: 70069 / 70069
>> DmaAbove4G: No
>> NoExtConfSpace: Yes
>> AllocAttr: 3 (CombineMemPMem Mem64Decode)
>> Bus: 0 - 6
>> Io: C000 - FFFF
>> Mem: 80000000 - FBFFFFFF
>> MemAbove4G: 800000000 - FFFFFFFFF
>> PMem: FFFFFFFFFFFFFFFF - 0
>> PMemAbove4G: FFFFFFFFFFFFFFFF - 0
>> PciHostBridgeDxe: IntersectMemoryDescriptor: add [800000000, 1000000000): Success
>> RootBridge: PciRoot(0x7)
>> Support/Attr: 70069 / 70069
>> DmaAbove4G: No
>> NoExtConfSpace: Yes
>> AllocAttr: 3 (CombineMemPMem Mem64Decode)
>> Bus: 7 - A
>> Io: C000 - FFFF
>> Mem: 80000000 - FBFFFFFF
>> MemAbove4G: 800000000 - FFFFFFFFF
>> PMem: FFFFFFFFFFFFFFFF - 0
>> PMemAbove4G: FFFFFFFFFFFFFFFF - 0
>> RootBridge: PciRoot(0xB)
>> Support/Attr: 70069 / 70069
>> DmaAbove4G: No
>> NoExtConfSpace: Yes
>> AllocAttr: 3 (CombineMemPMem Mem64Decode)
>> Bus: B - E
>> Io: C000 - FFFF
>> Mem: 80000000 - FBFFFFFF
>> MemAbove4G: 800000000 - FFFFFFFFF
>> PMem: FFFFFFFFFFFFFFFF - 0
>> PMemAbove4G: FFFFFFFFFFFFFFFF - 0
>> RootBridge: PciRoot(0xF)
>> Support/Attr: 70069 / 70069
>> DmaAbove4G: No
>> NoExtConfSpace: Yes
>> AllocAttr: 3 (CombineMemPMem Mem64Decode)
>> Bus: F - FF
>> Io: C000 - FFFF
>> Mem: 80000000 - FBFFFFFF
>> MemAbove4G: 800000000 - FFFFFFFFF
>> PMem: FFFFFFFFFFFFFFFF - 0
>> PMemAbove4G: FFFFFFFFFFFFFFFF - 0
>>
>> [...]
>>
>> PCI Bus First Scanning
>> PciBus: Discovered PCI @ [00|00|00]
>>
>> PciBus: Discovered PCI @ [00|01|00]
>>
>> PciBus: Discovered PCI @ [00|01|01]
>> BAR[4]: Type = Io32; Alignment = 0xF; Length = 0x10; Offset = 0x20
>>
>> PciBus: Discovered PCI @ [00|01|03]
>>
>> PciBus: Discovered PCI @ [00|02|00]
>> BAR[0]: Type = Mem32; Alignment = 0x3FFFFFF; Length = 0x4000000; Offset = 0x10
>> BAR[1]: Type = Mem32; Alignment = 0x3FFFFFF; Length = 0x4000000; Offset = 0x14
>> BAR[2]: Type = Mem32; Alignment = 0x1FFF; Length = 0x2000; Offset = 0x18
>> BAR[3]: Type = Io32; Alignment = 0x1F; Length = 0x20; Offset = 0x1C
>>
>> PciBus: Discovered PCI @ [00|03|00]
>>
>> PciBus: Discovered PCI @ [00|04|00]
>>
>> PciBus: Discovered PCI @ [00|05|00]
>>
>> PciBus: Discovered PCI @ [00|06|00]
>> BAR[1]: Type = Mem32; Alignment = 0xFFF; Length = 0x1000; Offset = 0x14
>> BAR[4]: Type = PMem64; Alignment = 0x7FFFFF; Length = 0x800000; Offset = 0x20
>>
>> PciBus: Discovered PPB @ [07|00|00]
>>
>> PciBus: Discovered PCI @ [08|03|00]
>> BAR[1]: Type = Mem32; Alignment = 0xFFF; Length = 0x1000; Offset = 0x14
>> BAR[4]: Type = PMem64; Alignment = 0x7FFFFF; Length = 0x800000; Offset = 0x20
>>
>> PciBus: Discovered PPB @ [0B|00|00]
>>
>> PciBus: Discovered PCI @ [0C|02|00]
>> BAR[1]: Type = Mem32; Alignment = 0xFFF; Length = 0x1000; Offset = 0x14
>> BAR[4]: Type = PMem64; Alignment = 0x7FFFFF; Length = 0x800000; Offset = 0x20
>>
>> PciBus: Discovered PPB @ [0F|00|00]
>>
>> PciBus: Discovered PCI @ [10|04|00]
>> BAR[1]: Type = Mem32; Alignment = 0xFFF; Length = 0x1000; Offset = 0x14
>> BAR[4]: Type = PMem64; Alignment = 0x7FFFFF; Length = 0x800000; Offset = 0x20
>>
>> PciBus: Discovered PCI @ [00|00|00]
>>
>> PciBus: Discovered PCI @ [00|01|00]
>>
>> PciBus: Discovered PCI @ [00|01|01]
>> BAR[4]: Type = Io32; Alignment = 0xF; Length = 0x10; Offset = 0x20
>>
>> PciBus: Discovered PCI @ [00|01|03]
>>
>> PciBus: Discovered PCI @ [00|02|00]
>> BAR[0]: Type = Mem32; Alignment = 0x3FFFFFF; Length = 0x4000000; Offset = 0x10
>> BAR[1]: Type = Mem32; Alignment = 0x3FFFFFF; Length = 0x4000000; Offset = 0x14
>> BAR[2]: Type = Mem32; Alignment = 0x1FFF; Length = 0x2000; Offset = 0x18
>> BAR[3]: Type = Io32; Alignment = 0x1F; Length = 0x20; Offset = 0x1C
>>
>> PciBus: Discovered PCI @ [00|03|00]
>>
>> PciBus: Discovered PCI @ [00|04|00]
>>
>> PciBus: Discovered PCI @ [00|05|00]
>>
>> PciBus: Discovered PCI @ [00|06|00]
>> BAR[1]: Type = Mem32; Alignment = 0xFFF; Length = 0x1000; Offset = 0x14
>> BAR[4]: Type = PMem64; Alignment = 0x7FFFFF; Length = 0x800000; Offset = 0x20
>>
>> PciBus: Discovered PPB @ [07|00|00]
>>
>> PciBus: Discovered PCI @ [08|03|00]
>> BAR[1]: Type = Mem32; Alignment = 0xFFF; Length = 0x1000; Offset = 0x14
>> BAR[4]: Type = PMem64; Alignment = 0x7FFFFF; Length = 0x800000; Offset = 0x20
>>
>> PciBus: Discovered PPB @ [0B|00|00]
>>
>> PciBus: Discovered PCI @ [0C|02|00]
>> BAR[1]: Type = Mem32; Alignment = 0xFFF; Length = 0x1000; Offset = 0x14
>> BAR[4]: Type = PMem64; Alignment = 0x7FFFFF; Length = 0x800000; Offset = 0x20
>>
>> PciBus: Discovered PPB @ [0F|00|00]
>>
>> PciBus: Discovered PCI @ [10|04|00]
>> BAR[1]: Type = Mem32; Alignment = 0xFFF; Length = 0x1000; Offset = 0x14
>> BAR[4]: Type = PMem64; Alignment = 0x7FFFFF; Length = 0x800000; Offset = 0x20
>>
>> PciHostBridge: SubmitResources for PciRoot(0x0)
>> I/O: Granularity/SpecificFlag = 0 / 01
>> Length/Alignment = 0x1000 / 0xFFF
>> Mem: Granularity/SpecificFlag = 32 / 00
>> Length/Alignment = 0x8100000 / 0x3FFFFFF
>> Mem: Granularity/SpecificFlag = 64 / 00
>> Length/Alignment = 0x800000 / 0x7FFFFF
>> PciBus: HostBridge->SubmitResources() - Success
>> PciHostBridge: SubmitResources for PciRoot(0x7)
>> Mem: Granularity/SpecificFlag = 32 / 00
>> Length/Alignment = 0x100000 / 0xFFFFF
>> Mem: Granularity/SpecificFlag = 64 / 00
>> Length/Alignment = 0x800000 / 0x7FFFFF
>> PciBus: HostBridge->SubmitResources() - Success
>> PciHostBridge: SubmitResources for PciRoot(0xB)
>> Mem: Granularity/SpecificFlag = 32 / 00
>> Length/Alignment = 0x100000 / 0xFFFFF
>> Mem: Granularity/SpecificFlag = 64 / 00
>> Length/Alignment = 0x800000 / 0x7FFFFF
>> PciBus: HostBridge->SubmitResources() - Success
>> PciHostBridge: SubmitResources for PciRoot(0xF)
>> Mem: Granularity/SpecificFlag = 32 / 00
>> Length/Alignment = 0x100000 / 0xFFFFF
>> Mem: Granularity/SpecificFlag = 64 / 00
>> Length/Alignment = 0x800000 / 0x7FFFFF
>> PciBus: HostBridge->SubmitResources() - Success
>> PciHostBridge: NotifyPhase (AllocateResources)
>> RootBridge: PciRoot(0x0)
>> Mem: Base/Length/Alignment = 80000000/8100000/3FFFFFF - Success
>> Mem64: Base/Length/Alignment = 800000000/800000/7FFFFF - Success
>> I/O: Base/Length/Alignment = C000/1000/FFF - Success
>> RootBridge: PciRoot(0x7)
>> Mem64: Base/Length/Alignment = 800800000/800000/7FFFFF - Success
>> Mem: Base/Length/Alignment = 88100000/100000/FFFFF - Success
>> RootBridge: PciRoot(0xB)
>> Mem64: Base/Length/Alignment = 801000000/800000/7FFFFF - Success
>> Mem: Base/Length/Alignment = 88200000/100000/FFFFF - Success
>> RootBridge: PciRoot(0xF)
>> Mem64: Base/Length/Alignment = 801800000/800000/7FFFFF - Success
>> Mem: Base/Length/Alignment = 88300000/100000/FFFFF - Success
>> PciBus: HostBridge->NotifyPhase(AllocateResources) - Success
>> PciBus: Resource Map for Root Bridge PciRoot(0x0)
>> Type = Io16; Base = 0xC000; Length = 0x1000; Alignment = 0xFFF
>> Base = 0xC000; Length = 0x20; Alignment = 0x1F; Owner = PCI [00|02|00:1C]
>> Base = 0xC020; Length = 0x10; Alignment = 0xF; Owner = PCI [00|01|01:20]
>> Type = Mem32; Base = 0x80000000; Length = 0x8100000; Alignment = 0x3FFFFFF
>> Base = 0x80000000; Length = 0x4000000; Alignment = 0x3FFFFFF; Owner = PCI [00|02|00:14]
>> Base = 0x84000000; Length = 0x4000000; Alignment = 0x3FFFFFF; Owner = PCI [00|02|00:10]
>> Base = 0x88000000; Length = 0x2000; Alignment = 0x1FFF; Owner = PCI [00|02|00:18]
>> Base = 0x88002000; Length = 0x1000; Alignment = 0xFFF; Owner = PCI [00|06|00:14]
>> Type = Mem64; Base = 0x800000000; Length = 0x800000; Alignment = 0x7FFFFF
>> Base = 0x800000000; Length = 0x800000; Alignment = 0x7FFFFF; Owner = PCI [00|06|00:20]; Type = PMem64
>>
>> PciBus: Resource Map for Root Bridge PciRoot(0x7)
>> Type = Mem32; Base = 0x88100000; Length = 0x100000; Alignment = 0xFFFFF
>> Base = 0x88100000; Length = 0x100000; Alignment = 0xFFFFF; Owner = PPB [07|00|00:**]
>> Type = Mem64; Base = 0x800800000; Length = 0x800000; Alignment = 0x7FFFFF
>> Base = 0x800800000; Length = 0x800000; Alignment = 0x7FFFFF; Owner = PPB [07|00|00:**]; Type = PMem64
>>
>> PciBus: Resource Map for Bridge [07|00|00]
>> Type = Mem32; Base = 0x88100000; Length = 0x100000; Alignment = 0xFFFFF
>> Base = 0x88100000; Length = 0x1000; Alignment = 0xFFF; Owner = PCI [08|03|00:14]
>> Type = PMem64; Base = 0x800800000; Length = 0x800000; Alignment = 0x7FFFFF
>> Base = 0x800800000; Length = 0x800000; Alignment = 0x7FFFFF; Owner = PCI [08|03|00:20]
>>
>> PciBus: Resource Map for Root Bridge PciRoot(0xB)
>> Type = Mem32; Base = 0x88200000; Length = 0x100000; Alignment = 0xFFFFF
>> Base = 0x88200000; Length = 0x100000; Alignment = 0xFFFFF; Owner = PPB [0B|00|00:**]
>> Type = Mem64; Base = 0x801000000; Length = 0x800000; Alignment = 0x7FFFFF
>> Base = 0x801000000; Length = 0x800000; Alignment = 0x7FFFFF; Owner = PPB [0B|00|00:**]; Type = PMem64
>>
>> PciBus: Resource Map for Bridge [0B|00|00]
>> Type = Mem32; Base = 0x88200000; Length = 0x100000; Alignment = 0xFFFFF
>> Base = 0x88200000; Length = 0x1000; Alignment = 0xFFF; Owner = PCI [0C|02|00:14]
>> Type = PMem64; Base = 0x801000000; Length = 0x800000; Alignment = 0x7FFFFF
>> Base = 0x801000000; Length = 0x800000; Alignment = 0x7FFFFF; Owner = PCI [0C|02|00:20]
>>
>> PciBus: Resource Map for Root Bridge PciRoot(0xF)
>> Type = Mem32; Base = 0x88300000; Length = 0x100000; Alignment = 0xFFFFF
>> Base = 0x88300000; Length = 0x100000; Alignment = 0xFFFFF; Owner = PPB [0F|00|00:**]
>> Type = Mem64; Base = 0x801800000; Length = 0x800000; Alignment = 0x7FFFFF
>> Base = 0x801800000; Length = 0x800000; Alignment = 0x7FFFFF; Owner = PPB [0F|00|00:**]; Type = PMem64
>>
>> PciBus: Resource Map for Bridge [0F|00|00]
>> Type = Mem32; Base = 0x88300000; Length = 0x100000; Alignment = 0xFFFFF
>> Base = 0x88300000; Length = 0x1000; Alignment = 0xFFF; Owner = PCI [10|04|00:14]
>> Type = PMem64; Base = 0x801800000; Length = 0x800000; Alignment = 0x7FFFFF
>> Base = 0x801800000; Length = 0x800000; Alignment = 0x7FFFFF; Owner = PCI [10|04|00:20]
>
> For patches #2 through #5:
>
> Tested-by: Laszlo Ersek <lersek@redhat.com>
>
> I also ran "make check". The "check-qtest-i386" step (like all others) succeeded, which should cover patch #1 and #6 via "bios-tables-test.c". For those as well:
>
> Tested-by: Laszlo Ersek <lersek@redhat.com>
Very appreciated!
Also for patch #5 that actually solves the problem:
Reported-by: Laszlo Ersek <lersek@redhat.com>
Thanks,
Marcel
>
> Thanks
> Laszlo
>
^ permalink raw reply [flat|nested] 9+ messages in thread