]> git.karo-electronics.de Git - linux-beck.git/commitdiff
KVM: PPC: BOOKE: Clear guest dbsr in userspace exit KVM_EXIT_DEBUG
authorBharat Bhushan <Bharat.Bhushan@freescale.com>
Wed, 6 Aug 2014 06:38:54 +0000 (12:08 +0530)
committerAlexander Graf <agraf@suse.de>
Mon, 22 Sep 2014 08:11:30 +0000 (10:11 +0200)
Dbsr is not visible to userspace and we do not think any need to
expose this to userspace because:
  Userspace cannot inject debug interrupt to guest (as this
  does not know guest ability to handle debug interrupt), so
  userspace will always clear DBSR.
  Now if userspace has to always clear DBSR in KVM_EXIT_DEBUG
  handling then clearing dbsr in kernel looks simple as this
  avoid doing SET_SREGS/set_one_reg() to clear DBSR

Signed-off-by: Bharat Bhushan <Bharat.Bhushan@freescale.com>
Signed-off-by: Alexander Graf <agraf@suse.de>
arch/powerpc/kvm/booke.c

index 322da7d2334ad2a246e7ed3017e24c2cc3c0c622..b4ab86cdb51d786330d196bc31b04fabd5e751a8 100644 (file)
@@ -735,6 +735,8 @@ static int kvmppc_handle_debug(struct kvm_run *run, struct kvm_vcpu *vcpu)
        struct debug_reg *dbg_reg = &(vcpu->arch.shadow_dbg_reg);
        u32 dbsr = vcpu->arch.dbsr;
 
+       /* Clear guest dbsr (vcpu->arch.dbsr) */
+       vcpu->arch.dbsr = 0;
        run->debug.arch.status = 0;
        run->debug.arch.address = vcpu->arch.pc;