aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/kvm
diff options
context:
space:
mode:
authorAlex Bennée <alex.bennee@linaro.org>2015-07-07 12:29:56 -0400
committerMarc Zyngier <marc.zyngier@arm.com>2015-07-21 07:47:08 -0400
commit56c7f5e77f797fd0dcf2376ce1496f4238e6be33 (patch)
treef3e156fff0a95985c234ab004ebd1b21c2b9c637 /arch/arm/kvm
parent0e6f07f29cfb8d79dbbdb12560a73f7121ba324e (diff)
KVM: arm: introduce kvm_arm_init/setup/clear_debug
This is a precursor for later patches which will need to do more to setup debug state before entering the hyp.S switch code. The existing functionality for setting mdcr_el2 has been moved out of hyp.S and now uses the value kept in vcpu->arch.mdcr_el2. As the assembler used to previously mask and preserve MDCR_EL2.HPMN I've had to add a mechanism to save the value of mdcr_el2 as a per-cpu variable during the initialisation code. The kernel never sets this number so we are assuming the bootcode has set up the correct value here. This also moves the conditional setting of the TDA bit from the hyp code into the C code which is currently used for the lazy debug register context switch code. Signed-off-by: Alex Bennée <alex.bennee@linaro.org> Reviewed-by: Christoffer Dall <christoffer.dall@linaro.org> Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
Diffstat (limited to 'arch/arm/kvm')
-rw-r--r--arch/arm/kvm/arm.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/arch/arm/kvm/arm.c b/arch/arm/kvm/arm.c
index 1b693cb2d5b2..77151b111d32 100644
--- a/arch/arm/kvm/arm.c
+++ b/arch/arm/kvm/arm.c
@@ -543,6 +543,8 @@ int kvm_arch_vcpu_ioctl_run(struct kvm_vcpu *vcpu, struct kvm_run *run)
543 continue; 543 continue;
544 } 544 }
545 545
546 kvm_arm_setup_debug(vcpu);
547
546 /************************************************************** 548 /**************************************************************
547 * Enter the guest 549 * Enter the guest
548 */ 550 */
@@ -557,6 +559,8 @@ int kvm_arch_vcpu_ioctl_run(struct kvm_vcpu *vcpu, struct kvm_run *run)
557 * Back from guest 559 * Back from guest
558 *************************************************************/ 560 *************************************************************/
559 561
562 kvm_arm_clear_debug(vcpu);
563
560 /* 564 /*
561 * We may have taken a host interrupt in HYP mode (ie 565 * We may have taken a host interrupt in HYP mode (ie
562 * while executing the guest). This interrupt is still 566 * while executing the guest). This interrupt is still
@@ -914,6 +918,8 @@ static void cpu_init_hyp_mode(void *dummy)
914 vector_ptr = (unsigned long)__kvm_hyp_vector; 918 vector_ptr = (unsigned long)__kvm_hyp_vector;
915 919
916 __cpu_init_hyp_mode(boot_pgd_ptr, pgd_ptr, hyp_stack_ptr, vector_ptr); 920 __cpu_init_hyp_mode(boot_pgd_ptr, pgd_ptr, hyp_stack_ptr, vector_ptr);
921
922 kvm_arm_init_debug();
917} 923}
918 924
919static int hyp_init_cpu_notify(struct notifier_block *self, 925static int hyp_init_cpu_notify(struct notifier_block *self,