aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/kvm/booke.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/powerpc/kvm/booke.c')
-rw-r--r--arch/powerpc/kvm/booke.c16
1 files changed, 7 insertions, 9 deletions
diff --git a/arch/powerpc/kvm/booke.c b/arch/powerpc/kvm/booke.c
index b4ab86cdb51d..e47de01b0dbb 100644
--- a/arch/powerpc/kvm/booke.c
+++ b/arch/powerpc/kvm/booke.c
@@ -668,10 +668,10 @@ int kvmppc_vcpu_run(struct kvm_run *kvm_run, struct kvm_vcpu *vcpu)
668#endif 668#endif
669 669
670 /* Switch to guest debug context */ 670 /* Switch to guest debug context */
671 debug = vcpu->arch.shadow_dbg_reg; 671 debug = vcpu->arch.dbg_reg;
672 switch_booke_debug_regs(&debug); 672 switch_booke_debug_regs(&debug);
673 debug = current->thread.debug; 673 debug = current->thread.debug;
674 current->thread.debug = vcpu->arch.shadow_dbg_reg; 674 current->thread.debug = vcpu->arch.dbg_reg;
675 675
676 vcpu->arch.pgdir = current->mm->pgd; 676 vcpu->arch.pgdir = current->mm->pgd;
677 kvmppc_fix_ee_before_entry(); 677 kvmppc_fix_ee_before_entry();
@@ -732,7 +732,7 @@ static int emulation_exit(struct kvm_run *run, struct kvm_vcpu *vcpu)
732 732
733static int kvmppc_handle_debug(struct kvm_run *run, struct kvm_vcpu *vcpu) 733static int kvmppc_handle_debug(struct kvm_run *run, struct kvm_vcpu *vcpu)
734{ 734{
735 struct debug_reg *dbg_reg = &(vcpu->arch.shadow_dbg_reg); 735 struct debug_reg *dbg_reg = &(vcpu->arch.dbg_reg);
736 u32 dbsr = vcpu->arch.dbsr; 736 u32 dbsr = vcpu->arch.dbsr;
737 737
738 /* Clear guest dbsr (vcpu->arch.dbsr) */ 738 /* Clear guest dbsr (vcpu->arch.dbsr) */
@@ -1848,7 +1848,7 @@ int kvm_arch_vcpu_ioctl_set_guest_debug(struct kvm_vcpu *vcpu,
1848 int n, b = 0, w = 0; 1848 int n, b = 0, w = 0;
1849 1849
1850 if (!(dbg->control & KVM_GUESTDBG_ENABLE)) { 1850 if (!(dbg->control & KVM_GUESTDBG_ENABLE)) {
1851 vcpu->arch.shadow_dbg_reg.dbcr0 = 0; 1851 vcpu->arch.dbg_reg.dbcr0 = 0;
1852 vcpu->guest_debug = 0; 1852 vcpu->guest_debug = 0;
1853 kvm_guest_protect_msr(vcpu, MSR_DE, false); 1853 kvm_guest_protect_msr(vcpu, MSR_DE, false);
1854 return 0; 1854 return 0;
@@ -1856,15 +1856,13 @@ int kvm_arch_vcpu_ioctl_set_guest_debug(struct kvm_vcpu *vcpu,
1856 1856
1857 kvm_guest_protect_msr(vcpu, MSR_DE, true); 1857 kvm_guest_protect_msr(vcpu, MSR_DE, true);
1858 vcpu->guest_debug = dbg->control; 1858 vcpu->guest_debug = dbg->control;
1859 vcpu->arch.shadow_dbg_reg.dbcr0 = 0; 1859 vcpu->arch.dbg_reg.dbcr0 = 0;
1860 /* Set DBCR0_EDM in guest visible DBCR0 register. */
1861 vcpu->arch.dbg_reg.dbcr0 = DBCR0_EDM;
1862 1860
1863 if (vcpu->guest_debug & KVM_GUESTDBG_SINGLESTEP) 1861 if (vcpu->guest_debug & KVM_GUESTDBG_SINGLESTEP)
1864 vcpu->arch.shadow_dbg_reg.dbcr0 |= DBCR0_IDM | DBCR0_IC; 1862 vcpu->arch.dbg_reg.dbcr0 |= DBCR0_IDM | DBCR0_IC;
1865 1863
1866 /* Code below handles only HW breakpoints */ 1864 /* Code below handles only HW breakpoints */
1867 dbg_reg = &(vcpu->arch.shadow_dbg_reg); 1865 dbg_reg = &(vcpu->arch.dbg_reg);
1868 1866
1869#ifdef CONFIG_KVM_BOOKE_HV 1867#ifdef CONFIG_KVM_BOOKE_HV
1870 /* 1868 /*