aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/kvm/44x_tlb.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/powerpc/kvm/44x_tlb.c')
-rw-r--r--arch/powerpc/kvm/44x_tlb.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/arch/powerpc/kvm/44x_tlb.c b/arch/powerpc/kvm/44x_tlb.c
index 260fa8bc4608..6fadbd696021 100644
--- a/arch/powerpc/kvm/44x_tlb.c
+++ b/arch/powerpc/kvm/44x_tlb.c
@@ -28,6 +28,8 @@
28 28
29#include "44x_tlb.h" 29#include "44x_tlb.h"
30 30
31#define PPC44x_TLB_UATTR_MASK \
32 (PPC44x_TLB_U0|PPC44x_TLB_U1|PPC44x_TLB_U2|PPC44x_TLB_U3)
31#define PPC44x_TLB_USER_PERM_MASK (PPC44x_TLB_UX|PPC44x_TLB_UR|PPC44x_TLB_UW) 33#define PPC44x_TLB_USER_PERM_MASK (PPC44x_TLB_UX|PPC44x_TLB_UR|PPC44x_TLB_UW)
32#define PPC44x_TLB_SUPER_PERM_MASK (PPC44x_TLB_SX|PPC44x_TLB_SR|PPC44x_TLB_SW) 34#define PPC44x_TLB_SUPER_PERM_MASK (PPC44x_TLB_SX|PPC44x_TLB_SR|PPC44x_TLB_SW)
33 35
@@ -63,8 +65,8 @@ void kvmppc_dump_tlbs(struct kvm_vcpu *vcpu)
63 65
64static u32 kvmppc_44x_tlb_shadow_attrib(u32 attrib, int usermode) 66static u32 kvmppc_44x_tlb_shadow_attrib(u32 attrib, int usermode)
65{ 67{
66 /* Mask off reserved bits. */ 68 /* We only care about the guest's permission and user bits. */
67 attrib &= PPC44x_TLB_PERM_MASK|PPC44x_TLB_ATTR_MASK; 69 attrib &= PPC44x_TLB_PERM_MASK|PPC44x_TLB_UATTR_MASK;
68 70
69 if (!usermode) { 71 if (!usermode) {
70 /* Guest is in supervisor mode, so we need to translate guest 72 /* Guest is in supervisor mode, so we need to translate guest
@@ -76,6 +78,9 @@ static u32 kvmppc_44x_tlb_shadow_attrib(u32 attrib, int usermode)
76 /* Make sure host can always access this memory. */ 78 /* Make sure host can always access this memory. */
77 attrib |= PPC44x_TLB_SX|PPC44x_TLB_SR|PPC44x_TLB_SW; 79 attrib |= PPC44x_TLB_SX|PPC44x_TLB_SR|PPC44x_TLB_SW;
78 80
81 /* WIMGE = 0b00100 */
82 attrib |= PPC44x_TLB_M;
83
79 return attrib; 84 return attrib;
80} 85}
81 86