qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Cédric Le Goater" <clg@redhat.com>
To: "Duan, Zhenzhong" <zhenzhong.duan@intel.com>,
	Markus Armbruster <armbru@redhat.com>
Cc: "qemu-devel@nongnu.org" <qemu-devel@nongnu.org>,
	"alex.williamson@redhat.com" <alex.williamson@redhat.com>,
	"jgg@nvidia.com" <jgg@nvidia.com>,
	"nicolinc@nvidia.com" <nicolinc@nvidia.com>,
	"Martins, Joao" <joao.m.martins@oracle.com>,
	"eric.auger@redhat.com" <eric.auger@redhat.com>,
	"peterx@redhat.com" <peterx@redhat.com>,
	"jasowang@redhat.com" <jasowang@redhat.com>,
	"Tian, Kevin" <kevin.tian@intel.com>,
	"Liu, Yi L" <yi.l.liu@intel.com>,
	"Sun, Yi Y" <yi.y.sun@intel.com>,
	"Peng, Chao P" <chao.p.peng@intel.com>
Subject: Re: [PATCH v3 00/37] vfio: Adopt iommufd
Date: Fri, 27 Oct 2023 09:45:38 +0200	[thread overview]
Message-ID: <d4e5771e-08e4-46b5-97d4-570b4883e4f7@redhat.com> (raw)
In-Reply-To: <SJ0PR11MB67444B3A1BE0FAE6934ABAD592DCA@SJ0PR11MB6744.namprd11.prod.outlook.com>

