Merge remote-tracking branch 'kvmarm/misc-5.5' into kvmarm/next
[sfrench/cifs-2.6.git] / virt / kvm / arm / arm.c
index c11d6613f4ee50ad4bdbcdb267058ff163338a03..12e0280291cee9c0670f0d5c222ff6f24e4c0060 100644 (file)
@@ -348,20 +348,24 @@ void kvm_arch_vcpu_blocking(struct kvm_vcpu *vcpu)
        /*
         * If we're about to block (most likely because we've just hit a
         * WFI), we need to sync back the state of the GIC CPU interface
-        * so that we have the lastest PMR and group enables. This ensures
+        * so that we have the latest PMR and group enables. This ensures
         * that kvm_arch_vcpu_runnable has up-to-date data to decide
         * whether we have pending interrupts.
+        *
+        * For the same reason, we want to tell GICv4 that we need
+        * doorbells to be signalled, should an interrupt become pending.
         */
        preempt_disable();
        kvm_vgic_vmcr_sync(vcpu);
+       vgic_v4_put(vcpu, true);
        preempt_enable();
-
-       kvm_vgic_v4_enable_doorbell(vcpu);
 }
 
 void kvm_arch_vcpu_unblocking(struct kvm_vcpu *vcpu)
 {
-       kvm_vgic_v4_disable_doorbell(vcpu);
+       preempt_disable();
+       vgic_v4_load(vcpu);
+       preempt_enable();
 }
 
 int kvm_arch_vcpu_init(struct kvm_vcpu *vcpu)
@@ -412,9 +416,9 @@ void kvm_arch_vcpu_load(struct kvm_vcpu *vcpu, int cpu)
                kvm_make_request(KVM_REQ_RECORD_STEAL, vcpu);
 
        if (single_task_running())
-               vcpu_clear_wfe_traps(vcpu);
+               vcpu_clear_wfx_traps(vcpu);
        else
-               vcpu_set_wfe_traps(vcpu);
+               vcpu_set_wfx_traps(vcpu);
 
        vcpu_ptrauth_setup_lazy(vcpu);
 }