From patchwork Fri Jun 30 13:16:56 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Marek_Marczykowski-G=C3=B3recki?= X-Patchwork-Id: 9819581 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 643C5603F2 for ; Fri, 30 Jun 2017 13:19:55 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 51F8D28472 for ; Fri, 30 Jun 2017 13:19:55 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 464E128651; Fri, 30 Jun 2017 13:19:55 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.1 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id A5B2428472 for ; Fri, 30 Jun 2017 13:19:54 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dQvna-0000vI-D9; Fri, 30 Jun 2017 13:17:26 +0000 Received: from mail6.bemta5.messagelabs.com ([195.245.231.135]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dQvnX-0000uE-Fc for xen-devel@lists.xen.org; Fri, 30 Jun 2017 13:17:23 +0000 Received: from [85.158.139.211] by server-15.bemta-5.messagelabs.com id DB/CA-01736-16F46595; Fri, 30 Jun 2017 13:17:21 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFvrDIsWRWlGSWpSXmKPExsXilM8iqZvoHxZ pcNzRYsnHxSwOjB5Hd/9mCmCMYs3MS8qvSGDN2PbyBGPBbuuKh6vfszQwftLuYuTkEBJYxSjx cFMIhJ0tsaNzGVMXIxcHi8BKVonH316xgiQkBDwlzu08B2U7S/Tv/cQIUiQkcIhR4nr/FiaQB JtAqET79hlgRSIC0hLXPl8GK2IWOMkocevHC7AiYQEbifcH/rN1MXIArVCVeL1aFyTMK5AjsX DVc3aIBXIS+141MILYnALFEpeW3GOFuK5I4uSSxUwQ9YISJ2c+YcGthgNor7rE+nlCIGFmAXm J5q2zmScwisxC0j0LoWoWkqoFjMyrGDWKU4vKUot0jUz1kooy0zNKchMzc3QNDUz1clOLixPT U3MSk4r1kvNzNzECQ7+egYFxB+Oudr9DjJIcTEqivCuvhUYK8SXlp1RmJBZnxBeV5qQWH2KU4 eBQkuC97BsWKSRYlJqeWpGWmQOMQpi0BAePkgjvXg+gNG9xQWJucWY6ROoUoyXHtbe7vjBxHJ vx8xsTx6qZQFKIJS8/L1VKnPcXyDwBkIaM0jy4cbBEcYlRVkqYl5GBgUGIpyC1KDezBFX+FaM 4B6OSMO8ykCk8mXklcFtfAR3EBHSQ8IwQkINKEhFSUg2MU+4+Pt93l8Vmfe3t76GnitxvFa/J YarTkM38s3XR+23hph4lF6fGXvSWtBK+xO/D+WNyHm+h+u9LUhksEfuvmWrkffnM69v/32fHv zcMH8OaxGXapO5f8FP14AizkD7H2XKDZ6PrbtOjyiLn1+3r/TKztMjUxifd+U2Xt8f1zFfm23 7OWRmnxFKckWioxVxUnAgAwiW5fw8DAAA= X-Env-Sender: marmarek@invisiblethingslab.com X-Msg-Ref: server-4.tower-206.messagelabs.com!1498828639!100811757!1 X-Originating-IP: [66.111.4.25] X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: VHJ1c3RlZCBJUDogNjYuMTExLjQuMjUgPT4gNDQ5ODE=\n X-StarScan-Received: X-StarScan-Version: 9.4.25; banners=-,-,- X-VirusChecked: Checked Received: (qmail 39749 invoked from network); 30 Jun 2017 13:17:20 -0000 Received: from out1-smtp.messagingengine.com (HELO out1-smtp.messagingengine.com) (66.111.4.25) by server-4.tower-206.messagelabs.com with DHE-RSA-AES256-GCM-SHA384 encrypted SMTP; 30 Jun 2017 13:17:20 -0000 Received: from compute7.internal (compute7.nyi.internal [10.202.2.47]) by mailout.nyi.internal (Postfix) with ESMTP id C03DF20B2B; Fri, 30 Jun 2017 09:17:19 -0400 (EDT) Received: from frontend1 ([10.202.2.160]) by compute7.internal (MEProxy); Fri, 30 Jun 2017 09:17:19 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:in-reply-to:message-id:mime-version :references:references:subject:to:x-me-sender:x-me-sender :x-sasl-enc:x-sasl-enc; s=fm1; bh=FbdkkWhHGSwJZasa5pzGQ/vGHWxr9K njg4MxVUNayOc=; b=hl+vzJRpgC4iqLep0Mnh/MouqnWBrvwMGjJotbK80KvktP uaPm0YUOKthf6NZf8kThcUmCc+/l9JthyMa82de8Pl+RBX1oXRzDoDSTAFloSn8z ClIp9iesxaoLJwiUBmWP/qDE+AFJNMbGZE3OAMgL+kfQz+ELJUMU9vFclAkhQ8uG WKq4GRaTBShC7RFU0z2uMic8QYcGSZExH1p4dHDeI2tEkot5fG7Ko8kg1MmuPjAJ l5eexcKdkiKXMBW4sT/nP+aVK9uWWiLrCQMIIz1uF+dmpCWl4NEZT1VNKG2px3xH 41Qikagp0+WMymKW2eXVv15XFz9tklcH6oqvDfHA== X-ME-Sender: X-Sasl-enc: 5xnAGRifo7JQmf9fzrb8MgFE1yHcMF1n270z1vqqrW5D 1498828639 Received: from devel-3rdparty.localdomain (89-70-103-23.dynamic.chello.pl [89.70.103.23]) by mail.messagingengine.com (Postfix) with ESMTPA id AE8757E32F; Fri, 30 Jun 2017 09:17:18 -0400 (EDT) From: =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= To: xen-devel@lists.xen.org Date: Fri, 30 Jun 2017 15:16:56 +0200 Message-Id: X-Mailer: git-send-email 2.7.5 In-Reply-To: References: MIME-Version: 1.0 In-Reply-To: References: Cc: Wei Liu , Ian Jackson , =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= , Andrew Cooper Subject: [Xen-devel] [PATCH v3 1/4] libxl: add more cpuid flags handling X-BeenThere: xen-devel@lists.xen.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xen.org Sender: "Xen-devel" X-Virus-Scanned: ClamAV using ClamSMTP This is result of parsing cpu_map.xml from libvirt. The most important part is handling leaf 0x00000007, but while at it add other bits too. Signed-off-by: Marek Marczykowski-Górecki --- docs/man/xl.cfg.pod.5.in | 21 +++++++++++++-------- tools/libxl/libxl_cpuid.c | 40 ++++++++++++++++++++++++++++++++++++++++- 2 files changed, 53 insertions(+), 8 deletions(-) diff --git a/docs/man/xl.cfg.pod.5.in b/docs/man/xl.cfg.pod.5.in index 38084c7..ff32035 100644 --- a/docs/man/xl.cfg.pod.5.in +++ b/docs/man/xl.cfg.pod.5.in @@ -1464,14 +1464,19 @@ apicidsize brandid clflush family localapicid maxleaf maxhvleaf model nc proccount procpkg stepping List of keys taking a character: -3dnow 3dnowext 3dnowprefetch abm acpi aes altmovcr8 apic avx clfsh cmov -cmplegacy cmpxchg16 cmpxchg8 cntxid dca de ds dscpl dtes64 est extapic f16c -ffxsr fma4 fpu fxsr htt hypervisor ia64 ibs lahfsahf lm lwp mca mce misalignsse -mmx mmxext monitor movbe msr mtrr nodeid nx osvw osxsave pae page1gb pat pbe -pclmulqdq pdcm pge popcnt pse pse36 psn rdtscp skinit smx ss sse sse2 sse3 -sse4_1 sse4_2 sse4a ssse3 svm svm_decode svm_lbrv svm_npt svm_nrips -svm_pausefilt svm_tscrate svm_vmcbclean syscall sysenter tbm tm tm2 topoext tsc -vme vmx wdt x2apic xop xsave xtpr +3dnow 3dnowext 3dnowprefetch abm acpi adx aes altmovcr8 apic arat avx avx2 +avx512-4fmaps avx512-4vnniw avx512bw avx512cd avx512dq avx512er avx512f +avx512ifma avx512pf avx512vbmi avx512vl bmi1 bmi2 clflushopt clfsh clwb cmov +cmplegacy cmpxchg16 cmpxchg8 cmt cntxid dca de ds dscpl dtes64 erms est extapic +f16c ffxsr fma fma4 fpu fsgsbase fxsr hle htt hypervisor ia64 ibs invpcid +invtsc lahfsahf lm lwp mca mce misalignsse mmx mmxext monitor movbe mpx msr +mtrr nodeid nx ospke osvw osxsave pae page1gb pat pbe pcid pclmulqdq pdcm +perfctr_core perfctr_nb pge pku popcnt pse pse36 psn rdrand rdseed rdtscp rtm +sha skinit smap smep smx ss sse sse2 sse3 sse4.1 sse4.2 sse4_1 sse4_2 sse4a +ssse3 svm svm_decode svm_lbrv svm_npt svm_nrips svm_pausefilt svm_tscrate +svm_vmcbclean syscall sysenter tbm tm tm2 topoext tsc tsc-deadline tsc_adjust +umip vme vmx wdt x2apic xop xsave xtpr + The xend syntax is a list of values in the form of 'leafnum:register=bitstring,register=bitstring' diff --git a/tools/libxl/libxl_cpuid.c b/tools/libxl/libxl_cpuid.c index 24591e2..fda8bf6 100644 --- a/tools/libxl/libxl_cpuid.c +++ b/tools/libxl/libxl_cpuid.c @@ -100,11 +100,13 @@ int libxl_cpuid_parse_config(libxl_cpuid_policy_list *cpuid, const char* str) {"clflush", 0x00000001, NA, CPUID_REG_EBX, 8, 8}, {"brandid", 0x00000001, NA, CPUID_REG_EBX, 0, 8}, {"hypervisor", 0x00000001, NA, CPUID_REG_ECX, 31, 1}, + {"rdrand", 0x00000001, NA, CPUID_REG_ECX, 30, 1}, {"f16c", 0x00000001, NA, CPUID_REG_ECX, 29, 1}, {"avx", 0x00000001, NA, CPUID_REG_ECX, 28, 1}, {"osxsave", 0x00000001, NA, CPUID_REG_ECX, 27, 1}, {"xsave", 0x00000001, NA, CPUID_REG_ECX, 26, 1}, {"aes", 0x00000001, NA, CPUID_REG_ECX, 25, 1}, + {"tsc-deadline", 0x00000001, NA, CPUID_REG_ECX, 24, 1}, {"popcnt", 0x00000001, NA, CPUID_REG_ECX, 23, 1}, {"movbe", 0x00000001, NA, CPUID_REG_ECX, 22, 1}, {"x2apic", 0x00000001, NA, CPUID_REG_ECX, 21, 1}, @@ -114,9 +116,11 @@ int libxl_cpuid_parse_config(libxl_cpuid_policy_list *cpuid, const char* str) {"sse4.1", 0x00000001, NA, CPUID_REG_ECX, 19, 1}, {"sse4_1", 0x00000001, NA, CPUID_REG_ECX, 19, 1}, {"dca", 0x00000001, NA, CPUID_REG_ECX, 18, 1}, + {"pcid", 0x00000001, NA, CPUID_REG_ECX, 17, 1}, {"pdcm", 0x00000001, NA, CPUID_REG_ECX, 15, 1}, {"xtpr", 0x00000001, NA, CPUID_REG_ECX, 14, 1}, {"cmpxchg16", 0x00000001, NA, CPUID_REG_ECX, 13, 1}, + {"fma", 0x00000001, NA, CPUID_REG_ECX, 12, 1}, {"cntxid", 0x00000001, NA, CPUID_REG_ECX, 10, 1}, {"ssse3", 0x00000001, NA, CPUID_REG_ECX, 9, 1}, {"tm2", 0x00000001, NA, CPUID_REG_ECX, 8, 1}, @@ -158,6 +162,41 @@ int libxl_cpuid_parse_config(libxl_cpuid_policy_list *cpuid, const char* str) {"de", 0x00000001, NA, CPUID_REG_EDX, 2, 1}, {"vme", 0x00000001, NA, CPUID_REG_EDX, 1, 1}, {"fpu", 0x00000001, NA, CPUID_REG_EDX, 0, 1}, + {"arat", 0x00000006, NA, CPUID_REG_EAX, 2, 1}, + {"avx512vl", 0x00000007, 0, CPUID_REG_EBX, 31, 1}, + {"avx512bw", 0x00000007, 0, CPUID_REG_EBX, 30, 1}, + {"sha", 0x00000007, 0, CPUID_REG_EBX, 29, 1}, + {"avx512cd", 0x00000007, 0, CPUID_REG_EBX, 28, 1}, + {"avx512er", 0x00000007, 0, CPUID_REG_EBX, 27, 1}, + {"avx512pf", 0x00000007, 0, CPUID_REG_EBX, 26, 1}, + {"clwb", 0x00000007, 0, CPUID_REG_EBX, 24, 1}, + {"clflushopt", 0x00000007, 0, CPUID_REG_EBX, 23, 1}, + {"avx512ifma", 0x00000007, 0, CPUID_REG_EBX, 21, 1}, + {"smap", 0x00000007, 0, CPUID_REG_EBX, 20, 1}, + {"adx", 0x00000007, 0, CPUID_REG_EBX, 19, 1}, + {"rdseed", 0x00000007, 0, CPUID_REG_EBX, 18, 1}, + {"avx512dq", 0x00000007, 0, CPUID_REG_EBX, 17, 1}, + {"avx512f", 0x00000007, 0, CPUID_REG_EBX, 16, 1}, + {"mpx", 0x00000007, 0, CPUID_REG_EBX, 14, 1}, + {"cmt", 0x00000007, 0, CPUID_REG_EBX, 12, 1}, + {"rtm", 0x00000007, 0, CPUID_REG_EBX, 11, 1}, + {"invpcid", 0x00000007, 0, CPUID_REG_EBX, 10, 1}, + {"erms", 0x00000007, 0, CPUID_REG_EBX, 9, 1}, + {"bmi2", 0x00000007, 0, CPUID_REG_EBX, 8, 1}, + {"smep", 0x00000007, 0, CPUID_REG_EBX, 7, 1}, + {"avx2", 0x00000007, 0, CPUID_REG_EBX, 5, 1}, + {"hle", 0x00000007, 0, CPUID_REG_EBX, 4, 1}, + {"bmi1", 0x00000007, 0, CPUID_REG_EBX, 3, 1}, + {"tsc_adjust", 0x00000007, 0, CPUID_REG_EBX, 1, 1}, + {"fsgsbase", 0x00000007, 0, CPUID_REG_EBX, 0, 1}, + {"ospke", 0x00000007, 0, CPUID_REG_ECX, 4, 1}, + {"pku", 0x00000007, 0, CPUID_REG_ECX, 3, 1}, + {"umip", 0x00000007, 0, CPUID_REG_ECX, 2, 1}, + {"avx512vbmi", 0x00000007, 0, CPUID_REG_ECX, 1, 1}, + {"avx512-4fmaps",0x00000007, 0, CPUID_REG_EDX, 3, 1}, + {"avx512-4vnniw",0x00000007, 0, CPUID_REG_EDX, 2, 1}, + {"perfctr_nb", 0x80000001, NA, CPUID_REG_ECX, 24, 1}, + {"perfctr_core", 0x80000001, NA, CPUID_REG_ECX, 23, 1}, {"topoext", 0x80000001, NA, CPUID_REG_ECX, 22, 1}, {"tbm", 0x80000001, NA, CPUID_REG_ECX, 21, 1}, {"nodeid", 0x80000001, NA, CPUID_REG_ECX, 19, 1}, @@ -187,6 +226,7 @@ int libxl_cpuid_parse_config(libxl_cpuid_policy_list *cpuid, const char* str) {"nx", 0x80000001, NA, CPUID_REG_EDX, 20, 1}, {"syscall", 0x80000001, NA, CPUID_REG_EDX, 11, 1}, {"procpkg", 0x00000004, 0, CPUID_REG_EAX, 26, 6}, + {"invtsc", 0x80000007, NA, CPUID_REG_EDX, 8, 1}, {"apicidsize", 0x80000008, NA, CPUID_REG_ECX, 12, 4}, {"nc", 0x80000008, NA, CPUID_REG_ECX, 0, 8}, {"svm_npt", 0x8000000a, NA, CPUID_REG_EDX, 0, 1},