aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/mm/slb.c
diff options
context:
space:
mode:
authorAnton Blanchard <anton@samba.org>2013-08-06 12:01:46 -0400
committerBenjamin Herrenschmidt <benh@kernel.crashing.org>2013-08-14 01:33:35 -0400
commit7ffcf8ec26f4b94b95b1297131d223b121d951e5 (patch)
tree7b4b47eaeafe56c253350b14470fecf03b40277f /arch/powerpc/mm/slb.c
parentc72cd555e828b710bce8c3635254dbb483397142 (diff)
powerpc: Fix little endian lppaca, slb_shadow and dtl_entry
The lppaca, slb_shadow and dtl_entry hypervisor structures are big endian, so we have to byte swap them in little endian builds. LE KVM hosts will also need to be fixed but for now add an #error to remind us. Signed-off-by: Anton Blanchard <anton@samba.org> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Diffstat (limited to 'arch/powerpc/mm/slb.c')
-rw-r--r--arch/powerpc/mm/slb.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/arch/powerpc/mm/slb.c b/arch/powerpc/mm/slb.c
index a538c80db2df..9d1d33cd2be5 100644
--- a/arch/powerpc/mm/slb.c
+++ b/arch/powerpc/mm/slb.c
@@ -66,8 +66,10 @@ static inline void slb_shadow_update(unsigned long ea, int ssize,
66 * we only update the current CPU's SLB shadow buffer. 66 * we only update the current CPU's SLB shadow buffer.
67 */ 67 */
68 get_slb_shadow()->save_area[entry].esid = 0; 68 get_slb_shadow()->save_area[entry].esid = 0;
69 get_slb_shadow()->save_area[entry].vsid = mk_vsid_data(ea, ssize, flags); 69 get_slb_shadow()->save_area[entry].vsid =
70 get_slb_shadow()->save_area[entry].esid = mk_esid_data(ea, ssize, entry); 70 cpu_to_be64(mk_vsid_data(ea, ssize, flags));
71 get_slb_shadow()->save_area[entry].esid =
72 cpu_to_be64(mk_esid_data(ea, ssize, entry));
71} 73}
72 74
73static inline void slb_shadow_clear(unsigned long entry) 75static inline void slb_shadow_clear(unsigned long entry)
@@ -112,7 +114,8 @@ static void __slb_flush_and_rebolt(void)
112 } else { 114 } else {
113 /* Update stack entry; others don't change */ 115 /* Update stack entry; others don't change */
114 slb_shadow_update(get_paca()->kstack, mmu_kernel_ssize, lflags, 2); 116 slb_shadow_update(get_paca()->kstack, mmu_kernel_ssize, lflags, 2);
115 ksp_vsid_data = get_slb_shadow()->save_area[2].vsid; 117 ksp_vsid_data =
118 be64_to_cpu(get_slb_shadow()->save_area[2].vsid);
116 } 119 }
117 120
118 /* We need to do this all in asm, so we're sure we don't touch 121 /* We need to do this all in asm, so we're sure we don't touch