lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date:   Fri, 25 Nov 2022 20:58:37 +0800
From:   Jiaxi Chen <jiaxi.chen@...ux.intel.com>
To:     kvm@...r.kernel.org
Cc:     tglx@...utronix.de, mingo@...hat.com, bp@...en8.de,
        dave.hansen@...ux.intel.com, x86@...nel.org, hpa@...or.com,
        seanjc@...gle.com, pbonzini@...hat.com, ndesaulniers@...gle.com,
        alexandre.belloni@...tlin.com, peterz@...radead.org,
        jpoimboe@...nel.org, chang.seok.bae@...el.com,
        pawan.kumar.gupta@...ux.intel.com, babu.moger@....com,
        jmattson@...gle.com, sandipan.das@....com, tony.luck@...el.com,
        sathyanarayanan.kuppuswamy@...ux.intel.com, fenghua.yu@...el.com,
        keescook@...omium.org, nathan@...nel.org,
        linux-kernel@...r.kernel.org
Subject: [PATCH v5 0/8] x86: KVM: Advertise CPUID of new Intel platform instructions to user space

Latest Intel platform Granite Rapids/Sierra Forest has introduced below
new instructions and CPUIDs:

 - CMPccXADD CPUID.(EAX=7,ECX=1):EAX[bit 7]
 - AMX-FP16 CPUID.(EAX=7,ECX=1):EAX[bit 21]
 - AVX-IFMA CPUID.(EAX=7,ECX=1):EAX[bit 23]
 - AVX-VNNI-INT8 CPUID.(EAX=7,ECX=1):EDX[bit 4]
 - AVX-NE-CONVERT CPUID.(EAX=7,ECX=1):EDX[bit 5]
 - PREFETCHITI CPUID.(EAX=7,ECX=1):EDX[bit 14]

Details can be found in recent Intel ISE (Instruction Set
Extensions)[1].

These features bits are on two CPUID leafs: CPUID_7_1_EAX and
CPUID_7_1_EDX. CPUID_7_1_EAX is an expected-dense leaf and some of its
bits have kernel usages, therefore give bits on this leaf an X86_FEATURE
definition in kernel. However, CPUID_7_1_EDX is dense and none of its
bits have truly kernel usages for the moment. Given that, move
CPUID_7_1_EDX to be a KVM-only leaf and plus an x86_FEATURE definition
for bits on this leaf to direct them to the KVM entry.

This patch series advertises KVM support of these CPUIDs to host
userspace. For all of these features, there are no new VMX controls or
additional host enabling required for guests to use them.

[1] Intel ISE: https://cdrdv2.intel.com/v1/dl/getContent/671368

v5:
 - Modify some inaccurate descriptions in the changelogs.
 - Address some naming-confusing problems for adding KVM-only leaves,
   including renaming function and adding comments. 

v4:
https://lore.kernel.org/kvm/20221118141509.489359-1-jiaxi.chen@linux.intel.com/
 - Put CPUID_7_1_EAX back to cpuid_leaf[], considering more bits will be
   defined in the future for this leaf.

v3:
https://lore.kernel.org/kvm/20221110015252.202566-1-jiaxi.chen@linux.intel.com/
 - Remain CPUID_8000_001F_EAX in the last leaf of cpuid_leaf[]
 - Replace CPUID_7_1_EAX with CPUID_LNX_5, waiting for future new CPUIDs

v2:
https://lore.kernel.org/kvm/20221103025030.78371-1-jiaxi.chen@linux.intel.com/
 - Remove vague descriptions in the changelogs, including pronouns and
   "this patch" kind of things.
 - Move the two CPUIDs of cpuid_leaf[12] CPUID_7_1_EAX to KVM-only
   subleaves.
 - Replace cpuid_leaf[12] CPUID_7_1_EAX with the last leaf
   CPUID_8000_001F_EAX to shorten array length.
 - Change the newly-added CPUID leaf [CPUID_7_1_EDX] in v1 into KVM-only
   subleaves. 
 
v1:
https://lore.kernel.org/kvm/20221019084734.3590760-1-jiaxi.chen@linux.intel.com/

Chang S. Bae (1):
  x86: KVM: Advertise AMX-FP16 CPUID to user space

Jiaxi Chen (5):
  x86: KVM: Advertise CMPccXADD CPUID to user space
  x86: KVM: Advertise AVX-IFMA CPUID to user space
  KVM: x86: Advertise AVX-VNNI-INT8 CPUID to user space
  KVM: x86: Advertise AVX-NE-CONVERT CPUID to user space
  KVM: x86: Advertise PREFETCHIT0/1 CPUID to user space

Sean Christopherson (2):
  KVM: x86: Add BUILD_BUG_ON() to detect bad usage of "scattered" flags
  KVM: x86: Update KVM-only leaf handling to allow for 100% KVM-only
    leafs

 arch/x86/include/asm/cpufeatures.h |  3 +++
 arch/x86/kvm/cpuid.c               | 25 ++++++++++++++++++-------
 arch/x86/kvm/reverse_cpuid.h       | 25 ++++++++++++++++++++++---
 3 files changed, 43 insertions(+), 10 deletions(-)


base-commit: 094226ad94f471a9f19e8f8e7140a09c2625abaa
-- 
2.27.0

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