diff options
-rw-r--r-- | arch/powerpc/kvm/book3s_pr.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/arch/powerpc/kvm/book3s_pr.c b/arch/powerpc/kvm/book3s_pr.c index 642d88574b07..a657c44b7fbc 100644 --- a/arch/powerpc/kvm/book3s_pr.c +++ b/arch/powerpc/kvm/book3s_pr.c | |||
@@ -881,7 +881,8 @@ int kvm_vcpu_ioctl_get_one_reg(struct kvm_vcpu *vcpu, struct kvm_one_reg *reg) | |||
881 | 881 | ||
882 | switch (reg->id) { | 882 | switch (reg->id) { |
883 | case KVM_REG_PPC_HIOR: | 883 | case KVM_REG_PPC_HIOR: |
884 | r = put_user(to_book3s(vcpu)->hior, (u64 __user *)reg->addr); | 884 | r = copy_to_user((u64 __user *)(long)reg->addr, |
885 | &to_book3s(vcpu)->hior, sizeof(u64)); | ||
885 | break; | 886 | break; |
886 | default: | 887 | default: |
887 | break; | 888 | break; |
@@ -896,7 +897,8 @@ int kvm_vcpu_ioctl_set_one_reg(struct kvm_vcpu *vcpu, struct kvm_one_reg *reg) | |||
896 | 897 | ||
897 | switch (reg->id) { | 898 | switch (reg->id) { |
898 | case KVM_REG_PPC_HIOR: | 899 | case KVM_REG_PPC_HIOR: |
899 | r = get_user(to_book3s(vcpu)->hior, (u64 __user *)reg->addr); | 900 | r = copy_from_user(&to_book3s(vcpu)->hior, |
901 | (u64 __user *)(long)reg->addr, sizeof(u64)); | ||
900 | if (!r) | 902 | if (!r) |
901 | to_book3s(vcpu)->hior_explicit = true; | 903 | to_book3s(vcpu)->hior_explicit = true; |
902 | break; | 904 | break; |