diff options
author | Alexander Graf <agraf@suse.de> | 2014-06-11 12:34:19 +0400 |
---|---|---|
committer | Alexander Graf <agraf@suse.de> | 2014-07-28 17:22:22 +0400 |
commit | 02407552256111479fbfd23a3e01218b399aaa35 (patch) | |
tree | a1a198730d3eaf1fef4d7b8fd6741482a76004fa /arch/powerpc/kvm/book3s_hv_ras.c | |
parent | 6f22bd3265fb542acb2697026b953ec07298242d (diff) | |
download | linux-02407552256111479fbfd23a3e01218b399aaa35.tar.xz |
KVM: PPC: Book3S HV: Access guest VPA in BE
There are a few shared data structures between the host and the guest. Most
of them get registered through the VPA interface.
These data structures are defined to always be in big endian byte order, so
let's make sure we always access them in big endian.
Signed-off-by: Alexander Graf <agraf@suse.de>
Diffstat (limited to 'arch/powerpc/kvm/book3s_hv_ras.c')
-rw-r--r-- | arch/powerpc/kvm/book3s_hv_ras.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/arch/powerpc/kvm/book3s_hv_ras.c b/arch/powerpc/kvm/book3s_hv_ras.c index 3a5c568b1e89..d562c8e2bc30 100644 --- a/arch/powerpc/kvm/book3s_hv_ras.c +++ b/arch/powerpc/kvm/book3s_hv_ras.c @@ -45,14 +45,14 @@ static void reload_slb(struct kvm_vcpu *vcpu) return; /* Sanity check */ - n = min_t(u32, slb->persistent, SLB_MIN_SIZE); + n = min_t(u32, be32_to_cpu(slb->persistent), SLB_MIN_SIZE); if ((void *) &slb->save_area[n] > vcpu->arch.slb_shadow.pinned_end) return; /* Load up the SLB from that */ for (i = 0; i < n; ++i) { - unsigned long rb = slb->save_area[i].esid; - unsigned long rs = slb->save_area[i].vsid; + unsigned long rb = be64_to_cpu(slb->save_area[i].esid); + unsigned long rs = be64_to_cpu(slb->save_area[i].vsid); rb = (rb & ~0xFFFul) | i; /* insert entry number */ asm volatile("slbmte %0,%1" : : "r" (rs), "r" (rb)); |