[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 82/92] target/i386: Fix VM migration when interrupt based APF is e
From: |
Paolo Bonzini |
Subject: |
[PULL 82/92] target/i386: Fix VM migration when interrupt based APF is enabled |
Date: |
Thu, 24 Sep 2020 05:23:04 -0400 |
From: Vitaly Kuznetsov <vkuznets@redhat.com>
VM with interrupt based APF enabled fails to migrate:
qemu-system-x86_64: error: failed to set MSR 0x4b564d02 to 0xf3
We have two issues:
1) There is a typo in kvm_put_msrs() and we write async_pf_int_msr
to MSR_KVM_ASYNC_PF_EN (instead of MSR_KVM_ASYNC_PF_INT)
2) We restore MSR_KVM_ASYNC_PF_EN before MSR_KVM_ASYNC_PF_INT is set
and this violates the check in KVM.
Re-order MSR_KVM_ASYNC_PF_EN/MSR_KVM_ASYNC_PF_INT setting (and
kvm_get_msrs() for consistency) and fix the typo.
Signed-off-by: Vitaly Kuznetsov <vkuznets@redhat.com>
Message-Id: <20200917102316.814804-1-vkuznets@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
target/i386/kvm.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/target/i386/kvm.c b/target/i386/kvm.c
index 06c2025c67..b327e8706f 100644
--- a/target/i386/kvm.c
+++ b/target/i386/kvm.c
@@ -2819,12 +2819,12 @@ static int kvm_put_msrs(X86CPU *cpu, int level)
kvm_msr_entry_add(cpu, MSR_IA32_TSC, env->tsc);
kvm_msr_entry_add(cpu, MSR_KVM_SYSTEM_TIME, env->system_time_msr);
kvm_msr_entry_add(cpu, MSR_KVM_WALL_CLOCK, env->wall_clock_msr);
+ if (env->features[FEAT_KVM] & (1 << KVM_FEATURE_ASYNC_PF_INT)) {
+ kvm_msr_entry_add(cpu, MSR_KVM_ASYNC_PF_INT,
env->async_pf_int_msr);
+ }
if (env->features[FEAT_KVM] & (1 << KVM_FEATURE_ASYNC_PF)) {
kvm_msr_entry_add(cpu, MSR_KVM_ASYNC_PF_EN, env->async_pf_en_msr);
}
- if (env->features[FEAT_KVM] & (1 << KVM_FEATURE_ASYNC_PF_INT)) {
- kvm_msr_entry_add(cpu, MSR_KVM_ASYNC_PF_EN, env->async_pf_int_msr);
- }
if (env->features[FEAT_KVM] & (1 << KVM_FEATURE_PV_EOI)) {
kvm_msr_entry_add(cpu, MSR_KVM_PV_EOI_EN, env->pv_eoi_en_msr);
}
@@ -3207,12 +3207,12 @@ static int kvm_get_msrs(X86CPU *cpu)
#endif
kvm_msr_entry_add(cpu, MSR_KVM_SYSTEM_TIME, 0);
kvm_msr_entry_add(cpu, MSR_KVM_WALL_CLOCK, 0);
- if (env->features[FEAT_KVM] & (1 << KVM_FEATURE_ASYNC_PF)) {
- kvm_msr_entry_add(cpu, MSR_KVM_ASYNC_PF_EN, 0);
- }
if (env->features[FEAT_KVM] & (1 << KVM_FEATURE_ASYNC_PF_INT)) {
kvm_msr_entry_add(cpu, MSR_KVM_ASYNC_PF_INT, 0);
}
+ if (env->features[FEAT_KVM] & (1 << KVM_FEATURE_ASYNC_PF)) {
+ kvm_msr_entry_add(cpu, MSR_KVM_ASYNC_PF_EN, 0);
+ }
if (env->features[FEAT_KVM] & (1 << KVM_FEATURE_PV_EOI)) {
kvm_msr_entry_add(cpu, MSR_KVM_PV_EOI_EN, 0);
}
--
2.26.2
- [PULL 74/92] docs: Move object.h overview doc comment to qom.rst, (continued)
- [PULL 74/92] docs: Move object.h overview doc comment to qom.rst, Paolo Bonzini, 2020/09/24
- [PULL 75/92] hw/i386/xen: Rename X86/PC specific function as xen_hvm_init_pc(), Paolo Bonzini, 2020/09/24
- [PULL 80/92] checkpatch: Detect '%#' or '%0#' in printf-style format strings, Paolo Bonzini, 2020/09/24
- [PULL 87/92] hw/net/can: sja1000 ignore CAN FD frames, Paolo Bonzini, 2020/09/24
- [PULL 76/92] sysemu/xen: Add missing 'exec/cpu-common.h' header for ram_addr_t type, Paolo Bonzini, 2020/09/24
- [PULL 78/92] hw/xen: Split x86-specific declaration from generic hardware ones, Paolo Bonzini, 2020/09/24
- [PULL 77/92] stubs: Split accelerator / hardware related stubs, Paolo Bonzini, 2020/09/24
- [PULL 85/92] target/i386: kvm: do not use kvm_check_extension to find paravirtual capabilities, Paolo Bonzini, 2020/09/24
- [PULL 86/92] net/can: Initial host SocketCan support for CAN FD., Paolo Bonzini, 2020/09/24
- [PULL 79/92] typedefs: Restrict PCMachineState to 'hw/i386/pc.h', Paolo Bonzini, 2020/09/24
- [PULL 82/92] target/i386: Fix VM migration when interrupt based APF is enabled,
Paolo Bonzini <=
- [PULL 83/92] target/i386: always create kvmclock device, Paolo Bonzini, 2020/09/24
- [PULL 81/92] helper_syscall x86_64: clear exception_is_int, Paolo Bonzini, 2020/09/24
- [PULL 88/92] net/can: Add can_dlc2len and can_len2dlc for CAN FD., Paolo Bonzini, 2020/09/24
- [PULL 84/92] bios-tables-test: Remove kernel-irqchip=off option, Paolo Bonzini, 2020/09/24
- [PULL 92/92] hw/net/can: Correct Kconfig dependencies, Paolo Bonzini, 2020/09/24
- [PULL 89/92] hw/net/can/ctucafd: Add CTU CAN FD core register definitions., Paolo Bonzini, 2020/09/24
- [PULL 91/92] hw/net/can: Documentation for CTU CAN FD IP open hardware core emulation., Paolo Bonzini, 2020/09/24
- [PULL 90/92] hw/net/can: CTU CAN FD IP open hardware core emulation., Paolo Bonzini, 2020/09/24
- Re: [PULL 00/92] Misc patches for 2020-09-24, no-reply, 2020/09/24
- Re: [PULL 00/92] Misc patches for 2020-09-24, Peter Maydell, 2020/09/25