> -----Original Message-----
> From: Wood Scott-B07421
> Sent: Thursday, March 14, 2013 9:36 PM
> To: Bhushan Bharat-R65777
> Cc: Alexander Graf; kvm-...@vger.kernel.org; kvm@vger.kernel.org; Wood Scott-
> B07421
> Subject: Re: [PATCH 7/7] KVM: PPC: Add userspace debug stub support
> 
> On 03/14/2013 08:57:53 AM, Bhushan Bharat-R65777 wrote:
> > > >>> diff --git a/arch/powerpc/kvm/e500mc.c
> > b/arch/powerpc/kvm/e500mc.c
> > > >>> index 1f89d26..f5fc6f5 100644
> > > >>> --- a/arch/powerpc/kvm/e500mc.c
> > > >>> +++ b/arch/powerpc/kvm/e500mc.c
> > > >>> @@ -182,8 +182,7 @@ int kvmppc_core_vcpu_setup(struct kvm_vcpu
> > > >>> *vcpu) {
> > > >>>       struct kvmppc_vcpu_e500 *vcpu_e500 = to_e500(vcpu);
> > > >>>
> > > >>> -     vcpu->arch.shadow_epcr = SPRN_EPCR_DSIGS |
> > SPRN_EPCR_DGTMI | \
> > > >>> -                              SPRN_EPCR_DUVD;
> > > >>> +     vcpu->arch.shadow_epcr = SPRN_EPCR_DSIGS |
> > SPRN_EPCR_DGTMI;
> > > >>
> > > >> Doesn't this route all debug events through the host?
> > > >
> > > > No; This means that debug events can occur in hypervisor state or
> > not.
> > > >
> > > > EPCR.DUVD = 0 ; Debug events can occur in the hypervisor state.
> > > >
> > > > EPCR.DUVD = 1 ; Debug events cannot occur in the hypervisor state.
> > > >
> > > > So we allow debug events to occur in hypervisor state.
> > >
> > > Why do we care about debug events in our entry/exit code and didn't
> > care about
> > > them before?
> >
> > We care for single stepping in guest to not step in KVM code.
> >
> > > If anything, this is a completely separate patch, orthogonal to this
> > > patch series, and requires a good bit of explanation.
> >
> > Not sure why you think separate patch; this patch add support for
> > single stepping and also takes care that debug event does not comes in
> > host when doing single stepping.
> 
> How does *removing* DUVD ensure that?

By default we clear DUVD, so debug events can come in hypervisor state. But on 
lightweight exit, when restoring guest debug context, we set DUVD so the debug 
interrupt will not come in hypervisor state as debug resource are taken by 
guest.

On guest exit, when restoring the host context we clear DUVD so now debug 
resource are having host context.

With proposed change of save and restore on vcpu_get/vcpu_put this switching 
witching will be done in vcpu_get/set().

Thanks
-Bharat

> 
> -Scott

--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to