diff options
author | Anton Blanchard <anton@samba.org> | 2013-11-20 06:14:59 -0500 |
---|---|---|
committer | Benjamin Herrenschmidt <benh@kernel.crashing.org> | 2013-11-20 17:19:16 -0500 |
commit | e844b1eeae42dc93bf13e67812a95ee7b58be8c7 (patch) | |
tree | 7c36d37d883ed5ec6b386277c38e20d9485fdaca /arch/powerpc/include | |
parent | b91da2d4ce896c324bdbf1a078dbbe2db9a35ef1 (diff) |
pseries: Add H_SET_MODE to change exception endianness
On little endian builds call H_SET_MODE so exceptions have the
correct endianness. We need to reset the endian during kexec
so do that in the MMU hashtable clear callback.
Signed-off-by: Anton Blanchard <anton@samba.org>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Diffstat (limited to 'arch/powerpc/include')
-rw-r--r-- | arch/powerpc/include/asm/hvcall.h | 2 | ||||
-rw-r--r-- | arch/powerpc/include/asm/plpar_wrappers.h | 26 |
2 files changed, 28 insertions, 0 deletions
diff --git a/arch/powerpc/include/asm/hvcall.h b/arch/powerpc/include/asm/hvcall.h index 0c7f2bfcf134..d8b600b3f058 100644 --- a/arch/powerpc/include/asm/hvcall.h +++ b/arch/powerpc/include/asm/hvcall.h | |||
@@ -403,6 +403,8 @@ static inline unsigned long cmo_get_page_size(void) | |||
403 | extern long pSeries_enable_reloc_on_exc(void); | 403 | extern long pSeries_enable_reloc_on_exc(void); |
404 | extern long pSeries_disable_reloc_on_exc(void); | 404 | extern long pSeries_disable_reloc_on_exc(void); |
405 | 405 | ||
406 | extern long pseries_big_endian_exceptions(void); | ||
407 | |||
406 | #else | 408 | #else |
407 | 409 | ||
408 | #define pSeries_enable_reloc_on_exc() do {} while (0) | 410 | #define pSeries_enable_reloc_on_exc() do {} while (0) |
diff --git a/arch/powerpc/include/asm/plpar_wrappers.h b/arch/powerpc/include/asm/plpar_wrappers.h index a63b045e707c..12c32c5f533d 100644 --- a/arch/powerpc/include/asm/plpar_wrappers.h +++ b/arch/powerpc/include/asm/plpar_wrappers.h | |||
@@ -287,6 +287,32 @@ static inline long disable_reloc_on_exceptions(void) { | |||
287 | return plpar_set_mode(0, 3, 0, 0); | 287 | return plpar_set_mode(0, 3, 0, 0); |
288 | } | 288 | } |
289 | 289 | ||
290 | /* | ||
291 | * Take exceptions in big endian mode on this partition | ||
292 | * | ||
293 | * Note: this call has a partition wide scope and can take a while to complete. | ||
294 | * If it returns H_LONG_BUSY_* it should be retried periodically until it | ||
295 | * returns H_SUCCESS. | ||
296 | */ | ||
297 | static inline long enable_big_endian_exceptions(void) | ||
298 | { | ||
299 | /* mflags = 0: big endian exceptions */ | ||
300 | return plpar_set_mode(0, 4, 0, 0); | ||
301 | } | ||
302 | |||
303 | /* | ||
304 | * Take exceptions in little endian mode on this partition | ||
305 | * | ||
306 | * Note: this call has a partition wide scope and can take a while to complete. | ||
307 | * If it returns H_LONG_BUSY_* it should be retried periodically until it | ||
308 | * returns H_SUCCESS. | ||
309 | */ | ||
310 | static inline long enable_little_endian_exceptions(void) | ||
311 | { | ||
312 | /* mflags = 1: little endian exceptions */ | ||
313 | return plpar_set_mode(1, 4, 0, 0); | ||
314 | } | ||
315 | |||
290 | static inline long plapr_set_ciabr(unsigned long ciabr) | 316 | static inline long plapr_set_ciabr(unsigned long ciabr) |
291 | { | 317 | { |
292 | return plpar_set_mode(0, 1, ciabr, 0); | 318 | return plpar_set_mode(0, 1, ciabr, 0); |