From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 5744E41B28; Mon, 28 Aug 2023 10:05:33 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 3CCF94026D; Mon, 28 Aug 2023 10:05:33 +0200 (CEST) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mails.dpdk.org (Postfix) with ESMTP id 0AA804021E for ; Mon, 28 Aug 2023 10:05:31 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1693209931; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=TxioY+IyuaArjM9+YonNUUxScsaPmIm4e90e9cfIuUM=; b=JP1GXD1qCiDbP+jN6HqwMXG4JwZhF8Bl6vWdgAALlREdcWzF0kLkILkuH8pMxwgdEqNOPX xkn/WvxG7aH2vR/QgPx/wNNsfscu9cIM8/pK14uWenDXIyM1Jggy1N9v8SIRkbGhDOSg6+ LgT8kwTMyP0aARv9x7n3pT5C+XNTJgI= Received: from mail-lf1-f70.google.com (mail-lf1-f70.google.com [209.85.167.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-12-Hrnnw1JkMPqZyLrqqVqGeQ-1; Mon, 28 Aug 2023 04:05:30 -0400 X-MC-Unique: Hrnnw1JkMPqZyLrqqVqGeQ-1 Received: by mail-lf1-f70.google.com with SMTP id 2adb3069b0e04-500b575b32aso1138612e87.0 for ; Mon, 28 Aug 2023 01:05:29 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1693209928; x=1693814728; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=TxioY+IyuaArjM9+YonNUUxScsaPmIm4e90e9cfIuUM=; b=HaX2nq/SZrJ4emyGnO4Ee57rqpkaPwQizJp4kFk2BYeqcF15MpD8YliBON1fx2adXG CKoBCZBSAFH+afcJB7SXVqtzS54n2YeP7d5XTdgsGe4cSb0FjosWIq/X1SdgR8cZ83PF B2R28OYo1CNvuBibJzsKwg8AI0DPg5fGFkhdmmCgPcoBz5l463+2lw52lauxag5o/vlB vaxIh0HxWOpubW1TMwz6v9+ZM9KYNpz3SpB2Cfg2bCvehShWumLRqWyDpUZXaIFtHlQx hocLvUHgxdLAMd1lpFtvyRfP6VeKLxFEAW26sGNZz14UZrrGIHVBVMKhHEBoYAWhQoDQ IelA== X-Gm-Message-State: AOJu0Yz+jboOkrba7G2vIe4rbmUFQic5BqQzwP5Pc5dY3nQ0SwYh/Y0j AY+u+bv8ykR6+p7SINB7TxmZ31LSECfH9GWC6ggAmCmjIQgLloyFqmtmY4z+tzQmvj+F82xj5K7 1FXDBGWEwBV6WbLe2tRE= X-Received: by 2002:a05:6512:220a:b0:4ff:a04c:8a5b with SMTP id h10-20020a056512220a00b004ffa04c8a5bmr19992883lfu.47.1693209928656; Mon, 28 Aug 2023 01:05:28 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEurZ0JUiN9ltdfM7BK/QFdGI3FrSOtOhbYt4bFQ2TR81u9MaWOWhBGYZ2rOVV0vt2iUZ240RzRikDx2I/LKd4= X-Received: by 2002:a05:6512:220a:b0:4ff:a04c:8a5b with SMTP id h10-20020a056512220a00b004ffa04c8a5bmr19992875lfu.47.1693209928294; Mon, 28 Aug 2023 01:05:28 -0700 (PDT) MIME-Version: 1.0 References: <20230825152850.1107690-1-bruce.richardson@intel.com> In-Reply-To: From: David Marchand Date: Mon, 28 Aug 2023 10:05:17 +0200 Message-ID: Subject: Re: [PATCH] eal/x86: fix build on systems with WAITPKG support To: Bruce Richardson Cc: dev@dpdk.org, mb@smartsharesystems.com, roretzla@linux.microsoft.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org On Mon, Aug 28, 2023 at 9:08=E2=80=AFAM David Marchand wrote: > > Hello Bruce, > > On Fri, Aug 25, 2023 at 5:29=E2=80=AFPM Bruce Richardson > 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=3Ddiscarded-qualifiers] > > 113 | _umonitor(pmc->addr); > > | ~~~^~~~~~ > > > > We can avoid this issue by using RTE_PTR_ADD(..., 0) to cast the pointe= r > > 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@linux.microsoft.com > > > > Signed-off-by: Bruce Richardson > > 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=3Dsapphirerapids [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 =E2=80=98rte_power_monit= or=E2=80=99: ../lib/eal/x86/rte_power_intrinsics.c:113:22: warning: passing argument 1 of =E2=80=98_umonitor=E2=80=99 discards =E2=80=98volatile=E2=80= =99 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 =E2=80=98void *=E2=80=99 but argument is of type =E2=80=98vo= latile void *=E2=80=99 39 | _umonitor (void *__A) | ~~~~~~^~~ [241/241] Linking target lib/librte_ethdev.so.24.0 --=20 David Marchand