From nobody Thu Dec 18 14:10:53 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=1765782825; cv=none; d=zohomail.com; s=zohoarc; b=XYu4BGtpMkSmzVhPwI+iaCzA0sciIft+ZbHQ7EW4aZ/CeGuellz1qvOVVPWYvAJsTgkjylRQcP1JzivWM2SwoPfIARRQkD2HGU4V8OhTg7kyd+MaB0hFpu8jrU1PnxujiVUjbxtCtYG4YKbZ95/5YhBT6B3OYvweHF3r4R4f9I4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1765782825; 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=AlhCgW/aVdYXw9tfkjZSRqg08W5yZ6z2CREzrxOyCug=; b=DOd05hkmLlx2mOsbpo3O07tWACDiLhUqFOzt7BMNYDiGm5ogrFF8kWII6QmVQGdQAO5m6Al5k5WtVIBhYZ7sq3MUelZcVg2/m4I8GP7nXwFkuepWgLmNiWQm69cXmQj/tx5ncxf3h1pbw6D3em3cmdpqhxPeEirAQ08ycmAdeaI= 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 1765782824966890.8340166655007; Sun, 14 Dec 2025 23:13:44 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vV2lh-00038R-UT; Mon, 15 Dec 2025 02:13:17 -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 1vV2le-00036r-9i for qemu-devel@nongnu.org; Mon, 15 Dec 2025 02:13:14 -0500 Received: from mgamail.intel.com ([198.175.65.9]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vV2lc-0008DF-Fh for qemu-devel@nongnu.org; Mon, 15 Dec 2025 02:13:13 -0500 Received: from fmviesa007.fm.intel.com ([10.60.135.147]) by orvoesa101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 14 Dec 2025 23:13:12 -0800 Received: from liuzhao-optiplex-7080.sh.intel.com ([10.239.160.39]) by fmviesa007.fm.intel.com with ESMTP; 14 Dec 2025 23:13:10 -0800 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1765782793; x=1797318793; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=VcO5I41SMkUWDYwzgsYbLxVHGQ75PO+VCvmvvKQrwrc=; b=H+SHpTs6bTkKZL1qbO1zfqSgmLg+acIa7BMkpR5OHaFuleoT8AsUIZFh VK/9wRSqu96LHXQU+S1kDaO1Y1b6ncsyvgaGs++nYoxe+WIBPm2Ibn9fF JKDFZNno8B1B707B8FY7rtuxJLj7IoR3W8tF6RRjzY7wl3kupHgXUTTBM hKs2Dqbl7FOEfwEljKTzr4G4Gvv6NmLF+5Qg3m95KbYHl9b7kGGsV6oj9 GDhwtQ1LydiTTpskq0iB3qJP2NoYzbfRBhdJTgO6NWRm2+HVdizqAqzc3 aDWd2stefPz8d/tQUfHGUeF54BpQN35H0ktYrnJIEb7jbzKBssaTiHzQr g==; X-CSE-ConnectionGUID: A1XBW9T1SoSqdIBYooKl3g== X-CSE-MsgGUID: NYT072BPTSaw3kSYdKwztg== X-IronPort-AV: E=McAfee;i="6800,10657,11642"; a="90332254" X-IronPort-AV: E=Sophos;i="6.21,150,1763452800"; d="scan'208";a="90332254" X-CSE-ConnectionGUID: WDYFwABUTvCTaKI9OHx0JQ== X-CSE-MsgGUID: aTRJDeuxTv6HTqAAfZQGpw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.21,150,1763452800"; d="scan'208";a="197265952" From: Zhao Liu To: Paolo Bonzini , =?UTF-8?q?Daniel=20P=20=2E=20Berrang=C3=A9?= Cc: qemu-devel@nongnu.org, Xudong Hao , Zhao Liu Subject: [PATCH v2 06/11] i386/cpu: Allow unsupported avx10_version with x-force-features Date: Mon, 15 Dec 2025 15:37:38 +0800 Message-Id: <20251215073743.4055227-7-zhao1.liu@intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20251215073743.4055227-1-zhao1.liu@intel.com> References: <20251215073743.4055227-1-zhao1.liu@intel.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 client-ip=198.175.65.9; envelope-from=zhao1.liu@intel.com; helo=mgamail.intel.com X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.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, 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: 1765782827432158500 Content-Type: text/plain; charset="utf-8" The "force_features" ("x-force-features" property) forces setting feature even if host doesn't support, but also reports the warning. Given its function, it's useful for debug, so even if the AVX10 version is unsupported by host, force to set this AVX10 version if x-force-features=3Don. Tested-by: Xudong Hao Signed-off-by: Zhao Liu --- Changes since v1: * New patch. --- target/i386/cpu.c | 27 +++++++++++++++++++-------- 1 file changed, 19 insertions(+), 8 deletions(-) diff --git a/target/i386/cpu.c b/target/i386/cpu.c index c47e06cb79e7..41ff4058871a 100644 --- a/target/i386/cpu.c +++ b/target/i386/cpu.c @@ -9500,16 +9500,27 @@ static bool x86_cpu_filter_features(X86CPU *cpu, bo= ol verbose) uint8_t version =3D x86_cpu_get_host_avx10_version(); =20 if (version < env->avx10_version) { - if (prefix) { - warn_report("%s: avx10.%d. Adjust to avx10.%d", - prefix, env->avx10_version, version); - } /* - * Discrete feature bits have been checked and filtered based = on - * host support. So it's safe to change version without revert= ing - * other feature bits. + * With x-force-features=3Don, CPUID_7_1_EDX_AVX10 will not be= masked + * off, so there's no need to zero avx10 version. */ - env->avx10_version =3D version; + if (!cpu->force_features) { + if (prefix) { + warn_report("%s: avx10.%d. Adjust to avx10.%d", + prefix, env->avx10_version, version); + } + /* + * Discrete feature bits have been checked and filtered ba= sed + * on host support. So it's safe to change version without + * reverting other feature bits. + */ + env->avx10_version =3D version; + } else { + if (prefix) { + warn_report("%s: avx10.%d.", + prefix, env->avx10_version); + } + } have_filtered_features =3D true; } } else if (env->avx10_version) { --=20 2.34.1