mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/xiang/erofs.git
synced 2026-11-08 10:31:43 +01:00
KVM: nVMX: fixes for preemption timer migration
Commit850448f35a("KVM: nVMX: Fix VMX preemption timer migration", 2020-06-01) accidentally broke nVMX live migration from older version by changing the userspace ABI. Restore it and, while at it, ensure that vmx->nested.has_preemption_timer_deadline is always initialized according to the KVM_STATE_VMX_PREEMPTION_TIMER_DEADLINE flag. Cc: Makarand Sonare <[email protected]> Fixes:850448f35a("KVM: nVMX: Fix VMX preemption timer migration") Reviewed-by: Jim Mattson <[email protected]> Signed-off-by: Paolo Bonzini <[email protected]>
This commit is contained in:
1 parent
8038a922cf
commit
83d31e5271
3 files changed
+7
-4
No files matched your search
@@ -4339,14 +4339,15 @@ Errors:
|
||||
#define KVM_STATE_VMX_PREEMPTION_TIMER_DEADLINE 0x00000001
|
||||
|
||||
struct kvm_vmx_nested_state_hdr {
|
||||
__u32 flags;
|
||||
__u64 vmxon_pa;
|
||||
__u64 vmcs12_pa;
|
||||
__u64 preemption_timer_deadline;
|
||||
|
||||
struct {
|
||||
__u16 flags;
|
||||
} smm;
|
||||
|
||||
__u32 flags;
|
||||
__u64 preemption_timer_deadline;
|
||||
};
|
||||
|
||||
struct kvm_vmx_nested_state_data {
|
||||
|
||||
@@ -408,14 +408,15 @@ struct kvm_vmx_nested_state_data {
|
||||
};
|
||||
|
||||
struct kvm_vmx_nested_state_hdr {
|
||||
__u32 flags;
|
||||
__u64 vmxon_pa;
|
||||
__u64 vmcs12_pa;
|
||||
__u64 preemption_timer_deadline;
|
||||
|
||||
struct {
|
||||
__u16 flags;
|
||||
} smm;
|
||||
|
||||
__u32 flags;
|
||||
__u64 preemption_timer_deadline;
|
||||
};
|
||||
|
||||
struct kvm_svm_nested_state_data {
|
||||
|
||||
@@ -6176,6 +6176,7 @@ static int vmx_set_nested_state(struct kvm_vcpu *vcpu,
|
||||
goto error_guest_mode;
|
||||
}
|
||||
|
||||
vmx->nested.has_preemption_timer_deadline = false;
|
||||
if (kvm_state->hdr.vmx.flags & KVM_STATE_VMX_PREEMPTION_TIMER_DEADLINE) {
|
||||
vmx->nested.has_preemption_timer_deadline = true;
|
||||
vmx->nested.preemption_timer_deadline =
|
||||
|
||||
Reference in new issue
Block a user