[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v5 01/13] hw/acpi: Fix ordering of BDF in Generic Initiator PCI D
From: |
Jonathan Cameron |
Subject: |
[PATCH v5 01/13] hw/acpi: Fix ordering of BDF in Generic Initiator PCI Device Handle. |
Date: |
Fri, 12 Jul 2024 12:08:05 +0100 |
The ordering in ACPI specification [1] has bus number in the lowest byte.
As ACPI tables are little endian this is the reverse of the ordering
used by PCI_BUILD_BDF(). As a minimal fix split the QEMU BDF up
into bus and devfn and write them as single bytes in the correct
order.
[1] ACPI Spec 6.3, Table 5.80
Fixes: 0a5b5acdf2d8 ("hw/acpi: Implement the SRAT GI affinity structure")
Reviewed-by: Igor Mammedov <imammedo@redhat.com>
Tested-by: "Huang, Ying" <ying.huang@intel.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
---
v5: No change
---
hw/acpi/acpi_generic_initiator.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/hw/acpi/acpi_generic_initiator.c b/hw/acpi/acpi_generic_initiator.c
index 17b9a052f5..3d2b567999 100644
--- a/hw/acpi/acpi_generic_initiator.c
+++ b/hw/acpi/acpi_generic_initiator.c
@@ -92,7 +92,8 @@ build_srat_generic_pci_initiator_affinity(GArray *table_data,
int node,
/* Device Handle - PCI */
build_append_int_noprefix(table_data, handle->segment, 2);
- build_append_int_noprefix(table_data, handle->bdf, 2);
+ build_append_int_noprefix(table_data, PCI_BUS_NUM(handle->bdf), 1);
+ build_append_int_noprefix(table_data, PCI_BDF_TO_DEVFN(handle->bdf), 1);
for (index = 0; index < 12; index++) {
build_append_int_noprefix(table_data, 0, 1);
}
--
2.43.0
- [PATCH v5 00/13] acpi: NUMA nodes for CXL HB as GP + complex NUMA test, Jonathan Cameron, 2024/07/12
- [PATCH v5 01/13] hw/acpi: Fix ordering of BDF in Generic Initiator PCI Device Handle.,
Jonathan Cameron <=
- [PATCH v5 02/13] hw/acpi/GI: Fix trivial parameter alignment issue., Jonathan Cameron, 2024/07/12
- [PATCH v5 03/13] hw/acpi: Move AML building code for Generic Initiators to aml_build.c, Jonathan Cameron, 2024/07/12
- [PATCH v5 04/13] hw/acpi: Rename build_all_acpi_generic_initiators() to build_acpi_generic_initiator(), Jonathan Cameron, 2024/07/12
- [PATCH v5 05/13] hw/pci: Add a busnr property to pci_props and use for acpi/gi, Jonathan Cameron, 2024/07/12
- [PATCH v5 06/13] acpi/pci: Move Generic Initiator object handling into acpi/pci.*, Jonathan Cameron, 2024/07/12
- [PATCH v5 07/13] hw/pci-bridge: Add acpi_uid property to TYPE_PXB_BUS, Jonathan Cameron, 2024/07/12
- [PATCH v5 08/13] hw/i386/acpi: Use TYPE_PXB_BUS property acpi_uid for DSDT, Jonathan Cameron, 2024/07/12