diff options
author | Michael Neuling <mikey@neuling.org> | 2012-09-06 17:24:56 -0400 |
---|---|---|
committer | Benjamin Herrenschmidt <benh@kernel.crashing.org> | 2012-09-09 19:59:10 -0400 |
commit | 4474ef055c5d8cb8eaf002d69e49af71e3aa3a88 (patch) | |
tree | e57b99bfa78d7c3faf4125ab4a08f17fed2c41d8 /arch/powerpc/platforms/ps3/setup.c | |
parent | 3ab96a02e829131c19db8ed99239289acdb4e3dc (diff) |
powerpc: Rework set_dabr so it can take a DABRX value as well
Rework set_dabr to take a DABRX value as well.
Both the pseries and PS3 hypervisors do some checks on the DABRX
values that are passed in the hcall. This patch stops bogus values
from being passed to hypervisor. Also, in the case where we are
clearing the breakpoint, where DABR and DABRX are zero, we modify the
DABRX value to make it valid so that the hcall won't fail.
Signed-off-by: Michael Neuling <mikey@neuling.org>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Diffstat (limited to 'arch/powerpc/platforms/ps3/setup.c')
-rw-r--r-- | arch/powerpc/platforms/ps3/setup.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/arch/powerpc/platforms/ps3/setup.c b/arch/powerpc/platforms/ps3/setup.c index 2d664c5a83b0..3f509f86432c 100644 --- a/arch/powerpc/platforms/ps3/setup.c +++ b/arch/powerpc/platforms/ps3/setup.c | |||
@@ -184,11 +184,15 @@ early_param("ps3flash", early_parse_ps3flash); | |||
184 | #define prealloc_ps3flash_bounce_buffer() do { } while (0) | 184 | #define prealloc_ps3flash_bounce_buffer() do { } while (0) |
185 | #endif | 185 | #endif |
186 | 186 | ||
187 | static int ps3_set_dabr(unsigned long dabr) | 187 | static int ps3_set_dabr(unsigned long dabr, unsigned long dabrx) |
188 | { | 188 | { |
189 | enum {DABR_USER = 1, DABR_KERNEL = 2,}; | 189 | /* Have to set at least one bit in the DABRX */ |
190 | if (dabrx == 0 && dabr == 0) | ||
191 | dabrx = DABRX_USER; | ||
192 | /* hypervisor only allows us to set BTI, Kernel and user */ | ||
193 | dabrx &= DABRX_BTI | DABRX_KERNEL | DABRX_USER; | ||
190 | 194 | ||
191 | return lv1_set_dabr(dabr, DABR_KERNEL | DABR_USER) ? -1 : 0; | 195 | return lv1_set_dabr(dabr, dabrx) ? -1 : 0; |
192 | } | 196 | } |
193 | 197 | ||
194 | static void __init ps3_setup_arch(void) | 198 | static void __init ps3_setup_arch(void) |