Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/130196/?format=api
http://patchwork.dpdk.org/api/patches/130196/?format=api", "web_url": "http://patchwork.dpdk.org/project/dpdk/patch/1691781658-32520-5-git-send-email-roretzla@linux.microsoft.com/", "project": { "id": 1, "url": "http://patchwork.dpdk.org/api/projects/1/?format=api", "name": "DPDK", "link_name": "dpdk", "list_id": "dev.dpdk.org", "list_email": "dev@dpdk.org", "web_url": "http://core.dpdk.org", "scm_url": "git://dpdk.org/dpdk", "webscm_url": "http://git.dpdk.org/dpdk", "list_archive_url": "https://inbox.dpdk.org/dev", "list_archive_url_format": "https://inbox.dpdk.org/dev/{}", "commit_url_format": "" }, "msgid": "<1691781658-32520-5-git-send-email-roretzla@linux.microsoft.com>", "list_archive_url": "https://inbox.dpdk.org/dev/1691781658-32520-5-git-send-email-roretzla@linux.microsoft.com", "date": "2023-08-11T19:20:46", "name": "[v11,04/16] eal: use cpuid and cpuidex intrinsics", "commit_ref": null, "pull_url": null, "state": "accepted", "archived": true, "hash": "0b83f1bc0c06743e051a23626e546d2c440aa134", "submitter": { "id": 2077, "url": "http://patchwork.dpdk.org/api/people/2077/?format=api", "name": "Tyler Retzlaff", "email": "roretzla@linux.microsoft.com" }, "delegate": { "id": 24651, "url": "http://patchwork.dpdk.org/api/users/24651/?format=api", "username": "dmarchand", "first_name": "David", "last_name": "Marchand", "email": "david.marchand@redhat.com" }, "mbox": "http://patchwork.dpdk.org/project/dpdk/patch/1691781658-32520-5-git-send-email-roretzla@linux.microsoft.com/mbox/", "series": [ { "id": 29198, "url": "http://patchwork.dpdk.org/api/series/29198/?format=api", "web_url": "http://patchwork.dpdk.org/project/dpdk/list/?series=29198", "date": "2023-08-11T19:20:44", "name": "msvc integration changes", "version": 11, "mbox": "http://patchwork.dpdk.org/series/29198/mbox/" } ], "comments": "http://patchwork.dpdk.org/api/patches/130196/comments/", "check": "success", "checks": "http://patchwork.dpdk.org/api/patches/130196/checks/", "tags": {}, "related": [], "headers": { "Return-Path": "<dev-bounces@dpdk.org>", "X-Original-To": "patchwork@inbox.dpdk.org", "Delivered-To": "patchwork@inbox.dpdk.org", "Received": [ "from mails.dpdk.org (mails.dpdk.org [217.70.189.124])\n\tby inbox.dpdk.org (Postfix) with ESMTP id 28A2C43037;\n\tFri, 11 Aug 2023 21:21:27 +0200 (CEST)", "from mails.dpdk.org (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id 7E5424326A;\n\tFri, 11 Aug 2023 21:21:07 +0200 (CEST)", "from linux.microsoft.com (linux.microsoft.com [13.77.154.182])\n by mails.dpdk.org (Postfix) with ESMTP id F392F40F17\n for <dev@dpdk.org>; Fri, 11 Aug 2023 21:21:00 +0200 (CEST)", "by linux.microsoft.com (Postfix, from userid 1086)\n id 4FD4820FD0C5; Fri, 11 Aug 2023 12:21:00 -0700 (PDT)" ], "DKIM-Filter": "OpenDKIM Filter v2.11.0 linux.microsoft.com 4FD4820FD0C5", "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com;\n s=default; t=1691781660;\n bh=bPgAm+R23dJoygVwnfMeNv3Rc6j/VXQwtzi9fLarLXU=;\n h=From:To:Cc:Subject:Date:In-Reply-To:References:From;\n b=ItxI+lHMW2ElNS3zqSHqxRkS8skQoUFzhrCkgjeKXAUAGVGy+enI3ia1/lqfNi4CT\n +gRDVdoy9+VKjixg0mAjaMI2P+8vogPDD8eUSMndwT/5Jzl7VCWftJf8dJWXMZzAzJ\n Zm5Rf/rNwYwinIDHadlfW4az1aGMz9rzvCytjHDU=", "From": "Tyler Retzlaff <roretzla@linux.microsoft.com>", "To": "dev@dpdk.org", "Cc": "Bruce Richardson <bruce.richardson@intel.com>,\n Konstantin Ananyev <konstantin.v.ananyev@yandex.ru>,\n Ciara Power <ciara.power@intel.com>, thomas@monjalon.net,\n david.marchand@redhat.com, mb@smartsharesystems.com,\n Tyler Retzlaff <roretzla@linux.microsoft.com>", "Subject": "[PATCH v11 04/16] eal: use cpuid and cpuidex intrinsics", "Date": "Fri, 11 Aug 2023 12:20:46 -0700", "Message-Id": "<1691781658-32520-5-git-send-email-roretzla@linux.microsoft.com>", "X-Mailer": "git-send-email 1.8.3.1", "In-Reply-To": "<1691781658-32520-1-git-send-email-roretzla@linux.microsoft.com>", "References": "<1680558751-17931-1-git-send-email-roretzla@linux.microsoft.com>\n <1691781658-32520-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 <dev.dpdk.org>", "List-Unsubscribe": "<https://mails.dpdk.org/options/dev>,\n <mailto:dev-request@dpdk.org?subject=unsubscribe>", "List-Archive": "<http://mails.dpdk.org/archives/dev/>", "List-Post": "<mailto:dev@dpdk.org>", "List-Help": "<mailto:dev-request@dpdk.org?subject=help>", "List-Subscribe": "<https://mails.dpdk.org/listinfo/dev>,\n <mailto:dev-request@dpdk.org?subject=subscribe>", "Errors-To": "dev-bounces@dpdk.org" }, "content": "Inline assembly is not supported for MSVC x64 instead use __cpuid\nand __cpuidex intrinsics.\n\nSigned-off-by: Tyler Retzlaff <roretzla@linux.microsoft.com>\nAcked-by: Morten Brørup <mb@smartsharesystems.com>\n---\n lib/eal/x86/rte_cpuflags.c | 6 +++++-\n lib/eal/x86/rte_cpuid.h | 7 +++++++\n lib/eal/x86/rte_cycles.c | 36 ++++++++++++++++++++++++++++++++++++\n lib/eal/x86/rte_hypervisor.c | 4 ++++\n 4 files changed, 52 insertions(+), 1 deletion(-)", "diff": "diff --git a/lib/eal/x86/rte_cpuflags.c b/lib/eal/x86/rte_cpuflags.c\nindex d6b5182..8a30f79 100644\n--- a/lib/eal/x86/rte_cpuflags.c\n+++ b/lib/eal/x86/rte_cpuflags.c\n@@ -165,9 +165,13 @@ struct feature_entry {\n \tif (maxleaf < feat->leaf)\n \t\treturn 0;\n \n-\t __cpuid_count(feat->leaf, feat->subleaf,\n+#ifdef RTE_TOOLCHAIN_MSVC\n+\t__cpuidex(regs, feat->leaf, feat->subleaf);\n+#else\n+\t__cpuid_count(feat->leaf, feat->subleaf,\n \t\t\t regs[RTE_REG_EAX], regs[RTE_REG_EBX],\n \t\t\t regs[RTE_REG_ECX], regs[RTE_REG_EDX]);\n+#endif\n \n \t/* check if the feature is enabled */\n \treturn (regs[feat->reg] >> feat->bit) & 1;\ndiff --git a/lib/eal/x86/rte_cpuid.h b/lib/eal/x86/rte_cpuid.h\nindex b773ad9..c6abaad 100644\n--- a/lib/eal/x86/rte_cpuid.h\n+++ b/lib/eal/x86/rte_cpuid.h\n@@ -5,7 +5,9 @@\n #ifndef RTE_CPUID_H\n #define RTE_CPUID_H\n \n+#ifndef RTE_TOOLCHAIN_MSVC\n #include <cpuid.h>\n+#endif\n \n enum cpu_register_t {\n \tRTE_REG_EAX = 0,\n@@ -16,4 +18,9 @@ enum cpu_register_t {\n \n typedef uint32_t cpuid_registers_t[4];\n \n+#ifdef RTE_TOOLCHAIN_MSVC\n+int\n+__get_cpuid_max(unsigned int e, unsigned int *s);\n+#endif\n+\n #endif /* RTE_CPUID_H */\ndiff --git a/lib/eal/x86/rte_cycles.c b/lib/eal/x86/rte_cycles.c\nindex 0e695ca..69ed59b 100644\n--- a/lib/eal/x86/rte_cycles.c\n+++ b/lib/eal/x86/rte_cycles.c\n@@ -4,7 +4,11 @@\n \n #include <fcntl.h>\n #include <unistd.h>\n+#ifdef RTE_TOOLCHAIN_MSVC\n+#define bit_AVX (1 << 28)\n+#else\n #include <cpuid.h>\n+#endif\n \n \n #include \"eal_private.h\"\n@@ -82,9 +86,25 @@\n \treturn 0;\n }\n \n+#ifdef RTE_TOOLCHAIN_MSVC\n+int\n+__get_cpuid_max(unsigned int e, unsigned int *s)\n+{\n+\tuint32_t cpuinfo[4];\n+\n+\t__cpuid(cpuinfo, e);\n+\tif (s)\n+\t\t*s = cpuinfo[1];\n+\treturn cpuinfo[0];\n+}\n+#endif\n+\n uint64_t\n get_tsc_freq_arch(void)\n {\n+#ifdef RTE_TOOLCHAIN_MSVC\n+\tint cpuinfo[4];\n+#endif\n \tuint64_t tsc_hz = 0;\n \tuint32_t a, b, c, d, maxleaf;\n \tuint8_t mult, model;\n@@ -97,14 +117,30 @@\n \tmaxleaf = __get_cpuid_max(0, NULL);\n \n \tif (maxleaf >= 0x15) {\n+#ifdef RTE_TOOLCHAIN_MSVC\n+\t\t__cpuid(cpuinfo, 0x15);\n+\t\ta = cpuinfo[0];\n+\t\tb = cpuinfo[1];\n+\t\tc = cpuinfo[2];\n+\t\td = cpuinfo[3];\n+#else\n \t\t__cpuid(0x15, a, b, c, d);\n+#endif\n \n \t\t/* EBX : TSC/Crystal ratio, ECX : Crystal Hz */\n \t\tif (b && c)\n \t\t\treturn c * (b / a);\n \t}\n \n+#ifdef RTE_TOOLCHAIN_MSVC\n+\t__cpuid(cpuinfo, 0x1);\n+\ta = cpuinfo[0];\n+\tb = cpuinfo[1];\n+\tc = cpuinfo[2];\n+\td = cpuinfo[3];\n+#else\n \t__cpuid(0x1, a, b, c, d);\n+#endif\n \tmodel = rte_cpu_get_model(a);\n \n \tif (check_model_wsm_nhm(model))\ndiff --git a/lib/eal/x86/rte_hypervisor.c b/lib/eal/x86/rte_hypervisor.c\nindex c38cfc0..04fe767 100644\n--- a/lib/eal/x86/rte_hypervisor.c\n+++ b/lib/eal/x86/rte_hypervisor.c\n@@ -23,9 +23,13 @@ enum rte_hypervisor\n \tif (!rte_cpu_get_flag_enabled(RTE_CPUFLAG_HYPERVISOR))\n \t\treturn RTE_HYPERVISOR_NONE;\n \n+#ifdef RTE_TOOLCHAIN_MSVC\n+\t__cpuid(regs, HYPERVISOR_INFO_LEAF);\n+#else\n \t__cpuid(HYPERVISOR_INFO_LEAF,\n \t\t\tregs[RTE_REG_EAX], regs[RTE_REG_EBX],\n \t\t\tregs[RTE_REG_ECX], regs[RTE_REG_EDX]);\n+#endif\n \tfor (reg = 1; reg < 4; reg++)\n \t\tmemcpy(name + (reg - 1) * 4, ®s[reg], 4);\n \tname[12] = '\\0';\n", "prefixes": [ "v11", "04/16" ] }{ "id": 130196, "url": "