LinuxPPC-Dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Kumar Gala <galak@kernel.crashing.org>
To: Bhushan Bharat-R65777 <R65777@freescale.com>
Cc: Wood Scott-B07421 <B07421@freescale.com>,
	KVM list <kvm@vger.kernel.org>, Alexander Graf <agraf@suse.de>,
	kvm-ppc@vger.kernel.org,
	Yoder Stuart-B08248 <b08248@freescale.com>,
	linuxppc list <linuxppc-dev@lists.ozlabs.org>
Subject: Re: [PATCH] bookehv: Handle debug exception on guest exit
Date: Thu, 11 Apr 2013 13:33:28 -0500	[thread overview]
Message-ID: <5A04ECFC-E828-4EBF-895B-043FC038ABB5@kernel.crashing.org> (raw)
In-Reply-To: <6A3DF150A5B70D4F9B66A25E3F7C888D06FC1773@039-SN2MPN1-013.039d.mgd.msft.net>


On Apr 5, 2013, at 2:53 AM, Bhushan Bharat-R65777 wrote:

> Hi Kumar/Benh,
>=20
> After further looking into the code I think that if we correct the =
vector range below in DebugDebug handler then we do not need the change =
I provided in this patch.
>=20
> Here is the snapshot for 32 bit (head_booke.h, same will be true for =
64 bit):
>=20
> #define DEBUG_DEBUG_EXCEPTION                                          =
       \
>        START_EXCEPTION(DebugDebug);                                    =
      \
>        DEBUG_EXCEPTION_PROLOG;                                         =
      \
>                                                                        =
      \
>        /*                                                              =
      \
>         * If there is a single step or branch-taken exception in an    =
      \
>         * exception entry sequence, it was probably meant to apply to  =
      \
>         * the code where the exception occurred (since exception entry =
      \
>         * doesn't turn off DE automatically).  We simulate the effect  =
      \
>         * of turning off DE on entry to an exception handler by =
turning      \
>         * off DE in the DSRR1 value and clearing the debug status.     =
      \
>         */                                                             =
      \
>        mfspr   r10,SPRN_DBSR;          /* check single-step/branch =
taken */  \
>        andis.  r10,r10,(DBSR_IC|DBSR_BT)@h;                            =
      \
>        beq+    2f;                                                     =
      \
>                                                                        =
      \
>        lis     r10,KERNELBASE@h;       /* check if exception in =
vectors */   \
>        ori     r10,r10,KERNELBASE@l;                                   =
      \
>        cmplw   r12,r10;                                                =
      \
>        blt+    2f;                     /* addr below exception vectors =
*/    \
>                                                                        =
      \
>        lis     r10,DebugDebug@h;                                       =
 \
>        ori     r10,r10,DebugDebug@l;                                   =
         \
>=20
> ^^^^
> 	Here we assume all exception vector ends at DebugDebug, which is =
not correct.
> 	We probably should get proper end by using some start_vector and =
end_vector lebels
> 	or at least use end at Ehvpriv (which is last defined in =
head_fsl_booke.S for PowerPC. Is that correct?
>=20
> =09
>        cmplw   r12,r10;                                                =
      \
>        bgt+    2f;                     /* addr above exception vectors =
*/    \
>=20
> Thanks
> -Bharat

I talked to Stuart and this general approach is good.  Just make sure to =
update both head_44x.S and head_fsl_booke.S.  Plus do this for both =
DEBUG_CRIT_EXCEPTION & DEBUG_DEBUG_EXCEPTION

- k=

  reply	other threads:[~2013-04-11 18:33 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-03-20 17:45 [PATCH] bookehv: Handle debug exception on guest exit Bharat Bhushan
2013-04-04 13:25 ` Alexander Graf
2013-04-04 14:58   ` Bhushan Bharat-R65777
2013-04-05  7:53     ` Bhushan Bharat-R65777
2013-04-11 18:33       ` Kumar Gala [this message]
2013-04-11 18:37         ` Stuart Yoder
2013-04-11 18:44           ` Stuart Yoder

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=5A04ECFC-E828-4EBF-895B-043FC038ABB5@kernel.crashing.org \
    --to=galak@kernel.crashing.org \
    --cc=B07421@freescale.com \
    --cc=R65777@freescale.com \
    --cc=agraf@suse.de \
    --cc=b08248@freescale.com \
    --cc=kvm-ppc@vger.kernel.org \
    --cc=kvm@vger.kernel.org \
    --cc=linuxppc-dev@lists.ozlabs.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox