Commit ffada016 authored by Cédric Le Goater's avatar Cédric Le Goater Committed by Alexander Graf

KVM: PPC: Book3S HV: ptes are big endian

When being restored from qemu, the kvm_get_htab_header are in native
endian, but the ptes are big endian.

This patch fixes restore on a KVM LE host. Qemu also needs a fix for
this :

     http://lists.nongnu.org/archive/html/qemu-ppc/2014-11/msg00008.htmlSigned-off-by: default avatarCédric Le Goater <clg@fr.ibm.com>
Signed-off-by: default avatarAlexander Graf <agraf@suse.de>
parent 5b88cda6
...@@ -1542,9 +1542,15 @@ static ssize_t kvm_htab_write(struct file *file, const char __user *buf, ...@@ -1542,9 +1542,15 @@ static ssize_t kvm_htab_write(struct file *file, const char __user *buf,
hptp = (__be64 *)(kvm->arch.hpt_virt + (i * HPTE_SIZE)); hptp = (__be64 *)(kvm->arch.hpt_virt + (i * HPTE_SIZE));
lbuf = (unsigned long __user *)buf; lbuf = (unsigned long __user *)buf;
for (j = 0; j < hdr.n_valid; ++j) { for (j = 0; j < hdr.n_valid; ++j) {
__be64 hpte_v;
__be64 hpte_r;
err = -EFAULT; err = -EFAULT;
if (__get_user(v, lbuf) || __get_user(r, lbuf + 1)) if (__get_user(hpte_v, lbuf) ||
__get_user(hpte_r, lbuf + 1))
goto out; goto out;
v = be64_to_cpu(hpte_v);
r = be64_to_cpu(hpte_r);
err = -EINVAL; err = -EINVAL;
if (!(v & HPTE_V_VALID)) if (!(v & HPTE_V_VALID))
goto out; goto out;
......
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