On 10/27/23 08:17, Duan, Zhenzhong wrote:
> Hi Markus,
> 
>> -----Original Message-----
>> From: Markus Armbruster <armbru@redhat.com>
>> Sent: Thursday, October 26, 2023 9:27 PM
>> Subject: Re: [PATCH v3 00/37] vfio: Adopt iommufd
>>
>> Zhenzhong Duan <zhenzhong.duan@intel.com> writes:
>>
>>> Hi,
>>>
>>> Thanks all for giving guides and comments on previous series, here is
>>> the v3 of pure iommufd support part.
>>>
>>> Based on Cédric's suggestion, this series includes an effort to remove
>>> spapr code from container.c, now all spapr functions are moved to spapr.c
>>> or spapr_pci_vfio.c, but there are still a few trival check on
>>> VFIO_SPAPR_TCE_*_IOMMU which I am not sure if deserved to introduce many
>>> callbacks and duplicate code just to remove them. Some functions are moved
>>> to spapr.c instead of spapr_pci_vfio.c to avoid compile issue because
>>> spapr_pci_vfio.c is arch specific, or else we need to introduce stub
>>> functions to those spapr functions moved.
>>
>> [...]
>>
>>> qemu code:
>> https://github.com/yiliu1765/qemu/commits/zhenzhong/iommufd_cdev_v3
>>> Based on vfio-next, commit id: fd0e1c8bc1
>>
>> I fetched this, and get several compile errors with Clang (but not with
>> GCC):
>>
>>     FAILED: libqemu-x86_64-softmmu.fa.p/hw_vfio_common.c.o
>>     clang -m64 -mcx16 -Ilibqemu-x86_64-softmmu.fa.p -I. -I.. -Itarget/i386 -
>> I../target/i386 -Iqapi -Itrace -Iui -Iui/shader -I/usr/include/pixman-1 -
>> I/usr/include/capstone -I/usr/include/spice-server -I/usr/include/spice-1 -
>> I/usr/include/cacard -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -
>> I/usr/include/sysprof-4 -I/usr/include/nss3 -I/usr/include/nspr4 -
>> I/usr/include/PCSC -fcolor-diagnostics -Wall -Winvalid-pch -Werror -std=gnu11 -
>> O2 -g -fstack-protector-strong -Wundef -Wwrite-strings -Wmissing-prototypes -
>> Wstrict-prototypes -Wredundant-decls -Wold-style-definition -Wtype-limits -
>> Wformat-security -Wformat-y2k -Winit-self -Wignored-qualifiers -Wempty-body
>> -Wnested-externs -Wendif-labels -Wexpansion-to-defined -Wmissing-format-
>> attribute -Wno-initializer-overrides -Wno-missing-include-dirs -Wno-shift-
>> negative-value -Wno-string-plus-int -Wno-typedef-redefinition -Wno-
>> tautological-type-limit-compare -Wno-psabi -Wno-gnu-variable-sized-type-not-
>> at-end -Wthread-safety -isystem /work/armbru/qemu/linux-headers -isystem
>> linux-headers -iquote . -iquote /work/armbru/qemu -iquote
>> /work/armbru/qemu/include -iquote /work/armbru/qemu/host/include/x86_64 -
>> iquote /work/armbru/qemu/host/include/generic -iquote
>> /work/armbru/qemu/tcg/i386 -pthread -D_GNU_SOURCE -
>> D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -fno-strict-aliasing -fno-
>> common -fwrapv -fsanitize-coverage-allowlist=instrumentation-filter -
>> fsanitize=fuzzer-no-link -fPIE -isystem../linux-headers -isystemlinux-headers -
>> DNEED_CPU_H '-DCONFIG_TARGET="x86_64-softmmu-config-target.h"' '-
>> DCONFIG_DEVICES="x86_64-softmmu-config-devices.h"' -MD -MQ libqemu-
>> x86_64-softmmu.fa.p/hw_vfio_common.c.o -MF libqemu-x86_64-
>> softmmu.fa.p/hw_vfio_common.c.o.d -o libqemu-x86_64-
>> softmmu.fa.p/hw_vfio_common.c.o -c ../hw/vfio/common.c
>>     ../hw/vfio/common.c:682:40: error: variable 'hostwin' is uninitialized when
>> used here [-Werror,-Wuninitialized]
>>             hwaddr pgmask = (1ULL << ctz64(hostwin->iova_pgsizes)) - 1;
>>                                            ^~~~~~~
>>     ../hw/vfio/common.c:578:31: note: initialize the variable 'hostwin' to silence
>> this warning
>>         VFIOHostDMAWindow *hostwin;
>>                                   ^
>>                                    = NULL
>>     ../hw/vfio/common.c:785:33: error: variable 'hostwin' is uninitialized when
>> used here [-Werror,-Wuninitialized]
>>             pgmask = (1ULL << ctz64(hostwin->iova_pgsizes)) - 1;
>>                                     ^~~~~~~
>>     ../hw/vfio/common.c:783:35: note: initialize the variable 'hostwin' to silence
>> this warning
>>             VFIOHostDMAWindow *hostwin;
>>                                       ^
>>                                        = NULL
>>     2 errors generated.
>>     FAILED: tests/unit/test-resv-mem.p/test-resv-mem.c.o
>>     clang -m64 -mcx16 -Itests/unit/test-resv-mem.p -Itests/unit -I../tests/unit -I. -
>> Iqapi -Itrace -Iui -Iui/shader -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -
>> I/usr/include/sysprof-4 -fcolor-diagnostics -Wall -Winvalid-pch -Werror -
>> std=gnu11 -O2 -g -fstack-protector-strong -Wundef -Wwrite-strings -Wmissing-
>> prototypes -Wstrict-prototypes -Wredundant-decls -Wold-style-definition -
>> Wtype-limits -Wformat-security -Wformat-y2k -Winit-self -Wignored-qualifiers -
>> Wempty-body -Wnested-externs -Wendif-labels -Wexpansion-to-defined -
>> Wmissing-format-attribute -Wno-initializer-overrides -Wno-missing-include-dirs -
>> Wno-shift-negative-value -Wno-string-plus-int -Wno-typedef-redefinition -Wno-
>> tautological-type-limit-compare -Wno-psabi -Wno-gnu-variable-sized-type-not-
>> at-end -Wthread-safety -isystem /work/armbru/qemu/linux-headers -isystem
>> linux-headers -iquote . -iquote /work/armbru/qemu -iquote
>> /work/armbru/qemu/include -iquote /work/armbru/qemu/host/include/x86_64 -
>> iquote /work/armbru/qemu/host/include/generic -iquote
>> /work/armbru/qemu/tcg/i386 -pthread -D_GNU_SOURCE -
>> D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -fno-strict-aliasing -fno-
>> common -fwrapv -fsanitize-coverage-allowlist=instrumentation-filter -
>> fsanitize=fuzzer-no-link -fPIE -MD -MQ tests/unit/test-resv-mem.p/test-resv-
>> mem.c.o -MF tests/unit/test-resv-mem.p/test-resv-mem.c.o.d -o tests/unit/test-
>> resv-mem.p/test-resv-mem.c.o -c ../tests/unit/test-resv-mem.c
>>     ../tests/unit/test-resv-mem.c:42:9: error: variable 'i' set but not used [-
>> Werror,-Wunused-but-set-variable]
>>         int i = 0;
>>             ^
>>     1 error generated.
>>
>> Delete @i, please.
> 
> Thanks for your report, I'll fix it and build with both compilers next time.

