On Mon, Aug 28, 2023 at 9:08 AM David Marchand <david.march...@redhat.com> wrote: > > Hello Bruce, > > On Fri, Aug 25, 2023 at 5:29 PM Bruce Richardson > <bruce.richard...@intel.com> wrote: > > > > When doing a build for a system with WAITPKG support and a modern > > compiler, we get build errors for the "_umonitor" intrinsic, due to the > > casting away of the "volatile" on the parameter. > > > > ../lib/eal/x86/rte_power_intrinsics.c: In function 'rte_power_monitor': > > ../lib/eal/x86/rte_power_intrinsics.c:113:22: error: passing argument 1 > > of '_umonitor' discards 'volatile' qualifier from pointer target type > > [-Werror=discarded-qualifiers] > > 113 | _umonitor(pmc->addr); > > | ~~~^~~~~~ > > > > We can avoid this issue by using RTE_PTR_ADD(..., 0) to cast the pointer > > through "uintptr_t" and thereby remove the volatile without warning. > > We also ensure comments are correct for each leg of the > > ifdef..else..endif block. > > > > Fixes: 60943c04f3bc ("eal/x86: use intrinsics for power management") > > Cc: roret...@linux.microsoft.com > > > > Signed-off-by: Bruce Richardson <bruce.richard...@intel.com> > > I'm looking for a system with WAITPKG in the RH lab.. so far, no luck. > Do you have a way to force-reproduce this issue? Like some compiler > options forcing support?
Ah.. reproduced with -Dcpu_instruction_set=sapphirerapids [52/241] Compiling C object lib/librte_eal.a.p/eal_x86_rte_power_intrinsics.c.o ../lib/eal/x86/rte_power_intrinsics.c: In function ‘rte_power_monitor’: ../lib/eal/x86/rte_power_intrinsics.c:113:22: warning: passing argument 1 of ‘_umonitor’ discards ‘volatile’ qualifier from pointer target type [-Wdiscarded-qualifiers] 113 | _umonitor(pmc->addr); | ~~~^~~~~~ In file included from /usr/lib/gcc/x86_64-redhat-linux/11/include/x86gprintrin.h:89, from /usr/lib/gcc/x86_64-redhat-linux/11/include/immintrin.h:27, from ../lib/eal/x86/include/rte_rtm.h:8, from ../lib/eal/x86/rte_power_intrinsics.c:7: /usr/lib/gcc/x86_64-redhat-linux/11/include/waitpkgintrin.h:39:18: note: expected ‘void *’ but argument is of type ‘volatile void *’ 39 | _umonitor (void *__A) | ~~~~~~^~~ [241/241] Linking target lib/librte_ethdev.so.24.0 -- David Marchand