On Fri, 2014-07-11 at 14:08 +0530, Bharat Bhushan wrote: > When userspace (QEMU) is using the debug resource to debug guest > then we want MSR_DE to be always set. This patch adds missing > MSR_DE setting in "rfci" instruction. > > Signed-off-by: Bharat Bhushan <Bharat.Bhushan@xxxxxxxxxxxxx> > --- > arch/powerpc/kvm/booke_emulate.c | 6 +++++- > 1 file changed, 5 insertions(+), 1 deletion(-) > > diff --git a/arch/powerpc/kvm/booke_emulate.c b/arch/powerpc/kvm/booke_emulate.c > index 27a4b28..80c51a2 100644 > --- a/arch/powerpc/kvm/booke_emulate.c > +++ b/arch/powerpc/kvm/booke_emulate.c > @@ -40,7 +40,11 @@ static void kvmppc_emul_rfi(struct kvm_vcpu *vcpu) > static void kvmppc_emul_rfci(struct kvm_vcpu *vcpu) > { > vcpu->arch.pc = vcpu->arch.csrr0; > - kvmppc_set_msr(vcpu, vcpu->arch.csrr1); > + /* Force MSR_DE when guest does not own debug facilities */ > + if (vcpu->guest_debug) > + kvmppc_set_msr(vcpu, vcpu->arch.csrr1 | MSR_DE); > + else > + kvmppc_set_msr(vcpu, vcpu->arch.csrr1); > } > > int kvmppc_booke_emulate_op(struct kvm_run *run, struct kvm_vcpu *vcpu, It looks like this is already handled by kvmppc_vcpu_sync_debug(), which is called by kvmppc_set_msr(). Plus, it should only be done for HV mode. -Scott -- To unsubscribe from this list: send the line "unsubscribe kvm" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html