All of lore.kernel.org
 help / color / mirror / Atom feed
From: Bhushan Bharat-R65777 <R65777@freescale.com>
To: Wood Scott-B07421 <B07421@freescale.com>
Cc: Alexander Graf <agraf@suse.de>,
	"kvm-ppc@vger.kernel.org" <kvm-ppc@vger.kernel.org>,
	"kvm@vger.kernel.org" <kvm@vger.kernel.org>
Subject: RE: [PATCH 7/7] KVM: PPC: Add userspace debug stub support
Date: Thu, 14 Mar 2013 16:11:55 +0000	[thread overview]
Message-ID: <6A3DF150A5B70D4F9B66A25E3F7C888D065ECC66@039-SN2MPN1-023.039d.mgd.msft.net> (raw)
In-Reply-To: <1363277130.28440.3@snotra>



> -----Original Message-----
> From: Wood Scott-B07421
> Sent: Thursday, March 14, 2013 9:36 PM
> To: Bhushan Bharat-R65777
> Cc: Alexander Graf; kvm-ppc@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

      reply	other threads:[~2013-03-14 16:11 UTC|newest]

Thread overview: 72+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-02-28  4:13 [PATCH 0/7] KVM :PPC: Userspace Debug support Bharat Bhushan
2013-02-28  4:25 ` Bharat Bhushan
2013-02-28  4:13 ` [PATCH 1/7] KVM: PPC: booke: Added debug handler Bharat Bhushan
2013-02-28  4:25   ` Bharat Bhushan
2013-03-07 14:02   ` Alexander Graf
2013-03-07 14:02     ` Alexander Graf
2013-02-28  4:13 ` [PATCH 2/7] Added ONE_REG interface for debug instruction Bharat Bhushan
2013-02-28  4:25   ` Bharat Bhushan
2013-02-28 16:23   ` Scott Wood
2013-02-28 16:23     ` Scott Wood
2013-02-28 16:52     ` Alexander Graf
2013-02-28 16:52       ` Alexander Graf
2013-03-01  5:28       ` Bhushan Bharat-R65777
2013-03-01  5:28         ` Bhushan Bharat-R65777
2013-03-07 13:07   ` Alexander Graf
2013-03-07 13:07     ` Alexander Graf
2013-03-14  4:30     ` Bhushan Bharat-R65777
2013-03-14 11:56       ` Alexander Graf
2013-03-14 11:56         ` Alexander Graf
2013-02-28  4:13 ` [PATCH 3/7] KVM: PPC: debug stub interface parameter defined Bharat Bhushan
2013-02-28  4:25   ` Bharat Bhushan
2013-03-07 13:20   ` Alexander Graf
2013-03-07 13:20     ` Alexander Graf
2013-03-14  4:42     ` Bhushan Bharat-R65777
2013-03-14 11:54       ` Alexander Graf
2013-03-14 11:54         ` Alexander Graf
2013-03-14 11:57         ` Jan Kiszka
2013-03-14 11:57           ` Jan Kiszka
2013-03-14 12:09           ` Alexander Graf
2013-03-14 12:09             ` Alexander Graf
2013-03-14 12:13             ` Jan Kiszka
2013-03-14 12:13               ` Jan Kiszka
2013-03-14 12:19               ` Alexander Graf
2013-03-14 12:19                 ` Alexander Graf
2013-03-14 12:22                 ` Jan Kiszka
2013-03-14 12:22                   ` Jan Kiszka
2013-03-14 12:28                   ` Alexander Graf
2013-03-14 12:28                     ` Alexander Graf
2013-02-28  4:13 ` [PATCH 4/7] booke: Save and restore debug registers on guest entry and exit Bharat Bhushan
2013-02-28  4:25   ` Bharat Bhushan
2013-03-07 13:25   ` Alexander Graf
2013-03-07 13:25     ` Alexander Graf
2013-03-14  4:50     ` Bhushan Bharat-R65777
2013-03-14 11:52       ` Alexander Graf
2013-03-14 11:52         ` Alexander Graf
2013-03-14 14:44         ` Bhushan Bharat-R65777
2013-02-28  4:13 ` [PATCH 5/7] bookehv: " Bharat Bhushan
2013-02-28  4:25   ` Bharat Bhushan
2013-02-28  4:13 ` [PATCH 6/7] Rename EMULATE_DO_PAPR to EMULATE_EXIT_USER Bharat Bhushan
2013-02-28  4:25   ` Bharat Bhushan
2013-02-28 16:31   ` Scott Wood
2013-02-28 16:31     ` Scott Wood
2013-02-28 16:51     ` Alexander Graf
2013-02-28 16:51       ` Alexander Graf
2013-02-28 16:53       ` Scott Wood
2013-02-28 16:53         ` Scott Wood
2013-03-07 10:47         ` Alexander Graf
2013-03-07 10:47           ` Alexander Graf
2013-03-14  5:59           ` Bhushan Bharat-R65777
2013-02-28  4:13 ` [PATCH 7/7] KVM: PPC: Add userspace debug stub support Bharat Bhushan
2013-02-28  4:25   ` Bharat Bhushan
2013-03-07 13:39   ` Alexander Graf
2013-03-07 13:39     ` Alexander Graf
2013-03-14  5:18     ` Bhushan Bharat-R65777
2013-03-14  5:18       ` Bhushan Bharat-R65777
2013-03-14 11:50       ` Alexander Graf
2013-03-14 11:50         ` Alexander Graf
2013-03-14 13:57         ` Bhushan Bharat-R65777
2013-03-14 13:57           ` Bhushan Bharat-R65777
2013-03-14 16:05           ` Scott Wood
2013-03-14 16:05             ` Scott Wood
2013-03-14 16:11             ` Bhushan Bharat-R65777 [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=6A3DF150A5B70D4F9B66A25E3F7C888D065ECC66@039-SN2MPN1-023.039d.mgd.msft.net \
    --to=r65777@freescale.com \
    --cc=B07421@freescale.com \
    --cc=agraf@suse.de \
    --cc=kvm-ppc@vger.kernel.org \
    --cc=kvm@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.