All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ian Campbell <ian.campbell@citrix.com>
To: Julien Grall <julien.grall@citrix.com>
Cc: stefano.stabellini@eu.citrix.com, tim@xen.org,
	julien.grall@linaro.org, xen-devel@lists.xen.org
Subject: Re: [PATCH 13/19] xen: arm: Annotate registers trapped by MDCR_EL2.TDRA
Date: Fri, 17 Apr 2015 12:51:21 +0100	[thread overview]
Message-ID: <1429271481.25195.280.camel@citrix.com> (raw)
In-Reply-To: <55228920.6020304@citrix.com>

On Mon, 2015-04-06 at 15:24 +0200, Julien Grall wrote:
> Hi Ian,
> 
> On 31/03/2015 12:07, Ian Campbell wrote:
> > Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
> > ---
> >   xen/arch/arm/traps.c          |   32 ++++++++++++++++++++++++++++++++
> >   xen/include/asm-arm/cpregs.h  |    4 ++++
> >   xen/include/asm-arm/sysregs.h |    1 +
> >   3 files changed, 37 insertions(+)
> >
> > diff --git a/xen/arch/arm/traps.c b/xen/arch/arm/traps.c
> > index 21bef01..7c37cec 100644
> > --- a/xen/arch/arm/traps.c
> > +++ b/xen/arch/arm/traps.c
> > @@ -1790,6 +1790,17 @@ static void do_cp14_32(struct cpu_user_regs *regs, const union hsr hsr)
> >
> >       switch ( hsr.bits & HSR_CP32_REGS_MASK )
> >       {
> > +    /*
> > +     * MDCR_EL2.TDRA
> > +     *
> > +     * ARMv7 (DDI 0406C.b): B1.14.15
> > +     * ARMv8 (DDI 0487A.d): D1-1508 Table D1-57
> > +     *
> > +     * Unhandled:
> > +     *    DBGDRAR
> > +     *    DBGDSAR
> > +     */
> > +
> 
> Why did you put the comment here? For AArch32, only DBGDRAR and DBGSAR 
> are trapped with this bit.
> 
> I think this should be moved above the label default.

Yes, not sure how it got out of place here. Moved.

> 
> >       case HSR_CPREG32(DBGDIDR):
> >           /*
> >            * Read-only register. Accessible by EL0 if DBGDSCRext.UDCCdis
> > @@ -1840,6 +1851,8 @@ static void do_cp14_32(struct cpu_user_regs *regs, const union hsr hsr)
> >        *
> >        * ARMv7 (DDI 0406C.b): B1.14.16
> >        * ARMv8 (DDI 0487A.d): D1-1507 Table D1-54
> > +     *
> > +     * And all other unknown registers.
> >        */
> >       default:
> >           gdprintk(XENLOG_ERR,
> > @@ -1870,6 +1883,17 @@ static void do_cp14_64(struct cpu_user_regs *regs, const union hsr hsr)
> >        *
> >        * ARMv7 (DDI 0406C.b): B1.14.16
> >        * ARMv8 (DDI 0487A.d): D1-1507 Table D1-54
> > +     *
> > +     * MDCR_EL2.TDRA
> > +     *
> > +     * ARMv7 (DDI 0406C.b): B1.14.15
> > +     * ARMv8 (DDI 0487A.d): D1-1508 Table D1-57
> > +     *
> > +     * Unhandled:
> > +     *    DBGDRAR64
> > +     *    DBGDSAR64
> 
> This is confusing. The real name of the register is DBGDRAR. I would say 
> "DBGDRAR 64-bit".

Yes, this was a tricky one because the register is actually two (a 32
and 64 version), hence in the #define I had to add a suffix and I
duplicated that here.

Instead I'll make both of them "DBGDRAR (NN-bit accesses)", similar to
what I did for the #defines

> 
> Furthermore, this is the only registers not handled on AArch32 for this 
> bit. This is rather strange to list them while you didn't do it for the 
> trace registers.

My intention was that every register trapped by a bit which we set be
listed somewhere, to make it easier to cross reference with the docs and
check we haven't accidentally forgotten something (as opposed to
deliberately ignoring as indicated by these comments).

You seem to be saying I've missed some trace registers, which ones?

> 
> > +     *
> > +     * And all other unknown registers.
> 
> For consistency, I would have add this part of the comment in patch #10 
> (where the comment has been added).
> 
> Anyway, the patch is already written so I'm fine with it.

I was rebasing any way so I did this.

> >        */
> >       gdprintk(XENLOG_ERR,
> >                "%s p14, %d, r%d, r%d, cr%d @ 0x%"PRIregister"\n",
> > @@ -1936,6 +1960,14 @@ static void do_sysreg(struct cpu_user_regs *regs,
> >              *x = v->arch.actlr;
> >           break;
> >
> > +    /*
> > +     * MDCR_EL2.TDRA
> > +     *
> > +     * ARMv8 (DDI 0487A.d): D1-1508 Table D1-57
> > +     */
> > +    case HSR_SYSREG_MDRAR_EL1:
> > +        return handle_ro_raz(regs, x, hsr.sysreg.read, hsr, 1);
> 
> This change should be in a separate patch or mention in the commit message.

I just added a mention of it since it is the AArch64 version of DBGDRAR.
I can't remember why I made this raz instead of trapping like with
DBGDRAR, but since I already wrote it I left them as is.

Ian

  reply	other threads:[~2015-04-17 11:51 UTC|newest]

Thread overview: 62+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-31 10:07 [PATCH 00/19] xen: arm: cleanup traps.c Ian Campbell
2015-03-31 10:07 ` [PATCH 01/19] xen: arm: constify union hsr and struct hsr_* where possible Ian Campbell
2015-04-02 10:44   ` Julien Grall
2015-04-02 15:10     ` Julien Grall
2015-03-31 10:07 ` [PATCH 02/19] xen: arm: add missing break Ian Campbell
2015-04-02 15:09   ` Julien Grall
2015-04-16 16:08     ` Ian Campbell
2015-04-17  6:06       ` Julien Grall
2015-03-31 10:07 ` [PATCH 03/19] xen: arm: call inject_undef_exception directly Ian Campbell
2015-04-02 15:08   ` Julien Grall
2015-03-31 10:07 ` [PATCH 04/19] xen: arm: provide and use a handle_raz_wi helper Ian Campbell
2015-04-02 15:14   ` Julien Grall
2015-04-02 15:31     ` Ian Campbell
2015-04-02 15:45       ` Julien Grall
2015-04-02 15:50         ` Ian Campbell
2015-04-02 16:01           ` Ian Campbell
2015-04-02 16:19             ` Ian Campbell
2015-04-03 12:39               ` Julien Grall
2015-04-16 16:35                 ` Ian Campbell
2015-03-31 10:07 ` [PATCH 05/19] xen: arm: Add and use r/o+raz and w/o+wi helpers Ian Campbell
2015-04-03 12:51   ` Julien Grall
2015-04-16 16:22     ` Ian Campbell
2015-04-17  6:18       ` Julien Grall
2015-04-17 10:34         ` Ian Campbell
2015-03-31 10:07 ` [PATCH 06/19] xen: arm: add minimum exception level argument to trap handler helpers Ian Campbell
2015-04-03 12:58   ` Julien Grall
2015-04-16 16:24     ` Ian Campbell
2015-03-31 10:07 ` [PATCH 07/19] xen: arm: Annotate trap handler for HCR_EL2.{TWI, TWE, TSC} Ian Campbell
2015-04-03 13:05   ` Julien Grall
2015-04-16 16:34     ` Ian Campbell
2015-04-17  6:26       ` Julien Grall
2015-03-31 10:07 ` [PATCH 08/19] xen: arm: implement handling of ACTLR_EL1 trap Ian Campbell
2015-04-03 13:42   ` Julien Grall
2015-04-16 16:40     ` Ian Campbell
2015-03-31 10:07 ` [PATCH 09/19] xen: arm: Annotate registers trapped by HSR_EL1.TIDCP Ian Campbell
2015-04-03 13:47   ` Julien Grall
2015-03-31 10:07 ` [PATCH 10/19] xen: arm: Annotate registers trapped by CPTR_EL2.TTA Ian Campbell
2015-04-06 11:10   ` Julien Grall
2015-04-16 16:45     ` Ian Campbell
2015-03-31 10:07 ` [PATCH 11/19] xen: arm: Annotate handlers for PCTR_EL2.Tx Ian Campbell
2015-04-06 11:18   ` Julien Grall
2015-04-16 16:53     ` Ian Campbell
2015-04-17  6:31       ` Julien Grall
2015-03-31 10:07 ` [PATCH 12/19] xen: arm: Annotate the handlers for HSTR_EL2.Tx Ian Campbell
2015-04-06 11:25   ` Julien Grall
2015-03-31 10:07 ` [PATCH 13/19] xen: arm: Annotate registers trapped by MDCR_EL2.TDRA Ian Campbell
2015-04-06 13:24   ` Julien Grall
2015-04-17 11:51     ` Ian Campbell [this message]
2015-04-21  8:26       ` Julien Grall
2015-04-21  8:42         ` Ian Campbell
2015-03-31 10:07 ` [PATCH 14/19] xen: arm: Annotate registers trapped by MDCR_EL2.TDOSA Ian Campbell
2015-03-31 10:07 ` [PATCH 15/19] xen: arm: Annotate registers trapped by MDCR_EL2.TDA Ian Campbell
2015-04-06 13:41   ` Julien Grall
2015-04-17 12:08     ` Ian Campbell
2015-03-31 10:07 ` [PATCH 16/19] xen: arm: Annotate registers trapped by MDCR_EL2.TPM and TPMCR Ian Campbell
2015-03-31 10:07 ` [PATCH 17/19] xen: arm: Remove CNTPCT_EL0 trap handling Ian Campbell
2015-04-06 13:52   ` Julien Grall
2015-03-31 10:07 ` [PATCH 18/19] xen: arm: Annotate registers trapped when CNTHCTL_EL2.EL1PCEN == 0 Ian Campbell
2015-04-06 13:58   ` Julien Grall
2015-04-17 12:12     ` Ian Campbell
2015-03-31 10:07 ` [PATCH 19/19] xen: arm: Annotate source of ICC SGI register trapping Ian Campbell
2015-04-06 14:08   ` Julien Grall

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=1429271481.25195.280.camel@citrix.com \
    --to=ian.campbell@citrix.com \
    --cc=julien.grall@citrix.com \
    --cc=julien.grall@linaro.org \
    --cc=stefano.stabellini@eu.citrix.com \
    --cc=tim@xen.org \
    --cc=xen-devel@lists.xen.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.