aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorAnton Blanchard <anton@samba.org>2013-12-15 18:47:54 -0500
committerBenjamin Herrenschmidt <benh@kernel.crashing.org>2013-12-29 22:51:09 -0500
commita68c33f3592eef63304a5f5ab68466539ccac56c (patch)
tree61c8bccbe6ed49b5993eefea013347b7dfa6d435 /arch
parentd084775738b746648d4102337163a04534a02982 (diff)
powerpc: Fix endian issues in power7/8 machine check handler
The SLB save area is shared with the hypervisor and is defined as big endian, so we need to byte swap on little endian builds. Signed-off-by: Anton Blanchard <anton@samba.org> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Diffstat (limited to 'arch')
-rw-r--r--arch/powerpc/kernel/mce_power.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/arch/powerpc/kernel/mce_power.c b/arch/powerpc/kernel/mce_power.c
index b36e777a734f..27c93f41166f 100644
--- a/arch/powerpc/kernel/mce_power.c
+++ b/arch/powerpc/kernel/mce_power.c
@@ -50,12 +50,12 @@ static void flush_and_reload_slb(void)
50 if (!slb) 50 if (!slb)
51 return; 51 return;
52 52
53 n = min_t(u32, slb->persistent, SLB_MIN_SIZE); 53 n = min_t(u32, be32_to_cpu(slb->persistent), SLB_MIN_SIZE);
54 54
55 /* Load up the SLB entries from shadow SLB */ 55 /* Load up the SLB entries from shadow SLB */
56 for (i = 0; i < n; i++) { 56 for (i = 0; i < n; i++) {
57 unsigned long rb = slb->save_area[i].esid; 57 unsigned long rb = be64_to_cpu(slb->save_area[i].esid);
58 unsigned long rs = slb->save_area[i].vsid; 58 unsigned long rs = be64_to_cpu(slb->save_area[i].vsid);
59 59
60 rb = (rb & ~0xFFFul) | i; 60 rb = (rb & ~0xFFFul) | i;
61 asm volatile("slbmte %0,%1" : : "r" (rs), "r" (rb)); 61 asm volatile("slbmte %0,%1" : : "r" (rs), "r" (rb));