From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5067E606A322 for ; Thu, 3 Dec 2026 15:52:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.microsoft.com header.i=@linux.microsoft.com header.a=rsa-sha256 header.s=default header.b=LAepigMW Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xZ96j-0006o6-Bs; Thu, 03 Dec 2026 10:52:29 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xZ96h-0006nJ-Dn for qemu-devel@nongnu.org; Thu, 03 Dec 2026 10:52:27 -0500 Received: from linux.microsoft.com ([13.77.154.182]) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xZ96f-0001mt-TW for qemu-devel@nongnu.org; Thu, 03 Dec 2026 10:52:27 -0500 Received: from laptop.localdomain (unknown [81.196.141.97]) by linux.microsoft.com (Postfix) with ESMTPSA id 7A41F20B7168; Thu, 3 Dec 2026 07:52:20 -0800 (PST) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com 7A41F20B7168 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1796313142; bh=OO/P3BIhzLMIL5d0Zo8llsor8VuLPtghkyprSpjWL+E=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=LAepigMWke2jqm+XZ/7qfOaIFMxjZhfT2v0Vo+wxYdmEqSd/axfOlv411lnn1yUGU p4p8xHoTw1/koFPlqOUmS6mYCgqJmuJ0wOea9e+UE9kW51tA3XTosDue3wMosiyAfH uC7FrkQtarNg15r4eZ2T6L3+NFsAVcymIqVIZkFI= From: =?UTF-8?q?Doru=20Bl=C3=A2nzeanu?= To: qemu-devel@nongnu.org Cc: =?UTF-8?q?Doru=20Bl=C3=A2nzeanu?= , Wei Liu , Magnus Kulke , Magnus Kulke , =?UTF-8?q?Doru=20Bl=C3=A2nzeanu?= , Paolo Bonzini , Wei Liu , Zhao Liu Subject: [PATCH v4 2/2] target/i386/mshv: Initialize the extended CPUID limit for host/max CPUs Date: Thu, 3 Dec 2026 17:52:11 +0200 Message-ID: <20261203155211.42970-3-dblanzeanu@linux.microsoft.com> X-Mailer: git-send-email 2.48.1.vfs.0.0 In-Reply-To: <20261203155211.42970-1-dblanzeanu@linux.microsoft.com> References: <20261203155211.42970-1-dblanzeanu@linux.microsoft.com> X-Archived-By: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Received-SPF: pass client-ip=13.77.154.182; envelope-from=dblanzeanu@linux.microsoft.com; helo=linux.microsoft.com X-Spam_score_int: -42 X-Spam_score: -4.3 X-Spam_bar: ---- X-Spam_report: (-4.3 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, RCVD_IN_DNSWL_MED=-2.3, 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: qemu development List-Archive: List-Post: List-Help: List-Subscribe: , Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org X-Spam-Status: No, score=-18.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_PASS, SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=4.0.1 X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on aws-us-west-2-korg-listserv-alma10-1 Initialize cpuid_min_xlevel from the host visible extended CPUID maximum for host/max CPUs, following kvm's initialization pattern. Let feature expansion determine xlevel while preserving explicit CLI limits and named CPU models defaults. Signed-off-by: Doru Blânzeanu Reviewed-by: Magnus Kulke --- target/i386/mshv/mshv-cpu.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/target/i386/mshv/mshv-cpu.c b/target/i386/mshv/mshv-cpu.c index 12d52e4ee1..7bfb68fad2 100644 --- a/target/i386/mshv/mshv-cpu.c +++ b/target/i386/mshv/mshv-cpu.c @@ -2561,8 +2561,15 @@ int mshv_get_vp_state(int cpu_fd, struct mshv_get_set_vp_state *state) static void mshv_cpu_instance_init(CPUState *cs) { X86CPU *cpu = X86_CPU(cs); + X86CPUClass *xcc = X86_CPU_GET_CLASS(cpu); host_cpu_instance_init(cpu); + + if (xcc->max_features) { + cpu->env.cpuid_min_xlevel = + mshv_get_supported_cpuid(0x80000000, 0, R_EAX); + } + mshv_cpu_xsave_init(); } -- 2.48.1.vfs.0.0