[PATCH] eal/x86: fix build on systems with WAITPKG support
David Marchand
david.marchand at redhat.com
Mon Aug 28 09:08:07 CEST 2023
Hello Bruce,
On Fri, Aug 25, 2023 at 5:29 PM Bruce Richardson
<bruce.richardson at 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: roretzla at linux.microsoft.com
>
> Signed-off-by: Bruce Richardson <bruce.richardson at 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?
--
David Marchand
More information about the dev
mailing list