Commit 28e83b4f authored by Alexander Graf's avatar Alexander Graf Committed by Avi Kivity

KVM: PPC: Make PAM a define

On PowerPC it's very normal to not support all of the physical RAM in real mode.
To check if we're matching on the shared page or not, we need to know the limits
so we can restrain ourselves to that range.

So let's make it a define instead of open-coding it. And while at it, let's also
increase it.
Signed-off-by: default avatarAlexander Graf <agraf@suse.de>

v2 -> v3:

  - RMO -> PAM (non-magic page)
Signed-off-by: default avatarAvi Kivity <avi@redhat.com>
parent 90bba358
...@@ -48,6 +48,9 @@ ...@@ -48,6 +48,9 @@
#define HPTEG_HASH_NUM_VPTE (1 << HPTEG_HASH_BITS_VPTE) #define HPTEG_HASH_NUM_VPTE (1 << HPTEG_HASH_BITS_VPTE)
#define HPTEG_HASH_NUM_VPTE_LONG (1 << HPTEG_HASH_BITS_VPTE_LONG) #define HPTEG_HASH_NUM_VPTE_LONG (1 << HPTEG_HASH_BITS_VPTE_LONG)
/* Physical Address Mask - allowed range of real mode RAM access */
#define KVM_PAM 0x0fffffffffffffffULL
struct kvm; struct kvm;
struct kvm_run; struct kvm_run;
struct kvm_vcpu; struct kvm_vcpu;
......
...@@ -465,7 +465,7 @@ static int kvmppc_xlate(struct kvm_vcpu *vcpu, ulong eaddr, bool data, ...@@ -465,7 +465,7 @@ static int kvmppc_xlate(struct kvm_vcpu *vcpu, ulong eaddr, bool data,
r = vcpu->arch.mmu.xlate(vcpu, eaddr, pte, data); r = vcpu->arch.mmu.xlate(vcpu, eaddr, pte, data);
} else { } else {
pte->eaddr = eaddr; pte->eaddr = eaddr;
pte->raddr = eaddr & 0xffffffff; pte->raddr = eaddr & KVM_PAM;
pte->vpage = VSID_REAL | eaddr >> 12; pte->vpage = VSID_REAL | eaddr >> 12;
pte->may_read = true; pte->may_read = true;
pte->may_write = true; pte->may_write = true;
...@@ -579,7 +579,7 @@ int kvmppc_handle_pagefault(struct kvm_run *run, struct kvm_vcpu *vcpu, ...@@ -579,7 +579,7 @@ int kvmppc_handle_pagefault(struct kvm_run *run, struct kvm_vcpu *vcpu,
pte.may_execute = true; pte.may_execute = true;
pte.may_read = true; pte.may_read = true;
pte.may_write = true; pte.may_write = true;
pte.raddr = eaddr & 0xffffffff; pte.raddr = eaddr & KVM_PAM;
pte.eaddr = eaddr; pte.eaddr = eaddr;
pte.vpage = eaddr >> 12; pte.vpage = eaddr >> 12;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment