qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH] Add a comment about endian-ness of capabilities recorded in pci


From: Ani Sinha
Subject: [PATCH] Add a comment about endian-ness of capabilities recorded in pci config space
Date: Mon, 25 Oct 2021 15:47:36 +0530

Values in PCI configuration space are written in little endian format. This
includes capability values recorded in pci config space for pci bridges etc.
Add comment to remind developers to make sure the values are written in little
endian for all platforms and that the code must be endian safe.
Please also see the following fix which resolves an issue related to code not
being endian safe for BE systems:

0e464f7d99311 ("pci: fix PCI resource reserve capability on BE")

Signed-off-by: Ani Sinha <ani@anisinha.ca>
---
 include/hw/pci/pci_bridge.h | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/include/hw/pci/pci_bridge.h b/include/hw/pci/pci_bridge.h
index a94d350034..5fc6841833 100644
--- a/include/hw/pci/pci_bridge.h
+++ b/include/hw/pci/pci_bridge.h
@@ -143,6 +143,8 @@ typedef struct PCIBridgeQemuCap {
 /*
  * PCI BUS/IO/MEM/PREFMEM additional resources recorded as a
  * capability in PCI configuration space to reserve on firmware init.
+ * The values of these parameters must be in little-endian and
+ * the code assigning the values must be endian safe for all platforms.
  */
 typedef struct PCIResReserve {
     uint32_t bus;
-- 
2.25.1




reply via email to

[Prev in Thread] Current Thread [Next in Thread]