[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PULL 3/8] vfio: Generalize region support
From: |
Alex Williamson |
Subject: |
Re: [Qemu-devel] [PULL 3/8] vfio: Generalize region support |
Date: |
Thu, 10 Mar 2016 21:14:40 -0700 |
On Thu, 10 Mar 2016 13:46:06 -0700
Eric Blake <address@hidden> wrote:
> On 03/10/2016 09:34 AM, Alex Williamson wrote:
>
> >>> + trace_vfio_msix_fixup(vdev->vbasedev.name,
> >>> + vdev->msix->table_bar,
> >>> region->mmaps[0].offset,
> >>> + region->mmaps[0].offset +
> >>> region->mmaps[0].size);
> >> Sorry this does not compile for me on arm 32b:
> >>
> >> ./trace/generated-tracers.h:16113:23: error: format ‘%lx’ expects
> >> argument of type ‘long unsigned int’, but argument 8 has type ‘off_t’
> >> [-Werror=format=] , name, bar, offset, size);
> >>
> >> -> vfio_msix_fixup(const char *name, int bar, off_t start, off_t end) "
> >> (%s) MSI-X region %d mmap fixup [0x%"PRIx64" - 0x%"PRIx64"]" ?
> >
>
> > vfio_msix_disable(const char *name) " (%s)"
> > -vfio_msix_fixup(const char *name, int bar, off_t offset, size_t size) "
> > (%s) MSI-X region %d mmap fixup [0x%lx - 0x%lx]"
> > +vfio_msix_fixup(const char *name, int bar, off_t start, off_t end) " (%s)
> > MSI-X region %d mmap fixup [0x%"PRIx64" - 0x%"PRIx64"]"
>
> off_t and PRIx64 are not necessarily compatible types (on a 64-bit
> platform, one could be 'long' while the other is 'long long'). And even
> though we set compiler flags to get 64-bit off_t on 32-bit platforms,
> your code is not portable to people that don't set those flags and are
> stuck with 32-bit off_t.
>
> It may be better to declare start and end as [u]int64_t, rather than off_t.
Looks like we need another respin anyway, and uint64_t works just as
well here. Done. Thanks,
Alex
[Qemu-devel] [PULL 4/8] vfio/pci: Convert all MemoryRegion to dynamic alloc and consistent functions, Alex Williamson, 2016/03/09
[Qemu-devel] [PULL 5/8] vfio/pci: Fixup PCI option ROMs, Alex Williamson, 2016/03/09
[Qemu-devel] [PULL 6/8] vfio/pci: Split out VGA setup, Alex Williamson, 2016/03/09
[Qemu-devel] [PULL 7/8] vfio/pci: replace fixed string limit by g_strdup_printf, Alex Williamson, 2016/03/09
[Qemu-devel] [PULL 8/8] MAINTAINERS: Add entry for the include/hw/vfio/ folder, Alex Williamson, 2016/03/09
Re: [Qemu-devel] [PULL 0/8] VFIO updates 2016-03-09, Peter Maydell, 2016/03/10