From nobody Thu Jan 8 13:17:15 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1766829179; cv=none; d=zohomail.com; s=zohoarc; b=fibH/wXRuNw/N5CYuE9Sb1Yb7HghOqG8JSrr9hEdyagO6olK0p7HmLYTHmo6I7k9luvhNXQphYFOLJx6if8eILlUQhgjwfX1Z0KKUd8ospldErtHkd5t2rCMoXhkvbHfwSKtjl1fUmZUwqcbKHaVaFQNxE1Ca21XIBRpZ3x9Kw4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1766829179; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=n1F1HkDukR+wivvRioDvk1EBDQ43e9rqantGbZSklj4=; b=b0RfnsUvFbXXgcgt2/s3F/joByn3G2HtwMtJN3tCSRZYZugvQAiKmXjGrHHtGBEhDKq41/0y2+MMxYRomDVhjxRDFyoitAKdQCR26AALW/q68Kya4TCYctmdatDItCuapWYNaiES2DJW1UUlGFMIrdi9lWiSNZp5pavmXob2gAk= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1766829179476394.13588286884294; Sat, 27 Dec 2025 01:52:59 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vZQxE-0003ma-Gt; Sat, 27 Dec 2025 04:51:20 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vZQxD-0003il-5z for qemu-devel@nongnu.org; Sat, 27 Dec 2025 04:51:19 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vZQxB-0007TL-3I for qemu-devel@nongnu.org; Sat, 27 Dec 2025 04:51:18 -0500 Received: from mail-wr1-f71.google.com (mail-wr1-f71.google.com [209.85.221.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-626-ZyF5mJCHPNm8IuISKRz8yA-1; Sat, 27 Dec 2025 04:51:15 -0500 Received: by mail-wr1-f71.google.com with SMTP id ffacd0b85a97d-42fd46385c0so4267402f8f.0 for ; Sat, 27 Dec 2025 01:51:14 -0800 (PST) Received: from [192.168.10.48] ([151.95.145.106]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-47be395d9cfsm199760545e9.0.2025.12.27.01.51.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 27 Dec 2025 01:51:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1766829076; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=n1F1HkDukR+wivvRioDvk1EBDQ43e9rqantGbZSklj4=; b=YuVH4aRuupa6/yp6YHUkSn6GoSwJ+alDFXPgcdVB2SYfvObxMNQR97d5CJEKn2b52jHM7P xtgNwvNq8KteG8tQRswxTC3uo4kRuSgocUYe4R3FyItXgwS2JeIyyyDPQn3qTsTjHPrIBm kLFuo2UD6f0m5JO5Xuy6tlJvA20u/MA= X-MC-Unique: ZyF5mJCHPNm8IuISKRz8yA-1 X-Mimecast-MFC-AGG-ID: ZyF5mJCHPNm8IuISKRz8yA_1766829074 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=google; t=1766829073; x=1767433873; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=n1F1HkDukR+wivvRioDvk1EBDQ43e9rqantGbZSklj4=; b=FIa/Ds4c2ka0GjQrsooiBZxojGmOLjsAw2/dQx6R6jhYbSyNu+tnV/Ce8qUJ0cKWxY 9OalSGWNYfZHAiuGqaejYey1zQOVog77X0N2ej0SlnoRdbzAg08THDI1v0ahtdImNDD2 so+vGoUkDxW+nFbyrCcMHxRY5EIe8QNisUAsvTPBBFdAKF7YSmGRxKtumgNYQa/Y4vdA bM1IoxuFLmgVR4KUcTNUU/Vpx2Z5kYkvXwokQLBZUV+XcavXW6+k3tsM2Qv7cAXXmONT zqq4z3ryxA5HnqUwCLjpXHrnq1IIZUU4v9bzkrnr/4MdnngJF3lle58Vws8ib2GkYWWi ZkIw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1766829073; x=1767433873; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=n1F1HkDukR+wivvRioDvk1EBDQ43e9rqantGbZSklj4=; b=J70xc7ehO8xtc1P47zMdxD+WNaNiHZJMfLaB/HL64J1PyeoIkHcrzr6nl08Cic32nF ckv176eQ7TGoCQJzyTx3cQ4OYFxyL4PZraQsu+c2JVQd7y59AQPwtQxrjx9q1/L2gt+e aqgwEM1E7mCz+4T9a4WPuUfecuisgyld0mryaozPcNehWzaZgiDO6GalN7QOqbf+R8ea u3U7Fy0zZAg2ZF9oktQ81rwOHhaBVhNQVcdpqswN+w2typ3g3UD+PrzJu9eyQciUSBW7 GG4OkZ3HBKie26kcFPqqYsmKS8sFSAaRPlN723EeO3wEB06p0JmLrlyQfXZb2Eq4Epcj n7XA== X-Gm-Message-State: AOJu0YzDqLcSyCZrhSiCa2IIRCa8X7diaNlDUyo3XcY7MNZcpjflRHrY VAqGEZj0peusxOjgiH1zy5zSdBf8294Bndlv2l3eIDuXvyYd+aGSw3VMfjyV5MSE7XmITT4iI1N suUrbPtUhP1tnWq+oH2thdUxm1gupvr4fJd7Z22Qp0LeUKk5tcgo3JYSSe1xJPb+h6RF9LSLDr/ c7oxgTLxO6h5RfvIrEIp0SQQjP+LT13IytLuDDEWrP X-Gm-Gg: AY/fxX7c5wsmMArCpdxrhlv5HibUrMIfjg5vj6FHlPsToUoiv2gYotbqJrzXpG2HBOh OuAMuMMSF07u1f7YqkYRO4nHuYDcofkmw1N33HWqZlaGCIUvDs8NSyTwZv0v1Y2aWNOHmEN1+0e QiSt6GSAp48H9HN7sVGvOklCq+eEIaQsShvPvPasYGD8NyOdqb1Hsrecdv1NQfL0X+2GmwQYaax dVXgy4KAZhGmkXfQB424XSfymvigMoA5pgCdNrw8xK8kb4jInvBZ+YWbwywzAWwN08BuQeY2eHY S+R/Kcx0wtPoHTsPRn5hLZIfDTGGgUZ1EGiuYoxkZzO0o+8NUFjAJ1zGjQvQyw2s9dxpEoA4SUm qHWGcIps9qrnYwk1cvImLoip2Bd4d7aXVQmUybGoqWLFB8Z/sVy+jWvHErvrqnPz37wdtQsaP1C 75JYgivawE3XnnngY= X-Received: by 2002:a05:600c:35d1:b0:479:2f95:5179 with SMTP id 5b1f17b1804b1-47d1954a165mr326559955e9.15.1766829072671; Sat, 27 Dec 2025 01:51:12 -0800 (PST) X-Google-Smtp-Source: AGHT+IEgb70Q01MYg55cs9CHh+PyisjLCGWxvtQFRs+opIO9eqt6gTcv5fHqyezkFGRyMig0qYcDXg== X-Received: by 2002:a05:600c:35d1:b0:479:2f95:5179 with SMTP id 5b1f17b1804b1-47d1954a165mr326559615e9.15.1766829072216; Sat, 27 Dec 2025 01:51:12 -0800 (PST) From: Paolo Bonzini To: qemu-devel@nongnu.org Cc: Zhao Liu , Farrah Chen , Zide Chen , Xiaoyao Li , Xudong Hao Subject: [PULL 138/153] i386/cpu: Add support for AVX10_VNNI_INT in CPUID enumeration Date: Sat, 27 Dec 2025 10:47:43 +0100 Message-ID: <20251227094759.35658-64-pbonzini@redhat.com> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20251227091622.20725-1-pbonzini@redhat.com> References: <20251227091622.20725-1-pbonzini@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1766829181395158500 Content-Type: text/plain; charset="utf-8" From: Zhao Liu AVX10_VNNI_INT (0x24.0x1.ECX[bit 2]) is a discrete feature bit introduced on Intel Diamond Rapids, which enumerates the support for EVEX VPDP* instructions for INT8/INT16 [*]. Although Intel AVX10.2 has already included new VPDP* INT8/INT16 VNNI instructions, a bit - AVX10_VNNI_INT - is still be separated. Relevant new instructions can be checked by either CPUID AVX10.2 OR AVX10_VNNI_INT (e.g., VPDPBSSD). Support CPUID 0x24.0x1 subleaf with AVX10_VNNI_INT enumeration for Guest. [*]: Intel Advanced Vector Extensions 10.2 Architecture Specification (rev 5.0). Tested-by: Xudong Hao Signed-off-by: Zhao Liu Link: https://lore.kernel.org/r/20251215073743.4055227-4-zhao1.liu@intel.com Signed-off-by: Paolo Bonzini --- target/i386/cpu.h | 4 ++++ target/i386/cpu.c | 29 ++++++++++++++++++++++++++++- 2 files changed, 32 insertions(+), 1 deletion(-) diff --git a/target/i386/cpu.h b/target/i386/cpu.h index 7b002962e23..653f14e516c 100644 --- a/target/i386/cpu.h +++ b/target/i386/cpu.h @@ -712,6 +712,7 @@ typedef enum FeatureWord { FEAT_24_0_EBX, /* CPUID[EAX=3D0x24,ECX=3D0].EBX */ FEAT_29_0_EBX, /* CPUID[EAX=3D0x29,ECX=3D0].EBX */ FEAT_1E_1_EAX, /* CPUID[EAX=3D0x1E,ECX=3D1].EAX */ + FEAT_24_1_ECX, /* CPUID[EAX=3D0x24,ECX=3D0].ECX */ FEATURE_WORDS, } FeatureWord; =20 @@ -1113,6 +1114,9 @@ uint64_t x86_cpu_get_supported_feature_word(X86CPU *c= pu, FeatureWord w); CPUID_24_0_EBX_AVX10_256 | \ CPUID_24_0_EBX_AVX10_512) =20 +/* AVX10_VNNI_INT instruction */ +#define CPUID_24_1_ECX_AVX10_VNNI_INT (1U << 2) + /* * New Conditional Instructions (NCIs), explicit New Data Destination (NDD) * controls, and explicit Flags Suppression (NF) controls for select sets = of diff --git a/target/i386/cpu.c b/target/i386/cpu.c index 1246a9af4a3..e0d75d170fa 100644 --- a/target/i386/cpu.c +++ b/target/i386/cpu.c @@ -1038,6 +1038,7 @@ void x86_cpu_vendor_words2str(char *dst, uint32_t ven= dor1, #define TCG_24_0_EBX_FEATURES 0 #define TCG_29_0_EBX_FEATURES 0 #define TCG_1E_1_EAX_FEATURES 0 +#define TCG_24_1_ECX_FEATURES 0 =20 #if defined CONFIG_USER_ONLY #define CPUID_8000_0008_EBX_KERNEL_FEATURES (CPUID_8000_0008_EBX_IBPB | \ @@ -1385,6 +1386,18 @@ FeatureWordInfo feature_word_info[FEATURE_WORDS] =3D= { }, .tcg_features =3D TCG_29_0_EBX_FEATURES, }, + [FEAT_24_1_ECX] =3D { + .type =3D CPUID_FEATURE_WORD, + .feat_names =3D { + [2] =3D "avx10-vnni-int", + }, + .cpuid =3D { + .eax =3D 0x24, + .needs_ecx =3D true, .ecx =3D 1, + .reg =3D R_ECX, + }, + .tcg_features =3D TCG_24_1_ECX_FEATURES, + }, [FEAT_8000_0007_EDX] =3D { .type =3D CPUID_FEATURE_WORD, .feat_names =3D { @@ -2041,6 +2054,11 @@ static FeatureDep feature_dependencies[] =3D { .from =3D { FEAT_7_1_EDX, CPUID_7_1_EDX_APXF }, .to =3D { FEAT_29_0_EBX, ~0ull }, }, + + { + .from =3D { FEAT_7_1_EDX, CPUID_7_1_EDX_AVX10 }, + .to =3D { FEAT_24_1_ECX, ~0ull }, + }, }; =20 typedef struct X86RegisterInfo32 { @@ -8457,8 +8475,17 @@ void cpu_x86_cpuid(CPUX86State *env, uint32_t index,= uint32_t count, *ebx =3D 0; *ecx =3D 0; *edx =3D 0; - if ((env->features[FEAT_7_1_EDX] & CPUID_7_1_EDX_AVX10) && count = =3D=3D 0) { + + if (!(env->features[FEAT_7_1_EDX] & CPUID_7_1_EDX_AVX10)) { + break; + } + if (count =3D=3D 0) { + uint32_t unused; + x86_cpu_get_supported_cpuid(0x1E, 0, eax, &unused, + &unused, &unused); *ebx =3D env->features[FEAT_24_0_EBX] | env->avx10_version; + } else if (count =3D=3D 1) { + *ecx =3D env->features[FEAT_24_1_ECX]; } break; } --=20 2.52.0