summaryrefslogtreecommitdiffstats
path: root/arch/powerpc/mm/fault.c
diff options
context:
space:
mode:
authorAnton Blanchard2013-08-06 18:01:46 +0200
committerBenjamin Herrenschmidt2013-08-14 07:33:35 +0200
commit7ffcf8ec26f4b94b95b1297131d223b121d951e5 (patch)
tree7b4b47eaeafe56c253350b14470fecf03b40277f /arch/powerpc/mm/fault.c
parentpowerpc: Add endian annotations to lppaca, slb_shadow and dtl_entry (diff)
downloadkernel-qcow2-linux-7ffcf8ec26f4b94b95b1297131d223b121d951e5.tar.gz
kernel-qcow2-linux-7ffcf8ec26f4b94b95b1297131d223b121d951e5.tar.xz
kernel-qcow2-linux-7ffcf8ec26f4b94b95b1297131d223b121d951e5.zip
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/fault.c')
-rw-r--r--arch/powerpc/mm/fault.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/arch/powerpc/mm/fault.c b/arch/powerpc/mm/fault.c
index 8726779e1409..76d8e7cc7805 100644
--- a/arch/powerpc/mm/fault.c
+++ b/arch/powerpc/mm/fault.c
@@ -443,8 +443,12 @@ good_area:
regs, address);
#ifdef CONFIG_PPC_SMLPAR
if (firmware_has_feature(FW_FEATURE_CMO)) {
+ u32 page_ins;
+
preempt_disable();
- get_lppaca()->page_ins += (1 << PAGE_FACTOR);
+ page_ins = be32_to_cpu(get_lppaca()->page_ins);
+ page_ins += 1 << PAGE_FACTOR;
+ get_lppaca()->page_ins = cpu_to_be32(page_ins);
preempt_enable();
}
#endif /* CONFIG_PPC_SMLPAR */