a compile on a fedora rawhide also reports :

../hw/vfio/iommufd.c: In function ‘vfio_get_info_iova_range’:
../hw/vfio/iommufd.c:370:27: error: cast from pointer to integer of different size [-Werror=pointer-to-int-cast]
   370 |     info->allowed_iovas = (uint64_t)(info + 1);
       |                           ^
../hw/vfio/iommufd.c:377:19: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast]
   377 |     iova_ranges = (struct iommu_iova_range *)info->allowed_iovas;
       |                   ^
cc1: all warnings being treated as errors


> About second error, I'll send a separate patch as it's unrelated to this series.


Since this is a big series, I suggest that you take this patch in your build
environment,


diff --git a/meson.build b/meson.build
index 72a57288a026325d5ff753131c037e99f6f35c1a..c946cbef5b29e23475dc4cf345655e0466cbfade 100644
--- a/meson.build
+++ b/meson.build
@@ -462,6 +462,9 @@ warn_flags = [
    '-Wno-tautological-type-limit-compare',
    '-Wno-psabi',
    '-Wno-gnu-variable-sized-type-not-at-end',
+  '-Wshadow=local',
+  '-Wno-error=shadow=local',
+  '-Wno-error=shadow=compatible-local',
  ]
  
  if targetos != 'darwin'


Thanks,

C.



  reply	other threads:[~2023-10-27  7:46 UTC|newest]

