Commit d182b8fd authored by Ram Pai's avatar Ram Pai Committed by Paul Mackerras

KVM: PPC: Book3S HV: Fix setting of storage key in H_ENTER

In handling a H_ENTER hypercall, the code in kvmppc_do_h_enter
clobbers the high-order two bits of the storage key, which is stored
in a split field in the second doubleword of the HPTE.  Any storage
key number above 7 hence fails to operate correctly.

This makes sure we preserve all the bits of the storage key.
Acked-by: default avatarBalbir Singh <bsingharora@gmail.com>
Signed-off-by: default avatarRam Pai <linuxram@us.ibm.com>
Signed-off-by: default avatarPaul Mackerras <paulus@ozlabs.org>
parent 50a1a259
...@@ -104,6 +104,7 @@ ...@@ -104,6 +104,7 @@
#define HPTE_R_C ASM_CONST(0x0000000000000080) #define HPTE_R_C ASM_CONST(0x0000000000000080)
#define HPTE_R_R ASM_CONST(0x0000000000000100) #define HPTE_R_R ASM_CONST(0x0000000000000100)
#define HPTE_R_KEY_LO ASM_CONST(0x0000000000000e00) #define HPTE_R_KEY_LO ASM_CONST(0x0000000000000e00)
#define HPTE_R_KEY (HPTE_R_KEY_LO | HPTE_R_KEY_HI)
#define HPTE_V_1TB_SEG ASM_CONST(0x4000000000000000) #define HPTE_V_1TB_SEG ASM_CONST(0x4000000000000000)
#define HPTE_V_VRMA_MASK ASM_CONST(0x4001ffffff000000) #define HPTE_V_VRMA_MASK ASM_CONST(0x4001ffffff000000)
......
...@@ -269,7 +269,7 @@ long kvmppc_do_h_enter(struct kvm *kvm, unsigned long flags, ...@@ -269,7 +269,7 @@ long kvmppc_do_h_enter(struct kvm *kvm, unsigned long flags,
if (!realmode) if (!realmode)
local_irq_restore(irq_flags); local_irq_restore(irq_flags);
ptel &= ~(HPTE_R_PP0 - psize); ptel &= HPTE_R_KEY | HPTE_R_PP0 | (psize-1);
ptel |= pa; ptel |= pa;
if (pa) if (pa)
......
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