linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Michael Neuling <mikey@neuling.org>
To: Geert Uytterhoeven <Geert.Uytterhoeven@sonycom.com>
Cc: linuxppc-dev@lists.ozlabs.org
Subject: Re: [PATCH 4/5] powerpc: Rework set_dabr so it can take a DABRX value as well
Date: Fri, 07 Sep 2012 15:43:01 +1000	[thread overview]
Message-ID: <25431.1346996581@neuling.org> (raw)
In-Reply-To: <alpine.DEB.2.00.1209070716110.22556@bushbaby.sonytel.be>

Geert Uytterhoeven <Geert.Uytterhoeven@sonycom.com> wrote:

> 	Hi Mikey,
> 
> On Fri, 7 Sep 2012, Michael Neuling wrote:
> > Geert Uytterhoeven <geert@linux-m68k.org> wrote:
> > > On Thu, Sep 6, 2012 at 7:17 AM, Michael Neuling <mikey@neuling.org> wrote:
> > > > Rework set_dabr to take a DABRX value as well. We are not actually
> > > > changing any functionality at this stage, just preparing for that.
> > > 
> > > You are changing functionality.
> > 
> > You are right.. I'll fix that up.. Sorry.
> > 
> > > >  #define   DABRX_USER   (1UL << 0)
> > > >  #define   DABRX_KERNEL (1UL << 1)
> > > > +#define   DABRX_HYP    (1UL << 2)
> > > > +#define   DABRX_BTI    (1UL << 3)
> > > > +#define   DABRX_ALL     (DABRX_BTI | DABRX_HYP | DABRX_KERNEL | DABRX_USER)
> > > 
> > > > --- a/arch/powerpc/platforms/cell/beat.c
> > > > +++ b/arch/powerpc/platforms/cell/beat.c
> > > > @@ -136,9 +136,9 @@ ssize_t beat_nvram_get_size(void)
> > > >         return BEAT_NVRAM_SIZE;
> > > >  }
> > > >
> > > > -int beat_set_xdabr(unsigned long dabr)
> > > > +int beat_set_xdabr(unsigned long dabr, unsigned long dabrx)
> > > >  {
> > > > -       if (beat_set_dabr(dabr, DABRX_KERNEL | DABRX_USER))
> > > > +       if (beat_set_dabr(dabr, dabrx))
> > > >                 return -1;
> > > >         return 0;
> > > >  }
> > > 
> > > > --- a/arch/powerpc/platforms/ps3/setup.c
> > > > +++ b/arch/powerpc/platforms/ps3/setup.c
> > > > @@ -184,11 +184,9 @@ early_param("ps3flash", early_parse_ps3flash);
> > > >  #define prealloc_ps3flash_bounce_buffer()      do { } while (0)
> > > >  #endif
> > > >
> > > > -static int ps3_set_dabr(unsigned long dabr)
> > > > +static int ps3_set_dabr(unsigned long dabr, unsigned long dabrx)
> > > >  {
> > > > -       enum {DABR_USER = 1, DABR_KERNEL = 2,};
> > > > -
> > > > -       return lv1_set_dabr(dabr, DABR_KERNEL | DABR_USER) ? -1 : 0;
> > > > +       return lv1_set_dabr(dabr, dabrx) ? -1 : 0;
> > > >  }
> > > 
> > > > -               set_dabr(dabr.address | (dabr.enabled & 7));
> > > > +               set_dabr(dabr.address | (dabr.enabled & 7), DABRX_ALL);
> > > 
> > > Before, beat_set_dabr() and lv1_set_dabr() would have been called with dabrx = 3
> > > (DABRX_KERNEL | DABRX_USER). Now they're called with dabrx = 15
> > > (DABRX_ALL = DABRX_BTI | DABRX_HYP | DABRX_KERNEL | DABRX_USER).
> > > 
> > > No idea what's the impact of this...
> > 
> > Do you know if the ps3 hypervisor will allow us to set DABRX_BTI or
> > DABRX_HYP?  phyp wont.  
> 
> According to the documenation, all bits but DABRX_USER, DABRX_KERNEL, and
> DABRX_BTI must be zero.  This implies DABRX_HYP cannot be set.
> 
> BTW, the requirement that DABRX_USER and DABRX_KERNEL cannot both be zero
> at the same time is also there, cfr. your comment and check in
> pseries_set_xdabr().
> 
> Unfortunately, I cannot test it.

OK thanks, I'll mask appropriately.

Any place we can get a copy of the PS3 HV doc you're quoting from?

Mikey 

  reply	other threads:[~2012-09-07  5:43 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-09-06  5:17 [PATCH 1/5] powerpc: Pack arch_hw_breakpoint to avoid holes in struct Michael Neuling
2012-09-06  5:17 ` [PATCH 2/5] powerpc: Use consistent name info for arch_hw_breakpoint Michael Neuling
2012-09-06  5:17 ` [PATCH 3/5] powerpc: Use the XDABR hcall Michael Neuling
2012-09-06  5:17 ` [PATCH 4/5] powerpc: Rework set_dabr so it can take a DABRX value as well Michael Neuling
2012-09-06  5:35   ` Geert Uytterhoeven
2012-09-07  3:37     ` Michael Neuling
2012-09-07  5:26       ` Geert Uytterhoeven
2012-09-07  5:43         ` Michael Neuling [this message]
2012-09-10 12:27           ` Geert Uytterhoeven
2012-09-07  7:24         ` [PATCH v2 0/3] powerpc: HW filtering of breakpoint for user/kernel/hypervisor events Michael Neuling
2012-09-07  7:24         ` [PATCH 1/3] powerpc: Rework set_dabr so it can take a DABRX value as well Michael Neuling
2012-09-07  7:24         ` [PATCH 2/3] powerpc: Dynamically calculate the dabrx based on kernel/user/hypervisor Michael Neuling
2012-09-07  7:24         ` [PATCH 3/3] powerpc: cleanup old DABRX #defines Michael Neuling
2012-09-06  5:17 ` [PATCH 5/5] powerpc: Dynamically calculate the dabrx based on kernel/user/hypervisor Michael Neuling
2012-09-06  5:31   ` Michael Neuling

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=25431.1346996581@neuling.org \
    --to=mikey@neuling.org \
    --cc=Geert.Uytterhoeven@sonycom.com \
    --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;
as well as URLs for NNTP newsgroup(s).