[PATCH v2] eal/x86: fix build on systems with WAITPKG support
David Marchand
david.marchand at redhat.com
Mon Aug 28 16:39:02 CEST 2023
On Mon, Aug 28, 2023 at 12:40 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 casting 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>
> Acked-by: Morten Brørup <mb at smartsharesystems.com>
> Tested-by: David Marchand <david.marchand at redhat.com>
Applied to fix build on the main branch, thanks.
We can look at the casting helper as a followup.
--
David Marchand
More information about the dev
mailing list