diff options
| -rw-r--r-- | arch/arm64/include/asm/kvm_arm.h | 1 | ||||
| -rw-r--r-- | arch/arm64/kvm/hyp/switch.c | 8 |
2 files changed, 7 insertions, 2 deletions
diff --git a/arch/arm64/include/asm/kvm_arm.h b/arch/arm64/include/asm/kvm_arm.h index 738a95f93e49..bef6e9243c63 100644 --- a/arch/arm64/include/asm/kvm_arm.h +++ b/arch/arm64/include/asm/kvm_arm.h | |||
| @@ -182,6 +182,7 @@ | |||
| 182 | #define CPTR_EL2_TCPAC (1 << 31) | 182 | #define CPTR_EL2_TCPAC (1 << 31) |
| 183 | #define CPTR_EL2_TTA (1 << 20) | 183 | #define CPTR_EL2_TTA (1 << 20) |
| 184 | #define CPTR_EL2_TFP (1 << CPTR_EL2_TFP_SHIFT) | 184 | #define CPTR_EL2_TFP (1 << CPTR_EL2_TFP_SHIFT) |
| 185 | #define CPTR_EL2_DEFAULT 0x000033ff | ||
| 185 | 186 | ||
| 186 | /* Hyp Debug Configuration Register bits */ | 187 | /* Hyp Debug Configuration Register bits */ |
| 187 | #define MDCR_EL2_TDRA (1 << 11) | 188 | #define MDCR_EL2_TDRA (1 << 11) |
diff --git a/arch/arm64/kvm/hyp/switch.c b/arch/arm64/kvm/hyp/switch.c index ca8f5a5e2f96..f0e7bdfae134 100644 --- a/arch/arm64/kvm/hyp/switch.c +++ b/arch/arm64/kvm/hyp/switch.c | |||
| @@ -36,7 +36,11 @@ static void __hyp_text __activate_traps(struct kvm_vcpu *vcpu) | |||
| 36 | write_sysreg(val, hcr_el2); | 36 | write_sysreg(val, hcr_el2); |
| 37 | /* Trap on AArch32 cp15 c15 accesses (EL1 or EL0) */ | 37 | /* Trap on AArch32 cp15 c15 accesses (EL1 or EL0) */ |
| 38 | write_sysreg(1 << 15, hstr_el2); | 38 | write_sysreg(1 << 15, hstr_el2); |
| 39 | write_sysreg(CPTR_EL2_TTA | CPTR_EL2_TFP, cptr_el2); | 39 | |
| 40 | val = CPTR_EL2_DEFAULT; | ||
| 41 | val |= CPTR_EL2_TTA | CPTR_EL2_TFP; | ||
| 42 | write_sysreg(val, cptr_el2); | ||
| 43 | |||
| 40 | write_sysreg(vcpu->arch.mdcr_el2, mdcr_el2); | 44 | write_sysreg(vcpu->arch.mdcr_el2, mdcr_el2); |
| 41 | } | 45 | } |
| 42 | 46 | ||
| @@ -45,7 +49,7 @@ static void __hyp_text __deactivate_traps(struct kvm_vcpu *vcpu) | |||
| 45 | write_sysreg(HCR_RW, hcr_el2); | 49 | write_sysreg(HCR_RW, hcr_el2); |
| 46 | write_sysreg(0, hstr_el2); | 50 | write_sysreg(0, hstr_el2); |
| 47 | write_sysreg(read_sysreg(mdcr_el2) & MDCR_EL2_HPMN_MASK, mdcr_el2); | 51 | write_sysreg(read_sysreg(mdcr_el2) & MDCR_EL2_HPMN_MASK, mdcr_el2); |
| 48 | write_sysreg(0, cptr_el2); | 52 | write_sysreg(CPTR_EL2_DEFAULT, cptr_el2); |
| 49 | } | 53 | } |
| 50 | 54 | ||
| 51 | static void __hyp_text __activate_vm(struct kvm_vcpu *vcpu) | 55 | static void __hyp_text __activate_vm(struct kvm_vcpu *vcpu) |
