Thread (15 messages) flat view 15 messages, 3 authors, 2012-09-10

Re: [PATCH 4/5] powerpc: Rework set_dabr so it can take a DABRX value as well

From: Geert Uytterhoeven <hidden>
Date: 2012-09-07 05:27:14

	Hi Mikey,

On Fri, 7 Sep 2012, Michael Neuling wrote:
Geert Uytterhoeven [off-list ref] wrote:
quoted
On Thu, Sep 6, 2012 at 7:17 AM, Michael Neuling [off-list ref] w=
rote:
quoted
quoted
Rework set_dabr to take a DABRX value as well. We are not actually
changing any functionality at this stage, just preparing for that.
=20
You are changing functionality.
=20
You are right.. I'll fix that up.. Sorry.
=20
quoted
quoted
 #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 | DA=
BRX_USER)
quoted
=20
quoted
--- 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;
 }
=20
quoted
--- 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 =3D 1, DABR_KERNEL =3D 2,};
-
-       return lv1_set_dabr(dabr, DABR_KERNEL | DABR_USER) ? -1 : 0=
;
quoted
quoted
+       return lv1_set_dabr(dabr, dabrx) ? -1 : 0;
 }
=20
quoted
-               set_dabr(dabr.address | (dabr.enabled & 7));
+               set_dabr(dabr.address | (dabr.enabled & 7), DABRX_A=
LL);
quoted
=20
Before, beat_set_dabr() and lv1_set_dabr() would have been called wit=
h dabrx =3D 3
quoted
(DABRX_KERNEL | DABRX_USER). Now they're called with dabrx =3D 15
(DABRX_ALL =3D DABRX_BTI | DABRX_HYP | DABRX_KERNEL | DABRX_USER).
=20
No idea what's the impact of this...
=20
Do you know if the ps3 hypervisor will allow us to set DABRX_BTI or
DABRX_HYP?  phyp wont. =20
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.

With kind regards,

Geert Uytterhoeven
Software Architect
Technology and Software Centre Europe

Sony Belgium, bijkantoor van Sony Europe Limited.
Da Vincilaan 7-D1 =C2=B7 B-1935 Zaventem =C2=B7 Belgium

Phone:  +32 (0)2 700 8453
Fax:    +32 (0)2 700 8622
E-mail: Geert.Uytterhoeven@sonycom.com

Sony Europe Limited. A company registered in England and Wales.
Registered office: The Heights, Brooklands, Weybridge, Surrey. KT13 0XW.
                   United Kingdom
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help