[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 03/65] hw/acpi: Fix ordering of BDF in Generic Initiator PCI Devic
From: |
Michael S. Tsirkin |
Subject: |
[PULL 03/65] hw/acpi: Fix ordering of BDF in Generic Initiator PCI Device Handle. |
Date: |
Mon, 4 Nov 2024 16:05:32 -0500 |
From: Jonathan Cameron <Jonathan.Cameron@huawei.com>
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>
Message-Id: <20240916171017.1841767-2-Jonathan.Cameron@huawei.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
---
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);
}
--
MST
- [PULL 00/65] virtio,pc,pci: features, fixes, cleanups, Michael S. Tsirkin, 2024/11/04
- [PULL 01/65] softmmu: Expand comments describing max_bounce_buffer_size, Michael S. Tsirkin, 2024/11/04
- [PULL 02/65] docs: fix vhost-user protocol doc, Michael S. Tsirkin, 2024/11/04
- [PULL 03/65] hw/acpi: Fix ordering of BDF in Generic Initiator PCI Device Handle.,
Michael S. Tsirkin <=
- [PULL 04/65] hw/acpi/GI: Fix trivial parameter alignment issue., Michael S. Tsirkin, 2024/11/04
- [PULL 05/65] hw/acpi: Move AML building code for Generic Initiators to aml_build.c, Michael S. Tsirkin, 2024/11/04
- [PULL 06/65] hw/acpi: Rename build_all_acpi_generic_initiators() to build_acpi_generic_initiator(), Michael S. Tsirkin, 2024/11/04
- [PULL 07/65] hw/pci: Add a busnr property to pci_props and use for acpi/gi, Michael S. Tsirkin, 2024/11/04
- [PULL 08/65] acpi/pci: Move Generic Initiator object handling into acpi/pci.*, Michael S. Tsirkin, 2024/11/04
- [PULL 09/65] hw/pci-bridge: Add acpi_uid property to TYPE_PXB_BUS, Michael S. Tsirkin, 2024/11/04
- [PULL 10/65] hw/i386/acpi: Use TYPE_PXB_BUS property acpi_uid for DSDT, Michael S. Tsirkin, 2024/11/04
- [PULL 11/65] hw/pci-host/gpex-acpi: Use acpi_uid property., Michael S. Tsirkin, 2024/11/04
- [PULL 12/65] hw/acpi: Generic Port Affinity Structure support, Michael S. Tsirkin, 2024/11/04