[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v3 5/5] vfio-user: Fix config space access byte order
From: |
Stefan Hajnoczi |
Subject: |
Re: [PATCH v3 5/5] vfio-user: Fix config space access byte order |
Date: |
Thu, 14 Sep 2023 16:32:52 -0400 |
On Thu, Sep 07, 2023 at 06:04:10AM -0700, Mattias Nissler wrote:
> PCI config space is little-endian, so on a big-endian host we need to
> perform byte swaps for values as they are passed to and received from
> the generic PCI config space access machinery.
>
> Signed-off-by: Mattias Nissler <mnissler@rivosinc.com>
> ---
> hw/remote/vfio-user-obj.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
After some discussion about PCI Configuration Space endianness on IRC
with aw, mcayland, and f4bug I am now happy with this patch:
1. Configuration space can only be accessed in 1-, 2-, or 4-byte
accesses.
2. If it's a 2- or 4-byte access then your patch adds the missing
little-endian conversion.
3. If it's a 1-byte access then there is (effectively) no byteswap in
the code path and the pci_dev->config[] array is already
little-endian.
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
signature.asc
Description: PGP signature
- Re: [PATCH v3 2/5] softmmu: Support concurrent bounce buffers, (continued)
- [PATCH v3 4/5] vfio-user: Message-based DMA support, Mattias Nissler, 2023/09/07
- [PATCH v3 3/5] Update subprojects/libvfio-user, Mattias Nissler, 2023/09/07
- [PATCH v3 1/5] softmmu: Per-AddressSpace bounce buffering, Mattias Nissler, 2023/09/07
- [PATCH v3 5/5] vfio-user: Fix config space access byte order, Mattias Nissler, 2023/09/07
- Re: [PATCH v3 0/5] Support message-based DMA in vfio-user server, Stefan Hajnoczi, 2023/09/14