From nobody Sun Dec 14 20:42:14 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass header.i=@intel.com; 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=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1751898526; cv=none; d=zohomail.com; s=zohoarc; b=mF+eLxqCuOljsd1O26cdcbA7xB/QnJW0a+N10Nr3I/BDMS41+iqCi0k2d0ZFOLnGiRHp9Qx1FeXwuLeHlX5sylTaDnv++anmTj34CLn8GkTrUnnNOY97maCLO2QVwfRW37rO2GsF/FVYa+SimR/bD4FfSrTxbLYtFX7vRkleYpQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1751898526; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=iYYSlXma4Ug5NG1X7dW1vrWWqX/F+pSv7UxL3moGG84=; b=D3jlV75wND/5jlv/HKIjL0Ryt+z013pwUcgNXvaGhv3z/+zs5m5cvfV7qGnEPQ+/H5ijSkCsZ2IdN9hZA915InBjgW2Nk7wRgEPMDga1e1jtyDUvJDXCbLRQMFvZkE5VDNIR+ueYSwA8UtLuXdG5xtYAjplCP1dF/l5U7gS0V1o= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass header.i=@intel.com; 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=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1751898526130746.5709769311751; Mon, 7 Jul 2025 07:28:46 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1uYmpE-0004yg-23; Mon, 07 Jul 2025 10:28:08 -0400 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 1uYmh7-0006yv-Nu for qemu-devel@nongnu.org; Mon, 07 Jul 2025 10:19:47 -0400 Received: from mgamail.intel.com ([192.198.163.18]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1uYmh5-00032E-0A for qemu-devel@nongnu.org; Mon, 07 Jul 2025 10:19:45 -0400 Received: from fmviesa001.fm.intel.com ([10.60.135.141]) by fmvoesa112.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Jul 2025 07:19:38 -0700 Received: from lxy-clx-4s.sh.intel.com ([10.239.48.52]) by fmviesa001.fm.intel.com with ESMTP; 07 Jul 2025 07:19:36 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1751897983; x=1783433983; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=xI4PP1tk09L1yhkF678CvUQDelQfTgTcp8WEY37RQKY=; b=Z+N9NHgaQWy89fseTlZwYdHpJsIz/6MeDb8fGVFBo2XOF0BBuecDs6un z5sxfWSLLlCNsmgjhTSWxAlyBDPrIQLO0bmggmm1Masbj11TTVAY19D6Q 6pz5+ZusbDe9mdyG2xU85+rk5R7mPP+Yx6k94Zxe/0sWXjbXX6RyBgusm MklErHTBMz6vIXCRQm567uAAvQGoZJHAUOSriweityIbpJXbkIiJbekJ3 YN/wjN8jd74NDt01FfzWsSBAPZqZcFdWxyy4Hew+gK4IIkpIVmr/CYHYY pIpYf7XhniXk2Q7luElIS6fLWJvT0uEwaI0tfZwYDE2AbAOD8YnxLcqDZ Q==; X-CSE-ConnectionGUID: POimwU/GTv2Vbcm0KtDAsg== X-CSE-MsgGUID: 5Tw1ecuxQLmc4lj9PTfmiA== X-IronPort-AV: E=McAfee;i="6800,10657,11487"; a="53333853" X-IronPort-AV: E=Sophos;i="6.16,294,1744095600"; d="scan'208";a="53333853" X-CSE-ConnectionGUID: B7k0nryBS/KchrKKdoqMmw== X-CSE-MsgGUID: TDXMYJ2eRbSqCvVa6ZmX9A== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.16,294,1744095600"; d="scan'208";a="186174646" From: Xiaoyao Li To: Paolo Bonzini Cc: qemu-devel@nongnu.org, Zhao Liu , tao1.su@intel.com, chenyi.qiang@intel.com, xiaoyao.li@intel.com Subject: [PATCH v2] i386/cpu: Remove FEAT_24_0_EBX for AVX10 Date: Mon, 7 Jul 2025 22:11:51 +0800 Message-ID: <20250707141151.4187798-1-xiaoyao.li@intel.com> X-Mailer: git-send-email 2.43.0 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 client-ip=192.198.163.18; envelope-from=xiaoyao.li@intel.com; helo=mgamail.intel.com X-Spam_score_int: -33 X-Spam_score: -3.4 X-Spam_bar: --- X-Spam_report: (-3.4 / 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, HK_RANDOM_ENVFROM=0.001, HK_RANDOM_FROM=1, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, SPF_HELO_NONE=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 @intel.com) X-ZM-MESSAGEID: 1751898528586116600 Content-Type: text/plain; charset="utf-8" It turns out that all the Intel processors enumerating the support of Intel AVX10 support all vector widths. It's documented in the latest SDM, vol 1, Chapter 16 "programming with Intel AVX10". (Note that AVX10.1 spec stops update since AVX10 is subsumed into SDM while AVX10.2 spec stays update for the future extension of AVX10) Now SDM [1] marks the bit 16-18 of CPUID.0x24_0.EBX as reserved and they are reserved at 1. The purpose of Intel is to remove the semantic of vector length enumeration from these bits since all the 128/256/512 bit length are supported and no need for enumeration. But Intel has to keep them reserved at 1 to make it compatible with the software written based on earlier avx10 spec that checks the bits to query of the support of each vector length. For QEMU, it makes no sense to allow the configurability of the bits anymore. Remove the leaf FEAT_24_0_EBX and related stuff. Just hardcore the bits to all 1 when AVX10 is exposed to guest, to comply with the SDM and stop trying to associate them with the enumeration of vector length. [1] https://cdrdv2.intel.com/v1/dl/getContent/671200 (rev 088) Signed-off-by: Xiaoyao Li Reviewed-by: Zhao Liu --- changes in v2: - refine the commit message to reference update from SDM instead of AVX10 spec; - call out explicitly the purpose of disassociating the enumeration of vector length from the CPUID bits. --- target/i386/cpu.c | 37 ++----------------------------------- target/i386/cpu.h | 12 ------------ 2 files changed, 2 insertions(+), 47 deletions(-) diff --git a/target/i386/cpu.c b/target/i386/cpu.c index 0d35e95430fe..1b50fd4e397d 100644 --- a/target/i386/cpu.c +++ b/target/i386/cpu.c @@ -912,7 +912,6 @@ void x86_cpu_vendor_words2str(char *dst, uint32_t vendo= r1, #define TCG_SGX_12_0_EAX_FEATURES 0 #define TCG_SGX_12_0_EBX_FEATURES 0 #define TCG_SGX_12_1_EAX_FEATURES 0 -#define TCG_24_0_EBX_FEATURES 0 =20 #if defined CONFIG_USER_ONLY #define CPUID_8000_0008_EBX_KERNEL_FEATURES (CPUID_8000_0008_EBX_IBPB | \ @@ -1208,20 +1207,6 @@ FeatureWordInfo feature_word_info[FEATURE_WORDS] =3D= { }, .tcg_features =3D TCG_7_2_EDX_FEATURES, }, - [FEAT_24_0_EBX] =3D { - .type =3D CPUID_FEATURE_WORD, - .feat_names =3D { - [16] =3D "avx10-128", - [17] =3D "avx10-256", - [18] =3D "avx10-512", - }, - .cpuid =3D { - .eax =3D 0x24, - .needs_ecx =3D true, .ecx =3D 0, - .reg =3D R_EBX, - }, - .tcg_features =3D TCG_24_0_EBX_FEATURES, - }, [FEAT_8000_0007_EDX] =3D { .type =3D CPUID_FEATURE_WORD, .feat_names =3D { @@ -1839,22 +1824,6 @@ static FeatureDep feature_dependencies[] =3D { .from =3D { FEAT_7_0_EBX, CPUID_7_0_EBX_SGX }, .to =3D { FEAT_SGX_12_1_EAX, ~0ull }, }, - { - .from =3D { FEAT_24_0_EBX, CPUID_24_0_EBX_AVX10_128 }, - .to =3D { FEAT_24_0_EBX, CPUID_24_0_EBX_AVX10_256 }, - }, - { - .from =3D { FEAT_24_0_EBX, CPUID_24_0_EBX_AVX10_256 }, - .to =3D { FEAT_24_0_EBX, CPUID_24_0_EBX_AVX10_512 }, - }, - { - .from =3D { FEAT_24_0_EBX, CPUID_24_0_EBX_AVX10_VL_MASK= }, - .to =3D { FEAT_7_1_EDX, CPUID_7_1_EDX_AVX10 }, - }, - { - .from =3D { FEAT_7_1_EDX, CPUID_7_1_EDX_AVX10 }, - .to =3D { FEAT_24_0_EBX, ~0ull }, - }, }; =20 typedef struct X86RegisterInfo32 { @@ -4732,9 +4701,6 @@ static const X86CPUDefinition builtin_x86_defs[] =3D { { "movdiri", "on" }, { "movdir64b", "on" }, { "avx10", "on" }, - { "avx10-128", "on" }, - { "avx10-256", "on" }, - { "avx10-512", "on" }, { "avx10-version", "1" }, { "stepping", "1" }, { /* end of list */ } @@ -7720,7 +7686,8 @@ void cpu_x86_cpuid(CPUX86State *env, uint32_t index, = uint32_t count, *ecx =3D 0; *edx =3D 0; if ((env->features[FEAT_7_1_EDX] & CPUID_7_1_EDX_AVX10) && count = =3D=3D 0) { - *ebx =3D env->features[FEAT_24_0_EBX] | env->avx10_version; + /* bit 16-18 are reserved at 1 */ + *ebx =3D (0x7U << 16) | env->avx10_version; } break; } diff --git a/target/i386/cpu.h b/target/i386/cpu.h index 51e10139dfdf..7856a882f014 100644 --- a/target/i386/cpu.h +++ b/target/i386/cpu.h @@ -671,7 +671,6 @@ typedef enum FeatureWord { FEAT_7_1_ECX, /* CPUID[EAX=3D7,ECX=3D1].ECX */ FEAT_7_1_EDX, /* CPUID[EAX=3D7,ECX=3D1].EDX */ FEAT_7_2_EDX, /* CPUID[EAX=3D7,ECX=3D2].EDX */ - FEAT_24_0_EBX, /* CPUID[EAX=3D0x24,ECX=3D0].EBX */ FEATURE_WORDS, } FeatureWord; =20 @@ -1037,17 +1036,6 @@ uint64_t x86_cpu_get_supported_feature_word(X86CPU *= cpu, FeatureWord w); /* Packets which contain IP payload have LIP values */ #define CPUID_14_0_ECX_LIP (1U << 31) =20 -/* AVX10 128-bit vector support is present */ -#define CPUID_24_0_EBX_AVX10_128 (1U << 16) -/* AVX10 256-bit vector support is present */ -#define CPUID_24_0_EBX_AVX10_256 (1U << 17) -/* AVX10 512-bit vector support is present */ -#define CPUID_24_0_EBX_AVX10_512 (1U << 18) -/* AVX10 vector length support mask */ -#define CPUID_24_0_EBX_AVX10_VL_MASK (CPUID_24_0_EBX_AVX10_128 | \ - CPUID_24_0_EBX_AVX10_256 | \ - CPUID_24_0_EBX_AVX10_512) - /* RAS Features */ #define CPUID_8000_0007_EBX_OVERFLOW_RECOV (1U << 0) #define CPUID_8000_0007_EBX_SUCCOR (1U << 1) --=20 2.43.0