[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 05/26] i386/cpu: Expose AVX_VNNI instruction to guest
From: |
Paolo Bonzini |
Subject: |
[PULL 05/26] i386/cpu: Expose AVX_VNNI instruction to guest |
Date: |
Thu, 20 May 2021 10:22:36 +0200 |
From: Yang Zhong <yang.zhong@intel.com>
Expose AVX (VEX-encoded) versions of the Vector Neural Network
Instructions to guest.
The bit definition:
CPUID.(EAX=7,ECX=1):EAX[bit 4] AVX_VNNI
The following instructions are available when this feature is
present in the guest.
1. VPDPBUS: Multiply and Add Unsigned and Signed Bytes
2. VPDPBUSDS: Multiply and Add Unsigned and Signed Bytes with Saturation
3. VPDPWSSD: Multiply and Add Signed Word Integers
4. VPDPWSSDS: Multiply and Add Signed Integers with Saturation
As for the kvm related code, please reference Linux commit id 1085a6b585d7.
The release document ref below link:
https://software.intel.com/content/www/us/en/develop/download/\
intel-architecture-instruction-set-extensions-programming-reference.html
Signed-off-by: Yang Zhong <yang.zhong@intel.com>
Message-Id: <20210407015609.22936-1-yang.zhong@intel.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
target/i386/cpu.c | 4 ++--
target/i386/cpu.h | 2 ++
2 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/target/i386/cpu.c b/target/i386/cpu.c
index c496bfa1c2..9e211ac2ce 100644
--- a/target/i386/cpu.c
+++ b/target/i386/cpu.c
@@ -940,7 +940,7 @@ FeatureWordInfo feature_word_info[FEATURE_WORDS] = {
.type = CPUID_FEATURE_WORD,
.feat_names = {
NULL, NULL, NULL, NULL,
- NULL, "avx512-bf16", NULL, NULL,
+ "avx-vnni", "avx512-bf16", NULL, NULL,
NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL,
@@ -3194,7 +3194,7 @@ static X86CPUDefinition builtin_x86_defs[] = {
MSR_ARCH_CAP_SKIP_L1DFL_VMENTRY | MSR_ARCH_CAP_MDS_NO |
MSR_ARCH_CAP_PSCHANGE_MC_NO | MSR_ARCH_CAP_TAA_NO,
.features[FEAT_7_1_EAX] =
- CPUID_7_1_EAX_AVX512_BF16,
+ CPUID_7_1_EAX_AVX_VNNI | CPUID_7_1_EAX_AVX512_BF16,
/*
* Missing: XSAVES (not supported by some Linux versions,
* including v4.1 to v4.12).
diff --git a/target/i386/cpu.h b/target/i386/cpu.h
index 324ef92beb..d4e80e1344 100644
--- a/target/i386/cpu.h
+++ b/target/i386/cpu.h
@@ -817,6 +817,8 @@ typedef uint64_t FeatureWordArray[FEATURE_WORDS];
/* Speculative Store Bypass Disable */
#define CPUID_7_0_EDX_SPEC_CTRL_SSBD (1U << 31)
+/* AVX VNNI Instruction */
+#define CPUID_7_1_EAX_AVX_VNNI (1U << 4)
/* AVX512 BFloat16 Instruction */
#define CPUID_7_1_EAX_AVX512_BF16 (1U << 5)
--
2.31.1
- [PULL 00/26] Misc patches for 2021-05-20, Paolo Bonzini, 2021/05/20
- [PULL 03/26] configure: simplify assignment to GIT_SUBMODULES, Paolo Bonzini, 2021/05/20
- [PULL 01/26] configure: Only clone softfloat-3 repositories if TCG is enabled, Paolo Bonzini, 2021/05/20
- [PULL 14/26] KVM: Provide helper to sync dirty bitmap from slot to ramblock, Paolo Bonzini, 2021/05/20
- [PULL 04/26] hw/mem/nvdimm: Use Kconfig 'imply' instead of 'depends on', Paolo Bonzini, 2021/05/20
- [PULL 12/26] KVM: Create the KVMSlot dirty bitmap on flag changes, Paolo Bonzini, 2021/05/20
- [PULL 02/26] configure: check for submodules if --with-git-submodules=ignore, Paolo Bonzini, 2021/05/20
- [PULL 07/26] object: add more commands to preconfig mode, Paolo Bonzini, 2021/05/20
- [PULL 05/26] i386/cpu: Expose AVX_VNNI instruction to guest,
Paolo Bonzini <=
- [PULL 21/26] meson: Set implicit_include_directories to false, Paolo Bonzini, 2021/05/20
- [PULL 20/26] tests/qtest/fuzz: Fix build failure, Paolo Bonzini, 2021/05/20
- [PULL 08/26] qtest: add a QOM object for qtest, Paolo Bonzini, 2021/05/20
- [PULL 15/26] KVM: Simplify dirty log sync in kvm_set_phys_mem, Paolo Bonzini, 2021/05/20
- [PULL 19/26] KVM: Dirty ring support, Paolo Bonzini, 2021/05/20
- [PULL 09/26] KVM: do not allow setting properties at runtime, Paolo Bonzini, 2021/05/20
- [PULL 18/26] KVM: Disable manual dirty log when dirty ring enabled, Paolo Bonzini, 2021/05/20
- [PULL 06/26] meson: bump submodule to 0.57.2, Paolo Bonzini, 2021/05/20
- [PULL 22/26] remove qemu-options* from root directory, Paolo Bonzini, 2021/05/20
- [PULL 16/26] KVM: Cache kvm slot dirty bitmap size, Paolo Bonzini, 2021/05/20