On 18/11/2020 11.42, Cornelia Huck wrote: > 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 <coh...@redhat.com> > --- > > v2->v3: added missing zpci_fn.flags copy, removed forgotten memcopy > v1->v2: switched to keeping the internal structures as host-endian > > Again, tested on x86 and s390x (tcg/kvm) with virtio-pci devices; > testing vfio-pci devices would be good.
Looks good to me now! Reviewed-by: Thomas Huth <th...@redhat.com> ... and also my Fedora 28 TCG guest can now use the virtio-net-pci device again, so also a light: Tested-by: Thomas Huth <th...@redhat.com>