Merge branches 'pm-cpufreq', 'pm-sleep' and 'pm-em'
[linux-2.6-microblaze.git] / arch / arm64 / kvm / hyp / include / hyp / switch.h
index e4a2f29..a0e78a6 100644 (file)
@@ -92,11 +92,15 @@ static inline void __activate_traps_common(struct kvm_vcpu *vcpu)
                write_sysreg(0, pmselr_el0);
                write_sysreg(ARMV8_PMU_USERENR_MASK, pmuserenr_el0);
        }
+
+       vcpu->arch.mdcr_el2_host = read_sysreg(mdcr_el2);
        write_sysreg(vcpu->arch.mdcr_el2, mdcr_el2);
 }
 
-static inline void __deactivate_traps_common(void)
+static inline void __deactivate_traps_common(struct kvm_vcpu *vcpu)
 {
+       write_sysreg(vcpu->arch.mdcr_el2_host, mdcr_el2);
+
        write_sysreg(0, hstr_el2);
        if (kvm_arm_support_pmu_v3())
                write_sysreg(0, pmuserenr_el0);