Skip to content

Commit

Permalink
KVM: PPC: Deflect page write faults properly in kvmppc_st
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
agraf committed Jul 28, 2014
1 parent 1287cb3 commit 17824b5
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions arch/powerpc/kvm/book3s.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down

0 comments on commit 17824b5

Please sign in to comment.