Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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: Alexander Graf <agraf@suse.de>

v2 -> v3:

- RMO -> PAM (non-magic page)
Signed-off-by: Avi Kivity <avi@redhat.com>

authored by

Alexander Graf and committed by
Avi Kivity
28e83b4f 90bba358

+5 -2
+3
arch/powerpc/include/asm/kvm_host.h
··· 48 48 #define HPTEG_HASH_NUM_VPTE (1 << HPTEG_HASH_BITS_VPTE) 49 49 #define HPTEG_HASH_NUM_VPTE_LONG (1 << HPTEG_HASH_BITS_VPTE_LONG) 50 50 51 + /* Physical Address Mask - allowed range of real mode RAM access */ 52 + #define KVM_PAM 0x0fffffffffffffffULL 53 + 51 54 struct kvm; 52 55 struct kvm_run; 53 56 struct kvm_vcpu;
+2 -2
arch/powerpc/kvm/book3s.c
··· 465 465 r = vcpu->arch.mmu.xlate(vcpu, eaddr, pte, data); 466 466 } else { 467 467 pte->eaddr = eaddr; 468 - pte->raddr = eaddr & 0xffffffff; 468 + pte->raddr = eaddr & KVM_PAM; 469 469 pte->vpage = VSID_REAL | eaddr >> 12; 470 470 pte->may_read = true; 471 471 pte->may_write = true; ··· 579 579 pte.may_execute = true; 580 580 pte.may_read = true; 581 581 pte.may_write = true; 582 - pte.raddr = eaddr & 0xffffffff; 582 + pte.raddr = eaddr & KVM_PAM; 583 583 pte.eaddr = eaddr; 584 584 pte.vpage = eaddr >> 12; 585 585 }