Commit 14a7d41d authored by Alexander Graf's avatar Alexander Graf

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: default avatarAlexander Graf <agraf@suse.de>
parent 4e509af9
...@@ -17,29 +17,28 @@ ...@@ -17,29 +17,28 @@
* Authors: Alexander Graf <agraf@suse.de> * 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_ESID(num) (SLBSHADOW_SAVEAREA + (num * 0x10))
#define SHADOW_SLB_VSID(num) (SLBSHADOW_SAVEAREA + (num * 0x10) + 0x8) #define SHADOW_SLB_VSID(num) (SLBSHADOW_SAVEAREA + (num * 0x10) + 0x8)
#define UNBOLT_SLB_ENTRY(num) \ #define UNBOLT_SLB_ENTRY(num) \
ld r9, SHADOW_SLB_ESID(num)(r12); \ li r11, SHADOW_SLB_ESID(num); \
/* Invalid? Skip. */; \ LDX_BE r9, r12, r11; \
rldicl. r0, r9, 37, 63; \ /* Invalid? Skip. */; \
beq slb_entry_skip_ ## num; \ rldicl. r0, r9, 37, 63; \
xoris r9, r9, SLB_ESID_V@h; \ beq slb_entry_skip_ ## num; \
std r9, SHADOW_SLB_ESID(num)(r12); \ xoris r9, r9, SLB_ESID_V@h; \
STDX_BE r9, r12, r11; \
slb_entry_skip_ ## num: slb_entry_skip_ ## num:
#define REBOLT_SLB_ENTRY(num) \ #define REBOLT_SLB_ENTRY(num) \
ld r10, SHADOW_SLB_ESID(num)(r11); \ li r8, SHADOW_SLB_ESID(num); \
cmpdi r10, 0; \ li r7, SHADOW_SLB_VSID(num); \
beq slb_exit_skip_ ## num; \ LDX_BE r10, r11, r8; \
oris r10, r10, SLB_ESID_V@h; \ cmpdi r10, 0; \
ld r9, SHADOW_SLB_VSID(num)(r11); \ beq slb_exit_skip_ ## num; \
slbmte r9, r10; \ oris r10, r10, SLB_ESID_V@h; \
std r10, SHADOW_SLB_ESID(num)(r11); \ LDX_BE r9, r11, r7; \
slbmte r9, r10; \
STDX_BE r10, r11, r8; \
slb_exit_skip_ ## num: slb_exit_skip_ ## num:
/****************************************************************************** /******************************************************************************
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment