KVM: PPC: Use MSR_DR for external load_up
Book3S_32 requires MSR_DR to be disabled during load_up_xxx while on Book3S_64 it's supposed to be enabled. I misread the code and disabled it in both cases, potentially breaking the PS3 which has a really small RMA. This patch makes KVM work on the PS3 again. Signed-off-by: Alexander Graf <agraf@suse.de> Signed-off-by: Avi Kivity <avi@redhat.com>
This commit is contained in:
parent
2d27fc5eac
commit
0e67790387
|
@ -202,8 +202,25 @@ _GLOBAL(kvmppc_rmcall)
|
||||||
|
|
||||||
#if defined(CONFIG_PPC_BOOK3S_32)
|
#if defined(CONFIG_PPC_BOOK3S_32)
|
||||||
#define STACK_LR INT_FRAME_SIZE+4
|
#define STACK_LR INT_FRAME_SIZE+4
|
||||||
|
|
||||||
|
/* load_up_xxx have to run with MSR_DR=0 on Book3S_32 */
|
||||||
|
#define MSR_EXT_START \
|
||||||
|
PPC_STL r20, _NIP(r1); \
|
||||||
|
mfmsr r20; \
|
||||||
|
LOAD_REG_IMMEDIATE(r3, MSR_DR|MSR_EE); \
|
||||||
|
andc r3,r20,r3; /* Disable DR,EE */ \
|
||||||
|
mtmsr r3; \
|
||||||
|
sync
|
||||||
|
|
||||||
|
#define MSR_EXT_END \
|
||||||
|
mtmsr r20; /* Enable DR,EE */ \
|
||||||
|
sync; \
|
||||||
|
PPC_LL r20, _NIP(r1)
|
||||||
|
|
||||||
#elif defined(CONFIG_PPC_BOOK3S_64)
|
#elif defined(CONFIG_PPC_BOOK3S_64)
|
||||||
#define STACK_LR _LINK
|
#define STACK_LR _LINK
|
||||||
|
#define MSR_EXT_START
|
||||||
|
#define MSR_EXT_END
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -215,19 +232,12 @@ _GLOBAL(kvmppc_load_up_ ## what); \
|
||||||
PPC_STLU r1, -INT_FRAME_SIZE(r1); \
|
PPC_STLU r1, -INT_FRAME_SIZE(r1); \
|
||||||
mflr r3; \
|
mflr r3; \
|
||||||
PPC_STL r3, STACK_LR(r1); \
|
PPC_STL r3, STACK_LR(r1); \
|
||||||
PPC_STL r20, _NIP(r1); \
|
MSR_EXT_START; \
|
||||||
mfmsr r20; \
|
|
||||||
LOAD_REG_IMMEDIATE(r3, MSR_DR|MSR_EE); \
|
|
||||||
andc r3,r20,r3; /* Disable DR,EE */ \
|
|
||||||
mtmsr r3; \
|
|
||||||
sync; \
|
|
||||||
\
|
\
|
||||||
bl FUNC(load_up_ ## what); \
|
bl FUNC(load_up_ ## what); \
|
||||||
\
|
\
|
||||||
mtmsr r20; /* Enable DR,EE */ \
|
MSR_EXT_END; \
|
||||||
sync; \
|
|
||||||
PPC_LL r3, STACK_LR(r1); \
|
PPC_LL r3, STACK_LR(r1); \
|
||||||
PPC_LL r20, _NIP(r1); \
|
|
||||||
mtlr r3; \
|
mtlr r3; \
|
||||||
addi r1, r1, INT_FRAME_SIZE; \
|
addi r1, r1, INT_FRAME_SIZE; \
|
||||||
blr
|
blr
|
||||||
|
|
Loading…
Reference in New Issue