qemu-kvm/kvm-i386-cpu-Expose-AVX_VNNI-instruction-to-guest.patch
Miroslav Rezanina b7fbd568b2 * Fri Aug 20 2021 Miroslav Rezanina <mrezanin@redhat.com> - 6.0.0-12.el9
- kvm-migration-Move-yank-outside-qemu_start_incoming_migr.patch [bz#1974683]
- kvm-migration-Allow-reset-of-postcopy_recover_triggered-.patch [bz#1974683]
- kvm-Remove-RHEL-7.0.0-machine-type.patch [bz#1968519]
- kvm-Remove-RHEL-7.1.0-machine-type.patch [bz#1968519]
- kvm-Remove-RHEL-7.2.0-machine-type.patch [bz#1968519]
- kvm-Remove-RHEL-7.3.0-machine-types.patch [bz#1968519]
- kvm-Remove-RHEL-7.4.0-machine-types.patch [bz#1968519]
- kvm-Remove-RHEL-7.5.0-machine-types.patch [bz#1968519]
- kvm-acpi-pc-revert-back-to-v5.2-PCI-slot-enumeration.patch [bz#1957194]
- kvm-migration-failover-reset-partially_hotplugged.patch [bz#1957194]
- kvm-hmp-Fix-loadvm-to-resume-the-VM-on-success-instead-o.patch [bz#1957194]
- kvm-migration-Move-bitmap_mutex-out-of-migration_bitmap_.patch [bz#1957194]
- kvm-i386-cpu-Expose-AVX_VNNI-instruction-to-guest.patch [bz#1957194]
- kvm-ratelimit-protect-with-a-mutex.patch [bz#1957194]
- kvm-Update-Linux-headers-to-5.13-rc4.patch [bz#1957194]
- kvm-i386-Add-ratelimit-for-bus-locks-acquired-in-guest.patch [bz#1957194]
- kvm-iothread-generalize-iothread_set_param-iothread_get_.patch [bz#1957194]
- kvm-iothread-add-aio-max-batch-parameter.patch [bz#1957194]
- kvm-linux-aio-limit-the-batch-size-using-aio-max-batch-p.patch [bz#1957194]
- kvm-block-nvme-Fix-VFIO_MAP_DMA-failed-No-space-left-on-.patch [bz#1957194]
- kvm-migration-move-wait-unplug-loop-to-its-own-function.patch [bz#1957194]
- kvm-migration-failover-continue-to-wait-card-unplug-on-e.patch [bz#1957194]
- kvm-aarch64-Add-USB-storage-devices.patch [bz#1957194]
- kvm-iotests-Improve-and-rename-test-291-to-qemu-img-bitm.patch [bz#1957194]
- kvm-qemu-img-Fail-fast-on-convert-bitmaps-with-inconsist.patch [bz#1957194]
- kvm-qemu-img-Add-skip-broken-bitmaps-for-convert-bitmaps.patch [bz#1957194]
- kvm-audio-Never-send-migration-section.patch [bz#1957194]
- kvm-pc-bios-s390-ccw-bootmap-Silence-compiler-warning-fr.patch [bz#1939509 bz#1940132]
- kvm-pc-bios-s390-ccw-Use-reset_psw-pointer-instead-of-ha.patch [bz#1939509 bz#1940132]
- kvm-pc-bios-s390-ccw-netboot-Use-Wl-prefix-to-pass-param.patch [bz#1939509 bz#1940132]
- kvm-pc-bios-s390-ccw-Silence-warning-from-Clang-by-marki.patch [bz#1939509 bz#1940132]
- kvm-pc-bios-s390-ccw-Fix-the-cc-option-macro-in-the-Make.patch [bz#1939509 bz#1940132]
- kvm-pc-bios-s390-ccw-Silence-GCC-11-stringop-overflow-wa.patch [bz#1939509 bz#1940132]
- kvm-pc-bios-s390-ccw-Allow-building-with-Clang-too.patch [bz#1939509 bz#1940132]
- kvm-pc-bios-s390-ccw-Fix-inline-assembly-for-older-versi.patch [bz#1939509 bz#1940132]
- kvm-configure-Fix-endianess-test-with-LTO.patch [bz#1939509 bz#1940132]
- kvm-spec-Switch-toolchain-to-Clang-LLVM.patch [bz#1939509 bz#1940132]
- kvm-spec-Use-safe-stack-for-x86_64.patch [bz#1939509 bz#1940132]
- kvm-spec-Reenable-write-support-for-VMDK-etc.-in-tools.patch [bz#1989841]
- Resolves: bz#1974683
  (Fail to set migrate incoming for 2nd time after the first time failed)
- Resolves: bz#1968519
  (Remove all the old 7.0-7.5 machine types)
- Resolves: bz#1957194
  (Synchronize RHEL-AV 8.5.0 changes to RHEL 9.0.0 Beta)
- Resolves: bz#1939509
  (QEMU: enable SafeStack)
- Resolves: bz#1940132
  (QEMU: switch build toolchain to Clang/LLVM)
- Resolves: bz#1989841
  (RFE: qemu-img cannot convert images into vmdk and vpc formats)
2021-08-20 06:50:35 -04:00

83 lines
3.2 KiB
Diff

From c24fcdf0712ef81ec25ca3a4a1144cca18303fbe Mon Sep 17 00:00:00 2001
From: "plai@redhat.com" <plai@redhat.com>
Date: Thu, 29 Jul 2021 07:42:19 -0400
Subject: [PATCH 13/39] i386/cpu: Expose AVX_VNNI instruction to guest
RH-Author: Miroslav Rezanina <mrezanin@redhat.com>
RH-MergeRequest: 32: Synchronize with RHEL-AV 8.5 release 27 to RHEL 9
RH-Commit: [5/15] 56381e35a1dc06af7d457d1fe61b1c108dd25d06 (mrezanin/centos-src-qemu-kvm)
RH-Bugzilla: 1957194
RH-Acked-by: Stefano Garzarella <sgarzare@redhat.com>
RH-Acked-by: Kevin Wolf <kwolf@redhat.com>
RH-Acked-by: Igor Mammedov <imammedo@redhat.com>
RH-Acked-by: Andrew Jones <drjones@redhat.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>
(cherry picked from commit c1826ea6a052084f2e6a0bae9dd5932a727df039)
Signed-off-by: Paul Lai <plai@redhat.com>
Signed-off-by: Miroslav Rezanina <mrezanin@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 da47c3e50e..0de2932c79 100644
--- a/target/i386/cpu.c
+++ b/target/i386/cpu.c
@@ -996,7 +996,7 @@ static 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,
@@ -3284,7 +3284,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,
/* XSAVES is added in version 2 */
.features[FEAT_XSAVE] =
CPUID_XSAVE_XSAVEOPT | CPUID_XSAVE_XSAVEC |
diff --git a/target/i386/cpu.h b/target/i386/cpu.h
index 570f916878..edc8984448 100644
--- a/target/i386/cpu.h
+++ b/target/i386/cpu.h
@@ -804,6 +804,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.27.0