aboutsummaryrefslogtreecommitdiff
path: root/arch/powerpc/kvm/book3s_64_mmu_radix.c
diff options
context:
space:
mode:
authorRadim Krčmář <rkrcmar@redhat.com>2017-03-02 21:53:25 +0100
committerRadim Krčmář <rkrcmar@redhat.com>2017-03-02 21:53:25 +0100
commit16ce771b93ab569490fd27415694132a7ade0d79 (patch)
tree8f8e8e6e19a7c8a4416538aad2cd4d9a89304339 /arch/powerpc/kvm/book3s_64_mmu_radix.c
parentacc9ab60132739e0c5ab40644444cd7b22d12886 (diff)
parent4e5acdc23a3dcbd6ad6dc93a9783dd9c838987c8 (diff)
downloadlinux-stericsson-16ce771b93ab569490fd27415694132a7ade0d79.tar.gz
Merge branch 'kvm-ppc-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/paulus/powerpc into next
Two bug fixes for HV KVM on POWER9 machines.
Diffstat (limited to 'arch/powerpc/kvm/book3s_64_mmu_radix.c')
-rw-r--r--arch/powerpc/kvm/book3s_64_mmu_radix.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/arch/powerpc/kvm/book3s_64_mmu_radix.c b/arch/powerpc/kvm/book3s_64_mmu_radix.c
index 4344651f408c..f6b3e67c5762 100644
--- a/arch/powerpc/kvm/book3s_64_mmu_radix.c
+++ b/arch/powerpc/kvm/book3s_64_mmu_radix.c
@@ -32,6 +32,7 @@ int kvmppc_mmu_radix_xlate(struct kvm_vcpu *vcpu, gva_t eaddr,
u32 pid;
int ret, level, ps;
__be64 prte, rpte;
+ unsigned long ptbl;
unsigned long root, pte, index;
unsigned long rts, bits, offset;
unsigned long gpa;
@@ -53,8 +54,8 @@ int kvmppc_mmu_radix_xlate(struct kvm_vcpu *vcpu, gva_t eaddr,
return -EINVAL;
/* Read partition table to find root of tree for effective PID */
- ret = kvm_read_guest(kvm, kvm->arch.process_table + pid * 16,
- &prte, sizeof(prte));
+ ptbl = (kvm->arch.process_table & PRTB_MASK) + (pid * 16);
+ ret = kvm_read_guest(kvm, ptbl, &prte, sizeof(prte));
if (ret)
return ret;