From: "Doru Blânzeanu" <dblanzeanu@linux.microsoft.com>
To: qemu-devel@nongnu.org
Cc: "Doru Blânzeanu" <dblanzeanu@microsoft.com>,
"Wei Liu" <liuwe@microsoft.com>,
"Magnus Kulke" <magnuskulke@linux.microsoft.com>,
"Magnus Kulke" <magnuskulke@microsoft.com>,
"Doru Blânzeanu" <dblanzeanu@linux.microsoft.com>,
"Paolo Bonzini" <pbonzini@redhat.com>,
"Wei Liu" <wei.liu@kernel.org>, "Zhao Liu" <zhao1.liu@intel.com>
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 [thread overview]
Message-ID: <20261203155211.42970-3-dblanzeanu@linux.microsoft.com> (raw)
In-Reply-To: <20261203155211.42970-1-dblanzeanu@linux.microsoft.com>
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 <dblanzeanu@linux.microsoft.com>
Reviewed-by: Magnus Kulke <magnuskulke@linux.microsoft.com>
---
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
prev parent reply other threads:[~2026-12-03 15:52 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-12-03 15:52 [PATCH v4 0/2] Add CPU topology extension support for mshv guests Doru Blânzeanu
2026-12-03 15:52 ` [PATCH v4 1/2] mshv/mshv-cpu.c: Collect all Intel topology subleaves and AMD cache subleaves Doru Blânzeanu
2026-12-03 15:52 ` Doru Blânzeanu [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20261203155211.42970-3-dblanzeanu@linux.microsoft.com \
--to=dblanzeanu@linux.microsoft.com \
--cc=dblanzeanu@microsoft.com \
--cc=liuwe@microsoft.com \
--cc=magnuskulke@linux.microsoft.com \
--cc=magnuskulke@microsoft.com \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=wei.liu@kernel.org \
--cc=zhao1.liu@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.