From nobody Sat Nov 15 19:03:59 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=1748927610; cv=none; d=zohomail.com; s=zohoarc; b=kQfCYxHOKYEMdfNz/YizMrq9O58AdmC05Wy9uPHbwwnLHmfCH7eiyoY+NWXnDpiRC7YlrO71W5PoagdRYkRBI6x25FotF7+TaUVUj9tM+QJP3CPWF35KevDb0ZcIEK6ANinmBgD1fmDqwH2extmPPsPcSc2hJ4TUyf3GFOy9aVg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1748927610; 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=1j0ASBpfUj4mFBz3FNj3ZP3N4NuHbftBgV0q4SPOVuo=; b=g9ayQCEkg4bx7osno12TSWMFnuqVuv+wNiWTbfMSF7S9VrNs5mFQW32WueholH80aPf94YM/wszjSWaiHYKKfBW+g2BhmH781ExNRJvllnv1a7lfUxVWu9t44KjRUOR13XPElYaB+RFM9RtUBbzrRrUtZhAwL0NKc+T8oiulP6E= 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 1748927610372325.79230059377926; Mon, 2 Jun 2025 22:13:30 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1uMJx6-0006th-3p; Tue, 03 Jun 2025 01:12:44 -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 1uMJx3-0006tA-CE for qemu-devel@nongnu.org; Tue, 03 Jun 2025 01:12:42 -0400 Received: from mgamail.intel.com ([198.175.65.13]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1uMJwz-0003OJ-UB for qemu-devel@nongnu.org; Tue, 03 Jun 2025 01:12:39 -0400 Received: from orviesa002.jf.intel.com ([10.64.159.142]) by orvoesa105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 Jun 2025 22:09:11 -0700 Received: from lxy-clx-4s.sh.intel.com ([10.239.48.52]) by orviesa002.jf.intel.com with ESMTP; 02 Jun 2025 22:09:10 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1748927558; x=1780463558; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=5yCR1xkAwt2Ej/VPGCPcKRypG3VTb85Nj16RO6mSwyw=; b=hzR7R/xFtubk5kt25AfvSKWwt1KdzIzxsfGmeRu4+py9/q7Aa3pKB/VG zcbadCQ5yZ+e2zN9ELTHV3qFI7T63dSp2Vb2FWhk47ma8znUmeweD6YPH 5oapkLL3b9Bv+ZqnDndrlAjcNvYMUOaRAX8bgYlopAYso39Qgfm7wqLKp T6NmX4Spftg0M3dq28jAV1rQvsgoveSsRVfSMWyqNhe2vZ8Z6TLwVFqIo FSr0sDQNlI60+5LDiaw6tO1GR+0qqrJ5ikKvo5de4T7+cKWvuFeU80QLo I1XyEg0eVzGTQU2ksNCEmsz+vqKujXlAaJWMj6xzxJrZPnoU3PIXixo5R Q==; X-CSE-ConnectionGUID: TX6wKDw6Qsu2e2P4S+/bbQ== X-CSE-MsgGUID: oivO8biFT+exFMlPARYz+Q== X-IronPort-AV: E=McAfee;i="6700,10204,11451"; a="62007523" X-IronPort-AV: E=Sophos;i="6.16,205,1744095600"; d="scan'208";a="62007523" X-CSE-ConnectionGUID: so70jWytR1mKKPJV7qjFqA== X-CSE-MsgGUID: tWPGf3viSZm0a2SI+XhDZQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.16,205,1744095600"; d="scan'208";a="175700641" From: Xiaoyao Li To: Paolo Bonzini Cc: Igor Mammedov , =?UTF-8?q?Daniel=20P=20=2E=20Berrang=C3=A9?= , Xiaoyao Li , qemu-devel@nongnu.org Subject: [PATCH 1/3] i386/cpu: Rename enable_cpuid_0x1f to force_cpuid_0x1f Date: Tue, 3 Jun 2025 01:03:03 -0400 Message-ID: <20250603050305.1704586-2-xiaoyao.li@intel.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250603050305.1704586-1-xiaoyao.li@intel.com> References: <20250603050305.1704586-1-xiaoyao.li@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.13; 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.015, 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=0.999, 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: 1748927611772116600 Content-Type: text/plain; charset="utf-8" The name of "enable_cpuid_0x1f" isn't right to its behavior because the leaf 0x1f can be enabled even when "enable_cpuid_0x1f" is false. Rename it to "force_cpuid_0x1f" to better reflect its behavior. Suggested-by: Igor Mammedov Signed-off-by: Xiaoyao Li Reviewed-by: Daniel P. Berrang=C3=A9 Reviewed-by: Igor Mammedov --- Suggested by Igor at https://lore.kernel.org/qemu-devel/20250513144515.3761= 5651@imammedo.users.ipa.redhat.com/ --- target/i386/cpu.h | 4 ++-- target/i386/kvm/tdx.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/target/i386/cpu.h b/target/i386/cpu.h index 1146465c8c62..aaef6a2a6767 100644 --- a/target/i386/cpu.h +++ b/target/i386/cpu.h @@ -2270,7 +2270,7 @@ struct ArchCPU { bool enable_cpuid_0xb; =20 /* Force to enable cpuid 0x1f */ - bool enable_cpuid_0x1f; + bool force_cpuid_0x1f; =20 /* Enable auto level-increase for all CPUID leaves */ bool full_cpuid_auto_level; @@ -2540,7 +2540,7 @@ void mark_forced_on_features(X86CPU *cpu, FeatureWord= w, uint64_t mask, =20 static inline bool x86_has_cpuid_0x1f(X86CPU *cpu) { - return cpu->enable_cpuid_0x1f || + return cpu->force_cpuid_0x1f || x86_has_extended_topo(cpu->env.avail_cpu_topo); } =20 diff --git a/target/i386/kvm/tdx.c b/target/i386/kvm/tdx.c index 0a21ae555c5c..17e671f1710f 100644 --- a/target/i386/kvm/tdx.c +++ b/target/i386/kvm/tdx.c @@ -746,7 +746,7 @@ static void tdx_cpu_instance_init(X86ConfidentialGuest = *cg, CPUState *cpu) /* invtsc is fixed1 for TD guest */ object_property_set_bool(OBJECT(cpu), "invtsc", true, &error_abort); =20 - x86cpu->enable_cpuid_0x1f =3D true; + x86cpu->force_cpuid_0x1f =3D true; } =20 static uint32_t tdx_adjust_cpuid_features(X86ConfidentialGuest *cg, --=20 2.43.0