From nobody Fri Dec 19 16:03:32 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=1750995056; cv=none; d=zohomail.com; s=zohoarc; b=OuVMBpuPo1q4JQGofbQ/IIhQwCpN1wKYeNEvtg3le2SyvVacvXQmKOYI0ag5XmcBJSo+0dadZkFAe/+7Ev+cI8IPsf4SQ9gzo2P99sMwnEiKD00lNoS47b7hRqV10BNPPVxlHMvTkpum9Gt4k3PwTfHXtsqzqwsxVTizRzOvXBw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1750995056; 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=Hv82Y/31Qwmutx9ims8gDjD5vthSXm1H/1zSgGVKSkA=; b=Vnyu8AmVlq222W0AME5A50pROSoRQycNRJ7UZrmik0U1I1HCXnPQhnfx+TdA0Tfopg9VbhIQO7YwhFZyAPQTAZpkEcw5J2qSeSNAEDLRH6Wd88jozKwuh45xH80iXAslix4i9FtCdF7ILVIwG6VhCv5qwey3VnYes/e333QrdfM= 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 1750995056523492.9883199450435; Thu, 26 Jun 2025 20:30:56 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1uUznC-0002hA-VB; Thu, 26 Jun 2025 23:30:22 -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 1uUznB-0002gj-5K for qemu-devel@nongnu.org; Thu, 26 Jun 2025 23:30:21 -0400 Received: from mgamail.intel.com ([192.198.163.17]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1uUzn9-0007Kq-Iu for qemu-devel@nongnu.org; Thu, 26 Jun 2025 23:30:20 -0400 Received: from orviesa003.jf.intel.com ([10.64.159.143]) by fmvoesa111.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 26 Jun 2025 20:30:18 -0700 Received: from liuzhao-optiplex-7080.sh.intel.com ([10.239.160.39]) by orviesa003.jf.intel.com with ESMTP; 26 Jun 2025 20:30:16 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1750995020; x=1782531020; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=Vqumn9WyfeJIP89iUmDECJNuxthMp5H2k50wGBtggFg=; b=AHQeCeOywG82sbcFnruN5quMpi03ekoVHDoVLMVh05KgdHdAOdRw8btV ra2TnGlbOBLKs+UmOESX4m+/XxxfIniFXP6BlCx8vhCWv2rbKoYvy8Zoc EyMy6pSIoczkqsyFFamH59QD8ZJLS1+gH26ptk9xj1g3LdSBlmjASKjSQ Imk61rgHQXOOY6mzsO4yj/hrvSxJs/dG9wRFpCTvOcPoxD8TNr2QziHjs lkvmAUYQzn14J7pjyGcGg/l9iETLBqe0r7efxGBj8w7WaP/owGYMfu2bz SEZFBfWlS9WZCPKnVP6I8cb2X/P4jh0JiMU8vNxSVqIS03/9RLVYQI6o7 w==; X-CSE-ConnectionGUID: +Ns6FmY7REu31GF+sdq+Rg== X-CSE-MsgGUID: jTLAGG3aQkGGZV2ldaXY2w== X-IronPort-AV: E=McAfee;i="6800,10657,11476"; a="53247139" X-IronPort-AV: E=Sophos;i="6.16,269,1744095600"; d="scan'208";a="53247139" X-CSE-ConnectionGUID: qt+G+2++SoChamGiwrMUhg== X-CSE-MsgGUID: bRaS3BYaSi2tHxhCpuRb7g== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.16,269,1744095600"; d="scan'208";a="157084643" From: Zhao Liu To: Paolo Bonzini , =?UTF-8?q?Daniel=20P=20=2E=20Berrang=C3=A9?= , Igor Mammedov Cc: Ewan Hai , Xiaoyao Li , Tao Su , Yi Lai , Dapeng Mi , qemu-devel@nongnu.org, Zhao Liu Subject: [PATCH 2/4] i386/cpu: Mark CPUID 0x80000007[EBX] as reserved for Intel Date: Fri, 27 Jun 2025 11:51:27 +0800 Message-Id: <20250627035129.2755537-3-zhao1.liu@intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20250627035129.2755537-1-zhao1.liu@intel.com> References: <20250627035129.2755537-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=192.198.163.17; 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_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_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: 1750995057336116600 Content-Type: text/plain; charset="utf-8" Per SDM, 80000007H EAX Reserved =3D 0. EBX Reserved =3D 0. ECX Reserved =3D 0. EDX Bits 07-00: Reserved =3D 0. Bit 08: Invariant TSC available if 1. Bits 31-09: Reserved =3D 0. EAX/EBX/ECX in CPUID 0x80000007 leaf are reserved for Intel. At present, EAX is reserved for AMD, too. And AMD hasn't used ECX in QEMU. So these 2 registers are both left as 0. Therefore, only fix the EBX and excode it as 0 for Intel. Signed-off-by: Zhao Liu --- target/i386/cpu.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/target/i386/cpu.c b/target/i386/cpu.c index 867e08236540..6d590a9af389 100644 --- a/target/i386/cpu.c +++ b/target/i386/cpu.c @@ -8374,7 +8374,11 @@ void cpu_x86_cpuid(CPUX86State *env, uint32_t index,= uint32_t count, } case 0x80000007: *eax =3D 0; - *ebx =3D env->features[FEAT_8000_0007_EBX]; + if (cpu->vendor_cpuid_only_v2 && IS_INTEL_CPU(env)) { + *ebx =3D 0; + } else { + *ebx =3D env->features[FEAT_8000_0007_EBX]; + } *ecx =3D 0; *edx =3D env->features[FEAT_8000_0007_EDX]; break; --=20 2.34.1