mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-08 18:23:57 -06:00
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:28dc86a072
("s390x/pci: use a PCI Group structure") Fixes:9670ee7527
("s390x/pci: use a PCI Function structure") Fixes:1e7552ff5c
("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>
This commit is contained in:
parent
e67ad058e4
commit
a4e2fff1b1
4 changed files with 29 additions and 17 deletions
|
@ -156,12 +156,12 @@ static void s390_pci_read_group(S390PCIBusDevice *pbdev,
|
|||
if (cap->flags & VFIO_DEVICE_INFO_ZPCI_FLAG_REFRESH) {
|
||||
resgrp->fr = 1;
|
||||
}
|
||||
stq_p(&resgrp->dasm, cap->dasm);
|
||||
stq_p(&resgrp->msia, cap->msi_addr);
|
||||
stw_p(&resgrp->mui, cap->mui);
|
||||
stw_p(&resgrp->i, cap->noi);
|
||||
stw_p(&resgrp->maxstbl, cap->maxstbl);
|
||||
stb_p(&resgrp->version, cap->version);
|
||||
resgrp->dasm = cap->dasm;
|
||||
resgrp->msia = cap->msi_addr;
|
||||
resgrp->mui = cap->mui;
|
||||
resgrp->i = cap->noi;
|
||||
resgrp->maxstbl = cap->maxstbl;
|
||||
resgrp->version = cap->version;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue