[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Stable-9.1.2 50/58] hw/acpi: Fix ordering of BDF in Generic Initiator P
From: |
Michael Tokarev |
Subject: |
[Stable-9.1.2 50/58] hw/acpi: Fix ordering of BDF in Generic Initiator PCI Device Handle. |
Date: |
Sat, 9 Nov 2024 15:08:51 +0300 |
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>
(cherry picked from commit 16c687d84574a1139a6475c33e3b9191f7932ac0)
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
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.39.5
- [Stable-9.1.2 39/58] ppc/pnv: Fix LPC serirq routing calculation, (continued)
- [Stable-9.1.2 39/58] ppc/pnv: Fix LPC serirq routing calculation, Michael Tokarev, 2024/11/09
- [Stable-9.1.2 44/58] hw/ssi/pnv_spi: Match _xfer_buffer_free() with _xfer_buffer_new(), Michael Tokarev, 2024/11/09
- [Stable-9.1.2 41/58] target/ppc: Fix mtDPDES targeting SMT siblings, Michael Tokarev, 2024/11/09
- [Stable-9.1.2 47/58] tests/tcg: Replace -mpower8-vector with -mcpu=power8, Michael Tokarev, 2024/11/09
- [Stable-9.1.2 46/58] hw/ssi/pnv_spi: Fixes Coverity CID 1558831, Michael Tokarev, 2024/11/09
- [Stable-9.1.2 45/58] hw/ssi/pnv_spi: Return early in transfer(), Michael Tokarev, 2024/11/09
- [Stable-9.1.2 52/58] Revert "target/arm: Fix usage of MMU indexes when EL3 is AArch32", Michael Tokarev, 2024/11/09
- [Stable-9.1.2 48/58] hw/sd/sdcard: Fix calculation of size when using eMMC boot partitions, Michael Tokarev, 2024/11/09
- [Stable-9.1.2 49/58] qemu-ga: Fix a SIGSEGV in ga_run_command() helper, Michael Tokarev, 2024/11/09
- [Stable-9.1.2 51/58] acpi/disassemle-aml.sh: fix up after dir reorg, Michael Tokarev, 2024/11/09
- [Stable-9.1.2 50/58] hw/acpi: Fix ordering of BDF in Generic Initiator PCI Device Handle.,
Michael Tokarev <=
- [Stable-9.1.2 53/58] target/arm: Add new MMU indexes for AArch32 Secure PL1&0, Michael Tokarev, 2024/11/09
- [Stable-9.1.2 54/58] target/arm: Fix SVE SDOT/UDOT/USDOT (4-way, indexed), Michael Tokarev, 2024/11/09
- [Stable-9.1.2 55/58] migration: Ensure vmstate_save() sets errp, Michael Tokarev, 2024/11/09
- [Stable-9.1.2 56/58] hw/nvme: fix handling of over-committed queues, Michael Tokarev, 2024/11/09
- [Stable-9.1.2 58/58] Revert "hw/audio/hda: fix memory leak on audio setup", Michael Tokarev, 2024/11/09
- [Stable-9.1.2 57/58] 9pfs: fix crash on 'Treaddir' request, Michael Tokarev, 2024/11/09