From: Yang Zhong <yang.zhong@intel.com>
To: pbonzini@redhat.com
Cc: yang.zhong@intel.com, qemu-devel@nongnu.org
Subject: Re: [PATCH 1/1] i386/cpu: Expose AVX_VNNI instruction to guset
Date: Tue, 9 Mar 2021 13:16:58 +0800 [thread overview]
Message-ID: <20210309051658.GA19509@yangzhon-Virtual> (raw)
In-Reply-To: <20210301051552.84828-2-yang.zhong@intel.com>
Paolo, please help review this patch when you are not busy.
The related kernel patch has been merged by you last time, thanks!
Regards,
Yang
On Mon, Mar 01, 2021 at 01:15:52PM +0800, Yang Zhong wrote:
> 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
>
> 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>
> ---
> 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 6a53446e6a..55545d8692 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,
> @@ -3273,7 +3273,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 8be39cfb62..ef5f145626 100644
> --- a/target/i386/cpu.h
> +++ b/target/i386/cpu.h
> @@ -803,6 +803,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.29.2.334.gfaefdd61ec
prev parent reply other threads:[~2021-03-09 5:31 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-03-01 5:15 [PATCH 0/1] Expose AVX_VNNI instruction to guset Yang Zhong
2021-03-01 5:15 ` [PATCH 1/1] i386/cpu: " Yang Zhong
2021-03-09 5:16 ` Yang Zhong [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20210309051658.GA19509@yangzhon-Virtual \
--to=yang.zhong@intel.com \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).