diff options
author | Cornelia Huck <cohuck@redhat.com> | 2020-11-18 11:42:02 +0100 |
---|---|---|
committer | Cornelia Huck <cohuck@redhat.com> | 2020-11-18 16:59:29 +0100 |
commit | a4e2fff1b104f2b235ea2673968d0b0383f541dc (patch) | |
tree | 0e5f7d2ce5be747e1605ddaddab0cd389f02a0ba /include/hw/s390x | |
parent | e67ad058e45aa8b23e9b94e793b9fcf66e70ebb0 (diff) |
s390x/pci: fix endianness issues
The zPCI group and function structures are big endian. However, we do
not consistently store them as big endian locally, and are missing some
conversions.
Let's just store the structures as host endian instead and convert to
big endian when actually handling the instructions retrieving the data.
Also fix the layout of ClpReqQueryPciGrp: g is actually only 8 bit. This
also fixes accesses on little endian hosts, and makes accesses on big
endian hosts consistent.
Fixes: 28dc86a07299 ("s390x/pci: use a PCI Group structure")
Fixes: 9670ee752727 ("s390x/pci: use a PCI Function structure")
Fixes: 1e7552ff5c34 ("s390x/pci: get zPCI function info from host")
Signed-off-by: Cornelia Huck <cohuck@redhat.com>
Tested-by: Matthew Rosato <mjrosato@linux.ibm.com>
Tested-by: Thomas Huth <thuth@redhat.com>
Reviewed-by: Matthew Rosato <mjrosato@linux.ibm.com>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Message-Id: <20201118104202.1301363-1-cohuck@redhat.com>
Diffstat (limited to 'include/hw/s390x')
-rw-r--r-- | include/hw/s390x/s390-pci-clp.h | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/include/hw/s390x/s390-pci-clp.h b/include/hw/s390x/s390-pci-clp.h index ea2b1378cd..96b8e3f133 100644 --- a/include/hw/s390x/s390-pci-clp.h +++ b/include/hw/s390x/s390-pci-clp.h @@ -144,10 +144,10 @@ typedef struct ClpReqQueryPciGrp { ClpReqHdr hdr; uint32_t fmt; uint64_t reserved1; -#define CLP_REQ_QPCIG_MASK_PFGID 0xff - uint32_t g; - uint32_t reserved2; - uint64_t reserved3; + uint8_t reserved2[3]; + uint8_t g; + uint32_t reserved3; + uint64_t reserved4; } QEMU_PACKED ClpReqQueryPciGrp; /* Query PCI function group response */ |