summaryrefslogtreecommitdiff
path: root/arch/powerpc/kvm/book3s_64_slb.S
diff options
context:
space:
mode:
authorAlexander Graf <agraf@suse.de>2014-04-24 12:57:11 +0200
committerAlexander Graf <agraf@suse.de>2014-05-30 14:26:19 +0200
commit14a7d41dad9d3943e05995c59bfe7e0117d8e752 (patch)
tree0ece4b4b088110a1444a9ca2424aee4f783d7407 /arch/powerpc/kvm/book3s_64_slb.S
parent4e509af9f83debe296661d2e09a8a214850efe3c (diff)
KVM: PPC: Book3S_64 PR: Access shadow slb in big endian
The "shadow SLB" in the PACA is shared with the hypervisor, so it has to be big endian. We access the shadow SLB during world switch, so let's make sure we access it in big endian even when we're on a little endian host. Signed-off-by: Alexander Graf <agraf@suse.de>
Diffstat (limited to 'arch/powerpc/kvm/book3s_64_slb.S')
-rw-r--r--arch/powerpc/kvm/book3s_64_slb.S33
1 files changed, 16 insertions, 17 deletions
diff --git a/arch/powerpc/kvm/book3s_64_slb.S b/arch/powerpc/kvm/book3s_64_slb.S
index 4f12e8f0c718..596140e5c889 100644
--- a/arch/powerpc/kvm/book3s_64_slb.S
+++ b/arch/powerpc/kvm/book3s_64_slb.S
@@ -17,29 +17,28 @@
* Authors: Alexander Graf <agraf@suse.de>
*/
-#ifdef __LITTLE_ENDIAN__
-#error Need to fix SLB shadow accesses in little endian mode
-#endif
-
#define SHADOW_SLB_ESID(num) (SLBSHADOW_SAVEAREA + (num * 0x10))
#define SHADOW_SLB_VSID(num) (SLBSHADOW_SAVEAREA + (num * 0x10) + 0x8)
#define UNBOLT_SLB_ENTRY(num) \
- ld r9, SHADOW_SLB_ESID(num)(r12); \
- /* Invalid? Skip. */; \
- rldicl. r0, r9, 37, 63; \
- beq slb_entry_skip_ ## num; \
- xoris r9, r9, SLB_ESID_V@h; \
- std r9, SHADOW_SLB_ESID(num)(r12); \
+ li r11, SHADOW_SLB_ESID(num); \
+ LDX_BE r9, r12, r11; \
+ /* Invalid? Skip. */; \
+ rldicl. r0, r9, 37, 63; \
+ beq slb_entry_skip_ ## num; \
+ xoris r9, r9, SLB_ESID_V@h; \
+ STDX_BE r9, r12, r11; \
slb_entry_skip_ ## num:
#define REBOLT_SLB_ENTRY(num) \
- ld r10, SHADOW_SLB_ESID(num)(r11); \
- cmpdi r10, 0; \
- beq slb_exit_skip_ ## num; \
- oris r10, r10, SLB_ESID_V@h; \
- ld r9, SHADOW_SLB_VSID(num)(r11); \
- slbmte r9, r10; \
- std r10, SHADOW_SLB_ESID(num)(r11); \
+ li r8, SHADOW_SLB_ESID(num); \
+ li r7, SHADOW_SLB_VSID(num); \
+ LDX_BE r10, r11, r8; \
+ cmpdi r10, 0; \
+ beq slb_exit_skip_ ## num; \
+ oris r10, r10, SLB_ESID_V@h; \
+ LDX_BE r9, r11, r7; \
+ slbmte r9, r10; \
+ STDX_BE r10, r11, r8; \
slb_exit_skip_ ## num:
/******************************************************************************