diff options
| author | Magnus Kulke <magnuskulke@linux.microsoft.com> | 2026-07-10 12:15:32 +0200 |
|---|---|---|
| committer | Paolo Bonzini <pbonzini@redhat.com> | 2026-08-17 16:51:53 +0200 |
| commit | ec38b3d54c4ff314670b923a50daf0bd7c040b8a (patch) | |
| tree | fcf4cbb0707270ef6b3263d657f83954833831d2 /accel | |
| parent | 49cd174b56ae5db509a075752a8a9e5247ebbc2e (diff) | |
| download | qemu-ec38b3d54c4ff314670b923a50daf0bd7c040b8a.tar.gz qemu-ec38b3d54c4ff314670b923a50daf0bd7c040b8a.zip | |
target/i386/mshv: migrate MP_STATE
MSHV's "internal activity state" roughly maps to QEMU's env->mp_state
and cpu->halted states that describe state of APs in a guest.
We don't invoke set_mp_state as part of store_vcpu_state() b/c we would
put all BSP + APs in a RUNNABLE (0) state immediately, breaking SMP boot
Instead we store the mp state as part of the load_cleanup() routine
after a migration.
Signed-off-by: Magnus Kulke <magnuskulke@linux.microsoft.com>
Link: https://lore.kernel.org/r/20260710101534.664604-11-magnuskulke@linux.microsoft.com
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'accel')
| -rw-r--r-- | accel/mshv/mshv-all.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/accel/mshv/mshv-all.c b/accel/mshv/mshv-all.c index 1ca1d4b54f..5921ce693e 100644 --- a/accel/mshv/mshv-all.c +++ b/accel/mshv/mshv-all.c @@ -62,6 +62,7 @@ static int init_mshv(int *mshv_fd) static int mshv_load_cleanup(void *opaque) { + CPUState *cpu; int ret; ret = mshv_arch_set_partition_msrs(first_cpu); @@ -70,6 +71,15 @@ static int mshv_load_cleanup(void *opaque) return -1; } + CPU_FOREACH(cpu) { + ret = mshv_arch_set_mp_state(cpu); + if (ret < 0) { + error_report("Failed to set mp state for vCPU %d: %s", + cpu->cpu_index, strerror(-ret)); + return -1; + } + } + return 0; } |
