KVM: PPC: Book3S: Compile fix for ppc32 in HIOR access code
authorAlexander Graf <agraf@suse.de>
Tue, 13 Mar 2012 18:59:39 +0000 (19:59 +0100)
committerVarun Wadekar <vwadekar@nvidia.com>
Wed, 18 Apr 2012 13:26:37 +0000 (18:26 +0530)
commite3f6d7c8197fa2753595a486b7716160f0eb1c7c
tree78d5c5582f15a89cbef551248287082fa3d11df7
parent9b92cc592465f30d9bb8a4e425ca06a0e2dbbe47
KVM: PPC: Book3S: Compile fix for ppc32 in HIOR access code

We were failing to compile on book3s_32 with the following errors:

arch/powerpc/kvm/book3s_pr.c:883:45: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast]
arch/powerpc/kvm/book3s_pr.c:898:79: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast]

Fix this by explicity casting the u64 to long before we use it as a pointer.

Also, on PPC32 we can not use get_user/put_user for 64bit wide variables,
as there is no single instruction that could load or store variables that big.

So instead, we have to use copy_from/to_user which works everywhere.

Reported-by: Jörg Sommer <joerg@alea.gnuu.de>
Signed-off-by: Alexander Graf <agraf@suse.de>
Signed-off-by: Paul Mackerras <paulus@samba.org>
arch/powerpc/kvm/book3s_pr.c