From patchwork Wed Jun 28 01:07:23 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: 9813359 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 A8489603F3 for ; Wed, 28 Jun 2017 01:10:06 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 986982521E for ; Wed, 28 Jun 2017 01:10:06 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8C75428210; Wed, 28 Jun 2017 01:10:06 +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 D3E7B2823E for ; Wed, 28 Jun 2017 01:10:05 +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 1dQ1SF-0004Xz-E3; Wed, 28 Jun 2017 01:07:39 +0000 Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dQ1SD-0004Xp-P2 for xen-devel@lists.xen.org; Wed, 28 Jun 2017 01:07:37 +0000 Received: from [85.158.137.68] by server-8.bemta-3.messagelabs.com id 3C/4B-23755-85103595; Wed, 28 Jun 2017 01:07:36 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrGIsWRWlGSWpSXmKPExsXilM8iqxvBGBx psLJDwmLJx8UsDoweR3f/ZgpgjGLNzEvKr0hgzdh15ChjwQnLikuXnzM1ML7R6mLk4hASWMUo MWtPD1sXIyeQky2x+MQzMJtFYBKrxKIVkiC2hICnxN4l71ghbGeJ5i03WSGaDzFKzOg9zQiSY BMIlWjfPgOsSERAWuLa58uMIEXMAnOBijZ8BJsqLGApse/Te3aIDaoSlx4uYwKxeQX8JT59es ACsUFO4ua5TmYQm1MgQGLb4r3sENf5S6w4tIgdol5Q4uTMJ0D1HEAL1CXWzxMCCfMLKElsW38 Z7B5mAXmJ5q2zmScwCs9C0jELoWMWkqoFjMyrGDWKU4vKUot0DS31kooy0zNKchMzc3QNDYz1 clOLixPTU3MSk4r1kvNzNzECw7yegYFxB+Pv436HGCU5mJREefd+CYoU4kvKT6nMSCzOiC8qz UktPsQow8GhJMGbyhAcKSRYlJqeWpGWmQOMOJi0BAePkgiv31WgVt7igsTc4sx0iNQpRl2Oa2 93fWESYsnLz0uVEue1ApkhAFKUUZoHNwIW/ZcYZaWEeRkZGBiEeApSi3IzS1DlXzGKczAqCfM a/AdaxZOZVwK36RXQEUxAR7DMCwA5oiQRISXVwJiiwBo8Lzl3q2H8zjt7g2xTGNI/brnfGfHy Tyj/M/WdXyMzGKdO0OWtPPf6y6+HAbeT/qx77C/2VZIjecJOjv9bzDkP/A89GMzSkp/XdrJSc u1HrqfGevqTFog5Hp9jcGbv74XPlgs2e2qyXdqvcj14DQO/Sy/HAfVrCje+9xoolyZ+PKllfU eJpTgj0VCLuag4EQCqGjQq+QIAAA== X-Env-Sender: marmarek@invisiblethingslab.com X-Msg-Ref: server-14.tower-31.messagelabs.com!1498612055!107520998!1 X-Originating-IP: [66.111.4.29] X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: VHJ1c3RlZCBJUDogNjYuMTExLjQuMjkgPT4gNjQ0MA==\n X-StarScan-Received: X-StarScan-Version: 9.4.19; banners=-,-,- X-VirusChecked: Checked Received: (qmail 15190 invoked from network); 28 Jun 2017 01:07:36 -0000 Received: from out5-smtp.messagingengine.com (HELO out5-smtp.messagingengine.com) (66.111.4.29) by server-14.tower-31.messagelabs.com with DHE-RSA-AES256-GCM-SHA384 encrypted SMTP; 28 Jun 2017 01:07:36 -0000 Received: from compute7.internal (compute7.nyi.internal [10.202.2.47]) by mailout.nyi.internal (Postfix) with ESMTP id 39E1120905; Tue, 27 Jun 2017 21:07:35 -0400 (EDT) Received: from frontend2 ([10.202.2.161]) by compute7.internal (MEProxy); Tue, 27 Jun 2017 21:07:35 -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:message-id:mime-version:references :subject:to:x-me-sender:x-me-sender:x-sasl-enc:x-sasl-enc; s= fm1; bh=5k8rpNlQm4eQ1rcDv4c7PIE7jMbZTLwUaS31FMTxo9k=; b=ljWAnlQq i5ns+aVT/HHX6kRBVDUXRHNQ1QddL85VcrQvn+x8gkiNbGdN7LIuS3Iyny1PYk83 6NFLl57ILETOVGz2C+QornFWdHKYjSAZZFGW9iLio6EvCMW8zlmgyGVOLBGQ2AxX sjlTK5Nnlh1SfJFwmkYi1IAyuKQheObCtSsdCotM0HRbP324xpU06jHZ5/pLk6Iq EvWeJhrGz9M1qtwAr/9bU1diQrDEbIR3xYa3ZeQ7ko69/lml2upYw1wlaIrXCYC+ GW5Q+caGhDOVC9FlgN5CPMjE97Re3+A0386WQTERfGJvE1NdQg2hToFe42zMM6ie +mIKuu8e1hww2w== X-ME-Sender: X-Sasl-enc: wLn71Bpy61yllaVnsB/IJXd8tc8Sn1XfeZHCl1cKbrjc 1498612054 Received: from devel-3rdparty.localdomain (89-70-103-23.dynamic.chello.pl [89.70.103.23]) by mail.messagingengine.com (Postfix) with ESMTPA id 42274242CE; Tue, 27 Jun 2017 21:07:34 -0400 (EDT) From: =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= To: xen-devel@lists.xen.org Date: Wed, 28 Jun 2017 03:07:23 +0200 Message-Id: <1498612044-14114-2-git-send-email-marmarek@invisiblethingslab.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1498612044-14114-1-git-send-email-marmarek@invisiblethingslab.com> References: <1498612044-14114-1-git-send-email-marmarek@invisiblethingslab.com> MIME-Version: 1.0 Organization: Invisible Things Lab Cc: Wei Liu , Ian Jackson , =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= Subject: [Xen-devel] [PATCH 1/2] 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 | 20 ++++++++++++-------- tools/libxl/libxl_cpuid.c | 37 +++++++++++++++++++++++++++++++++++++ 2 files changed, 49 insertions(+), 8 deletions(-) diff --git a/docs/man/xl.cfg.pod.5.in b/docs/man/xl.cfg.pod.5.in index 38084c7..51361c4 100644 --- a/docs/man/xl.cfg.pod.5.in +++ b/docs/man/xl.cfg.pod.5.in @@ -1464,14 +1464,18 @@ 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 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 +skinit smap smep 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 tsc-deadline tsc_adjust 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..1cf7973 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,38 @@ 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, NA, CPUID_REG_EBX, 31, 1}, + {"avx512bw", 0x00000007, NA, CPUID_REG_EBX, 30, 1}, + {"avx512cd", 0x00000007, NA, CPUID_REG_EBX, 28, 1}, + {"avx512er", 0x00000007, NA, CPUID_REG_EBX, 27, 1}, + {"avx512pf", 0x00000007, NA, CPUID_REG_EBX, 26, 1}, + {"clflushopt", 0x00000007, NA, CPUID_REG_EBX, 23, 1}, + {"avx512ifma", 0x00000007, NA, CPUID_REG_EBX, 21, 1}, + {"smap", 0x00000007, NA, CPUID_REG_EBX, 20, 1}, + {"adx", 0x00000007, NA, CPUID_REG_EBX, 19, 1}, + {"rdseed", 0x00000007, NA, CPUID_REG_EBX, 18, 1}, + {"avx512dq", 0x00000007, NA, CPUID_REG_EBX, 17, 1}, + {"avx512f", 0x00000007, NA, CPUID_REG_EBX, 16, 1}, + {"mpx", 0x00000007, NA, CPUID_REG_EBX, 14, 1}, + {"cmt", 0x00000007, NA, CPUID_REG_EBX, 12, 1}, + {"rtm", 0x00000007, NA, CPUID_REG_EBX, 11, 1}, + {"invpcid", 0x00000007, NA, CPUID_REG_EBX, 10, 1}, + {"erms", 0x00000007, NA, CPUID_REG_EBX, 9, 1}, + {"bmi2", 0x00000007, NA, CPUID_REG_EBX, 8, 1}, + {"smep", 0x00000007, NA, CPUID_REG_EBX, 7, 1}, + {"avx2", 0x00000007, NA, CPUID_REG_EBX, 5, 1}, + {"hle", 0x00000007, NA, CPUID_REG_EBX, 4, 1}, + {"bmi1", 0x00000007, NA, CPUID_REG_EBX, 3, 1}, + {"tsc_adjust", 0x00000007, NA, CPUID_REG_EBX, 1, 1}, + {"fsgsbase", 0x00000007, NA, CPUID_REG_EBX, 0, 1}, + {"ospke", 0x00000007, NA, CPUID_REG_ECX, 4, 1}, + {"pku", 0x00000007, NA, CPUID_REG_ECX, 3, 1}, + {"avx512vbmi", 0x00000007, NA, CPUID_REG_ECX, 1, 1}, + {"avx512-4fmaps",0x00000007, NA, CPUID_REG_EDX, 3, 1}, + {"avx512-4vnniw",0x00000007, NA, 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 +223,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},