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 E568342E48; Tue, 11 Jul 2023 18:50:20 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 1E78242D43; Tue, 11 Jul 2023 18:49:32 +0200 (CEST) Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by mails.dpdk.org (Postfix) with ESMTP id 4363D410EE for ; Tue, 11 Jul 2023 18:49:20 +0200 (CEST) Received: by linux.microsoft.com (Postfix, from userid 1086) id C2C2821C3F29; Tue, 11 Jul 2023 09:49:18 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com C2C2821C3F29 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1689094158; bh=U8fBf6+L/dc/zzYVgJ5T4l8jR24GWdImZv4rIvBjEzY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=B1pl77GcEqxaQOz1S2J0kviNaO1G6Gi5CzxSWZLLFTZu0+fHA/zkLnf4ZJy9gdW5p 4Ko4zzI8B7pj0FzQHimVaSHdp2xBZGqJPZ/KCFa198QaSJGAMs3vVWmmrX35tRfwlI cpdBw+1U8NBSoNRxNVVHmR4KBaQZcIzNf0yuHwwc= From: Tyler Retzlaff To: dev@dpdk.org Cc: Bruce Richardson , Konstantin Ananyev , Ciara Power , thomas@monjalon.net, david.marchand@redhat.com, mb@smartsharesystems.com, Tyler Retzlaff Subject: [PATCH v9 05/14] eal: use umonitor umwait and tpause intrinsics Date: Tue, 11 Jul 2023 09:49:08 -0700 Message-Id: <1689094157-16873-6-git-send-email-roretzla@linux.microsoft.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1689094157-16873-1-git-send-email-roretzla@linux.microsoft.com> References: <1680558751-17931-1-git-send-email-roretzla@linux.microsoft.com> <1689094157-16873-1-git-send-email-roretzla@linux.microsoft.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Inline assembly is not supported for MSVC x64 instead use _umonitor, _umwait and _tpause intrinsics. Signed-off-by: Tyler Retzlaff Acked-by: Morten Brørup Acked-by: Konstantin Ananyev --- lib/eal/x86/rte_power_intrinsics.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/lib/eal/x86/rte_power_intrinsics.c b/lib/eal/x86/rte_power_intrinsics.c index f749da9..4066d13 100644 --- a/lib/eal/x86/rte_power_intrinsics.c +++ b/lib/eal/x86/rte_power_intrinsics.c @@ -109,9 +109,13 @@ */ /* set address for UMONITOR */ +#if defined(RTE_TOOLCHAIN_MSVC) || defined(__WAITPKG__) + _umonitor(pmc->addr); +#else asm volatile(".byte 0xf3, 0x0f, 0xae, 0xf7;" : : "D"(pmc->addr)); +#endif /* now that we've put this address into monitor, we can unlock */ rte_spinlock_unlock(&s->lock); @@ -123,10 +127,14 @@ goto end; /* execute UMWAIT */ +#if defined(RTE_TOOLCHAIN_MSVC) || defined(__WAITPKG__) + _umwait(tsc_l, tsc_h); +#else asm volatile(".byte 0xf2, 0x0f, 0xae, 0xf7;" : /* ignore rflags */ : "D"(0), /* enter C0.2 */ "a"(tsc_l), "d"(tsc_h)); +#endif end: /* erase sleep address */ @@ -153,10 +161,14 @@ return -ENOTSUP; /* execute TPAUSE */ +#if defined(RTE_TOOLCHAIN_MSVC) || defined(__WAITPKG__) + _tpause(tsc_l, tsc_h); +#else asm volatile(".byte 0x66, 0x0f, 0xae, 0xf7;" : /* ignore rflags */ : "D"(0), /* enter C0.2 */ "a"(tsc_l), "d"(tsc_h)); +#endif return 0; } -- 1.8.3.1