summaryrefslogtreecommitdiffstats
path: root/arch/powerpc/kvm
diff options
context:
space:
mode:
authorAlexander Graf <agraf@suse.de>2014-07-10 19:19:35 +0200
committerAlexander Graf <agraf@suse.de>2014-07-28 15:23:10 +0200
commit17824b5afcf273f6fc3e04df2d2a9d90d5c864fd (patch)
treee14a6a7852f16fd0b68b3339c43ed042bf514856 /arch/powerpc/kvm
parent1287cb3fa85cd4a0d18402f6a23e1d4c6a9d7b8b (diff)
KVM: PPC: Deflect page write faults properly in kvmppc_st
When we have a page that we're not allowed to write to, xlate() will already tell us -EPERM on lookup of that page. With the code as is we change it into a "page missing" error which a guest may get confused about. Instead, just tell the caller about the -EPERM directly. This fixes Mac OS X guests when run with DCBZ32 emulation. Signed-off-by: Alexander Graf <agraf@suse.de>
Diffstat (limited to 'arch/powerpc/kvm')
-rw-r--r--arch/powerpc/kvm/book3s.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/arch/powerpc/kvm/book3s.c b/arch/powerpc/kvm/book3s.c
index bd75902b38ba..9624c5644103 100644
--- a/arch/powerpc/kvm/book3s.c
+++ b/arch/powerpc/kvm/book3s.c
@@ -418,11 +418,13 @@ int kvmppc_st(struct kvm_vcpu *vcpu, ulong *eaddr, int size, void *ptr,
bool data)
{
struct kvmppc_pte pte;
+ int r;
vcpu->stat.st++;
- if (kvmppc_xlate(vcpu, *eaddr, data, true, &pte))
- return -ENOENT;
+ r = kvmppc_xlate(vcpu, *eaddr, data, true, &pte);
+ if (r < 0)
+ return r;
*eaddr = pte.raddr;