aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/x86/kvm/x86.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
index 49da1064ef50..8ce1139a08b5 100644
--- a/arch/x86/kvm/x86.c
+++ b/arch/x86/kvm/x86.c
@@ -2844,7 +2844,17 @@ static void kvm_steal_time_set_preempted(struct kvm_vcpu *vcpu)
2844 2844
2845void kvm_arch_vcpu_put(struct kvm_vcpu *vcpu) 2845void kvm_arch_vcpu_put(struct kvm_vcpu *vcpu)
2846{ 2846{
2847 /*
2848 * Disable page faults because we're in atomic context here.
2849 * kvm_write_guest_offset_cached() would call might_fault()
2850 * that relies on pagefault_disable() to tell if there's a
2851 * bug. NOTE: the write to guest memory may not go through if
2852 * during postcopy live migration or if there's heavy guest
2853 * paging.
2854 */
2855 pagefault_disable();
2847 kvm_steal_time_set_preempted(vcpu); 2856 kvm_steal_time_set_preempted(vcpu);
2857 pagefault_enable();
2848 kvm_x86_ops->vcpu_put(vcpu); 2858 kvm_x86_ops->vcpu_put(vcpu);
2849 kvm_put_guest_fpu(vcpu); 2859 kvm_put_guest_fpu(vcpu);
2850 vcpu->arch.last_host_tsc = rdtsc(); 2860 vcpu->arch.last_host_tsc = rdtsc();