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 3A7F142937; Thu, 13 Apr 2023 23:26:42 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id F2652427EE; Thu, 13 Apr 2023 23:26:12 +0200 (CEST) Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by mails.dpdk.org (Postfix) with ESMTP id 92252410F9 for ; Thu, 13 Apr 2023 23:26:06 +0200 (CEST) Received: by linux.microsoft.com (Postfix, from userid 1086) id 198F7217926E; Thu, 13 Apr 2023 14:26:04 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com 198F7217926E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1681421165; bh=b5Xj6Gqh5y2rycHG1bErPdD+FhQhAU9d2JB9fZ6+Cvk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=HxYL9fDJw2rQ/NdPLGqnZjTRx6VSd5Bw0Lyv3kefj1Nd/vxD/+fswtTWesFtljSyI 2UVH9LSTHNG1n/W1l8JyCXtBPWFWoHZODVDjz6soQ9q+K4zZBPTzR9QfGtkd0sA2aP IDbLISyd0LeI26c4LM9TWJfHwGoaZxr5IsaquW68= From: Tyler Retzlaff To: dev@dpdk.org Cc: bruce.richardson@intel.com, david.marchand@redhat.com, thomas@monjalon.net, mb@smartsharesystems.com, konstantin.ananyev@huawei.com, Tyler Retzlaff Subject: [PATCH v5 05/14] eal: use umonitor umwait and tpause intrinsics Date: Thu, 13 Apr 2023 14:25:54 -0700 Message-Id: <1681421163-18578-6-git-send-email-roretzla@linux.microsoft.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1681421163-18578-1-git-send-email-roretzla@linux.microsoft.com> References: <1680558751-17931-1-git-send-email-roretzla@linux.microsoft.com> <1681421163-18578-1-git-send-email-roretzla@linux.microsoft.com> 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 --- 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..7d83c24 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 */ +#ifndef RTE_TOOLCHAIN_MSVC asm volatile(".byte 0xf3, 0x0f, 0xae, 0xf7;" : : "D"(pmc->addr)); +#else + _umonitor(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 */ +#ifndef RTE_TOOLCHAIN_MSVC asm volatile(".byte 0xf2, 0x0f, 0xae, 0xf7;" : /* ignore rflags */ : "D"(0), /* enter C0.2 */ "a"(tsc_l), "d"(tsc_h)); +#else + _umwait(tsc_l, tsc_h); +#endif end: /* erase sleep address */ @@ -153,10 +161,14 @@ return -ENOTSUP; /* execute TPAUSE */ +#ifndef RTE_TOOLCHAIN_MSVC asm volatile(".byte 0x66, 0x0f, 0xae, 0xf7;" : /* ignore rflags */ : "D"(0), /* enter C0.2 */ "a"(tsc_l), "d"(tsc_h)); +#else + _tpause(tsc_l, tsc_h); +#endif return 0; } -- 1.8.3.1