aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexander Graf <agraf@suse.de>2014-04-24 06:57:11 -0400
committerAlexander Graf <agraf@suse.de>2014-05-30 08:26:19 -0400
commit14a7d41dad9d3943e05995c59bfe7e0117d8e752 (patch)
tree0ece4b4b088110a1444a9ca2424aee4f783d7407
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>
-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 @@
17 * Authors: Alexander Graf <agraf@suse.de> 17 * Authors: Alexander Graf <agraf@suse.de>
18 */ 18 */
19 19
20#ifdef __LITTLE_ENDIAN__
21#error Need to fix SLB shadow accesses in little endian mode
22#endif
23
24#define SHADOW_SLB_ESID(num) (SLBSHADOW_SAVEAREA + (num * 0x10)) 20#define SHADOW_SLB_ESID(num) (SLBSHADOW_SAVEAREA + (num * 0x10))
25#define SHADOW_SLB_VSID(num) (SLBSHADOW_SAVEAREA + (num * 0x10) + 0x8) 21#define SHADOW_SLB_VSID(num) (SLBSHADOW_SAVEAREA + (num * 0x10) + 0x8)
26#define UNBOLT_SLB_ENTRY(num) \ 22#define UNBOLT_SLB_ENTRY(num) \
27 ld r9, SHADOW_SLB_ESID(num)(r12); \ 23 li r11, SHADOW_SLB_ESID(num); \
28 /* Invalid? Skip. */; \ 24 LDX_BE r9, r12, r11; \
29 rldicl. r0, r9, 37, 63; \ 25 /* Invalid? Skip. */; \
30 beq slb_entry_skip_ ## num; \ 26 rldicl. r0, r9, 37, 63; \
31 xoris r9, r9, SLB_ESID_V@h; \ 27 beq slb_entry_skip_ ## num; \
32 std r9, SHADOW_SLB_ESID(num)(r12); \ 28 xoris r9, r9, SLB_ESID_V@h; \
29 STDX_BE r9, r12, r11; \
33 slb_entry_skip_ ## num: 30 slb_entry_skip_ ## num:
34 31
35#define REBOLT_SLB_ENTRY(num) \ 32#define REBOLT_SLB_ENTRY(num) \
36 ld r10, SHADOW_SLB_ESID(num)(r11); \ 33 li r8, SHADOW_SLB_ESID(num); \
37 cmpdi r10, 0; \ 34 li r7, SHADOW_SLB_VSID(num); \
38 beq slb_exit_skip_ ## num; \ 35 LDX_BE r10, r11, r8; \
39 oris r10, r10, SLB_ESID_V@h; \ 36 cmpdi r10, 0; \
40 ld r9, SHADOW_SLB_VSID(num)(r11); \ 37 beq slb_exit_skip_ ## num; \
41 slbmte r9, r10; \ 38 oris r10, r10, SLB_ESID_V@h; \
42 std r10, SHADOW_SLB_ESID(num)(r11); \ 39 LDX_BE r9, r11, r7; \
40 slbmte r9, r10; \
41 STDX_BE r10, r11, r8; \
43slb_exit_skip_ ## num: 42slb_exit_skip_ ## num:
44 43
45/****************************************************************************** 44/******************************************************************************