aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc
diff options
context:
space:
mode:
authorPaul Mackerras <paulus@samba.org>2013-09-20 00:52:46 -0400
committerAlexander Graf <agraf@suse.de>2013-10-17 08:45:04 -0400
commit03a9c90334d611c3006ac9569579f25f64812bc1 (patch)
tree8bac356754c5a13b47a15f8a7d7b8726a42b5d38 /arch/powerpc
parentc9029c341da646ab0c9911ea4c118eaa0a2eb0fa (diff)
KVM: PPC: Book3S PR: Handle PP0 page-protection bit in guest HPTEs
64-bit POWER processors have a three-bit field for page protection in the hashed page table entry (HPTE). Currently we only interpret the two bits that were present in older versions of the architecture. The only defined combination that has the new bit set is 110, meaning read-only for supervisor and no access for user mode. This adds code to kvmppc_mmu_book3s_64_xlate() to interpret the extra bit appropriately. Signed-off-by: Paul Mackerras <paulus@samba.org> Signed-off-by: Alexander Graf <agraf@suse.de>
Diffstat (limited to 'arch/powerpc')
-rw-r--r--arch/powerpc/kvm/book3s_64_mmu.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/arch/powerpc/kvm/book3s_64_mmu.c b/arch/powerpc/kvm/book3s_64_mmu.c
index ffcde01cb995..9e6e11270b70 100644
--- a/arch/powerpc/kvm/book3s_64_mmu.c
+++ b/arch/powerpc/kvm/book3s_64_mmu.c
@@ -298,6 +298,8 @@ do_second:
298 v = pteg[i]; 298 v = pteg[i];
299 r = pteg[i+1]; 299 r = pteg[i+1];
300 pp = (r & HPTE_R_PP) | key; 300 pp = (r & HPTE_R_PP) | key;
301 if (r & HPTE_R_PP0)
302 pp |= 8;
301 303
302 gpte->eaddr = eaddr; 304 gpte->eaddr = eaddr;
303 gpte->vpage = kvmppc_mmu_book3s_64_ea_to_vp(vcpu, eaddr, data); 305 gpte->vpage = kvmppc_mmu_book3s_64_ea_to_vp(vcpu, eaddr, data);
@@ -319,6 +321,7 @@ do_second:
319 case 3: 321 case 3:
320 case 5: 322 case 5:
321 case 7: 323 case 7:
324 case 10:
322 gpte->may_read = true; 325 gpte->may_read = true;
323 break; 326 break;
324 } 327 }