Thread overview: 95+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-26 10:30 [PATCH v3 00/37] vfio: Adopt iommufd Zhenzhong Duan
2023-10-26 10:30 ` [PATCH v3 01/37] vfio/container: Move IBM EEH related functions into spapr_pci_vfio.c Zhenzhong Duan
2023-10-26 14:23   ` Eric Farman
2023-10-27  9:19   ` Cédric Le Goater
2023-10-26 10:30 ` [PATCH v3 02/37] vfio/container: Move vfio_container_add/del_section_window into spapr.c Zhenzhong Duan
2023-10-27  9:19   ` Cédric Le Goater
2023-10-26 10:30 ` [PATCH v3 03/37] vfio/container: Move spapr specific init/deinit " Zhenzhong Duan
2023-10-27  9:27   ` Cédric Le Goater
2023-10-26 10:30 ` [PATCH v3 04/37] vfio/spapr: Make vfio_spapr_create/remove_window static Zhenzhong Duan
2023-10-27  9:27   ` Cédric Le Goater
2023-10-26 10:30 ` [PATCH v3 05/37] vfio/common: Move vfio_host_win_add/del into spapr.c Zhenzhong Duan
2023-10-27  9:30   ` Cédric Le Goater
2023-10-26 10:30 ` [PATCH v3 06/37] vfio: Introduce base object for VFIOContainer and targetted interface Zhenzhong Duan
2023-10-27 14:02   ` Cédric Le Goater
2023-10-30  2:40     ` Duan, Zhenzhong
2023-10-31  7:57       ` Cédric Le Goater
2023-10-31  8:31         ` Duan, Zhenzhong
2023-10-26 10:30 ` [PATCH v3 07/37] vfio/container: Introduce a empty VFIOIOMMUOps Zhenzhong Duan
2023-10-27 14:20   ` Cédric Le Goater
2023-10-30  2:43     ` Duan, Zhenzhong
2023-10-31  8:21       ` Cédric Le Goater
2023-10-26 10:30 ` [PATCH v3 08/37] vfio/container: Switch to dma_map|unmap API Zhenzhong Duan
2023-10-27 14:26   ` Cédric Le Goater
2023-10-30  2:48     ` Duan, Zhenzhong
2023-10-26 10:30 ` [PATCH v3 09/37] vfio/common: Move giommu_list in base container Zhenzhong Duan
2023-10-27 14:38   ` Cédric Le Goater
2023-10-30  2:48     ` Duan, Zhenzhong
2023-10-26 10:30 ` [PATCH v3 10/37] vfio/container: Move space field to " Zhenzhong Duan
2023-10-27 14:46   ` Cédric Le Goater
2023-10-30  2:51     ` Duan, Zhenzhong
2023-10-31  8:24       ` Cédric Le Goater
2023-10-26 10:30 ` [PATCH v3 11/37] vfio/container: Switch to IOMMU BE set_dirty_page_tracking/query_dirty_bitmap API Zhenzhong Duan
2023-10-27 14:53   ` Cédric Le Goater
2023-10-30  2:53     ` Duan, Zhenzhong
2023-10-26 10:30 ` [PATCH v3 12/37] vfio/container: Move per container device list in base container Zhenzhong Duan
2023-10-27 15:03   ` Cédric Le Goater
2023-10-26 10:30 ` [PATCH v3 13/37] vfio/container: Convert functions to " Zhenzhong Duan
2023-10-27 15:03   ` Cédric Le Goater
2023-10-26 10:30 ` [PATCH v3 14/37] vfio/container: Move vrdl_list, pgsizes and dma_max_mappings " Zhenzhong Duan
2023-10-27 15:52   ` Cédric Le Goater
2023-10-30  3:14     ` Duan, Zhenzhong
2023-10-31  8:26       ` Cédric Le Goater
2023-10-26 10:30 ` [PATCH v3 15/37] vfio/container: Move listener " Zhenzhong Duan
2023-10-26 10:30 ` [PATCH v3 16/37] vfio/container: Move dirty_pgsizes and max_dirty_bitmap_size " Zhenzhong Duan
2023-10-27 16:01   ` Cédric Le Goater
2023-10-26 10:30 ` [PATCH v3 17/37] vfio/container: Move iova_ranges " Zhenzhong Duan
2023-10-26 10:30 ` [PATCH v3 18/37] vfio/container: Implement attach/detach_device Zhenzhong Duan
2023-10-27 16:04   ` Cédric Le Goater
2023-10-27 16:06   ` Cédric Le Goater
2023-10-30  3:20     ` Duan, Zhenzhong
2023-10-26 10:30 ` [PATCH v3 19/37] vfio/spapr: Introduce spapr backend and target interface Zhenzhong Duan
2023-10-27 16:04   ` Cédric Le Goater
2023-10-30  3:15     ` Duan, Zhenzhong
2023-10-26 10:30 ` [PATCH v3 20/37] vfio/spapr: switch to spapr IOMMU BE add/del_section_window Zhenzhong Duan
2023-10-26 10:30 ` [PATCH v3 21/37] vfio/spapr: Move prereg_listener into spapr container Zhenzhong Duan
2023-10-26 10:30 ` [PATCH v3 22/37] vfio/spapr: Move hostwin_list " Zhenzhong Duan
2023-10-26 10:30 ` [PATCH v3 23/37] Add iommufd configure option Zhenzhong Duan
2023-10-31  8:58   ` Cédric Le Goater
2023-10-31 10:52     ` Duan, Zhenzhong
2023-10-31 11:25       ` Cédric Le Goater
2023-10-26 10:30 ` [PATCH v3 24/37] backends/iommufd: Introduce the iommufd object Zhenzhong Duan
2023-10-26 13:27   ` Markus Armbruster
2023-10-27  7:50     ` Duan, Zhenzhong
2023-10-27  8:30       ` Markus Armbruster
2023-10-27  9:41         ` Duan, Zhenzhong
2023-10-26 10:30 ` [PATCH v3 25/37] util/char_dev: Add open_cdev() Zhenzhong Duan
2023-10-30 14:53   ` Cédric Le Goater
2023-10-31  1:59     ` Duan, Zhenzhong
2023-10-26 10:30 ` [PATCH v3 26/37] vfio/iommufd: Implement the iommufd backend Zhenzhong Duan
2023-10-26 10:30 ` [PATCH v3 27/37] vfio/iommufd: Switch to manual hwpt allocation Zhenzhong Duan
2023-10-30 13:52   ` Cédric Le Goater
2023-10-31  2:02     ` Duan, Zhenzhong
2023-10-26 10:30 ` [PATCH v3 28/37] vfio/iommufd: Add support for iova_ranges Zhenzhong Duan
2023-10-26 10:30 ` [PATCH v3 29/37] vfio/iommufd: Bypass EEH if iommufd backend Zhenzhong Duan
2023-10-30 13:56   ` Cédric Le Goater
2023-10-31  2:26     ` Duan, Zhenzhong
2023-10-31  9:01       ` Cédric Le Goater
2023-10-31  9:06         ` Duan, Zhenzhong
2023-10-26 10:30 ` [PATCH v3 30/37] vfio/pci: Extract out a helper vfio_pci_get_pci_hot_reset_info Zhenzhong Duan
2023-10-30 13:59   ` Cédric Le Goater
2023-10-31  2:30     ` Duan, Zhenzhong
2023-10-26 10:30 ` [PATCH v3 31/37] vfio/pci: Adapt vfio pci hot reset support with iommufd BE Zhenzhong Duan
2023-10-30 14:04   ` Cédric Le Goater
2023-10-31  2:27     ` Duan, Zhenzhong
2023-10-26 10:30 ` [PATCH v3 32/37] vfio/pci: Allow the selection of a given iommu backend Zhenzhong Duan
2023-10-26 10:31 ` [PATCH v3 33/37] vfio/pci: Make vfio cdev pre-openable by passing a file handle Zhenzhong Duan
2023-10-26 10:31 ` [PATCH v3 34/37] vfio: Allow the selection of a given iommu backend for platform ap and ccw Zhenzhong Duan
2023-10-26 10:31 ` [PATCH v3 35/37] vfio/platform: Make vfio cdev pre-openable by passing a file handle Zhenzhong Duan
2023-10-26 10:31 ` [PATCH v3 36/37] vfio/ap: " Zhenzhong Duan
2023-10-26 10:31 ` [PATCH v3 37/37] vfio/ccw: " Zhenzhong Duan
2023-10-26 13:27 ` [PATCH v3 00/37] vfio: Adopt iommufd Markus Armbruster
2023-10-27  6:17   ` Duan, Zhenzhong
2023-10-27  7:45     ` Cédric Le Goater [this message]
2023-10-27  8:16       ` Duan, Zhenzhong
2023-10-27 13:43         ` Cédric Le Goater

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=d4e5771e-08e4-46b5-97d4-570b4883e4f7@redhat.com \
    --to=clg@redhat.com \
    --cc=alex.williamson@redhat.com \
    --cc=armbru@redhat.com \
    --cc=chao.p.peng@intel.com \
    --cc=eric.auger@redhat.com \
    --cc=jasowang@redhat.com \
    --cc=jgg@nvidia.com \
    --cc=joao.m.martins@oracle.com \
    --cc=kevin.tian@intel.com \
    --cc=nicolinc@nvidia.com \
    --cc=peterx@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=yi.l.liu@intel.com \
    --cc=yi.y.sun@intel.com \
    --cc=zhenzhong.duan@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).