Skip to content

Commit

Permalink
MIPS: KVM: Fix ptr->int cast via KVM_GUEST_KSEGX()
Browse files Browse the repository at this point in the history
kvm_mips_trans_replace() passes a pointer to KVM_GUEST_KSEGX(). This
breaks on 64-bit builds due to the cast of that 64-bit pointer to a
different sized 32-bit int. Cast the pointer argument to an unsigned
long to work around the warning.

Signed-off-by: James Hogan <james.hogan@imgtec.com>
Cc: Paolo Bonzini <pbonzini@redhat.com>
Cc: "Radim Krčmář" <rkrcmar@redhat.com>
Cc: Ralf Baechle <ralf@linux-mips.org>
Cc: linux-mips@linux-mips.org
Cc: kvm@vger.kernel.org
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
  • Loading branch information
James Hogan authored and Paolo Bonzini committed Aug 1, 2016
1 parent 172e02d commit 8296963
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion arch/mips/kvm/dyntrans.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ static int kvm_mips_trans_replace(struct kvm_vcpu *vcpu, u32 *opc,
unsigned long paddr, flags;
void *vaddr;

if (KVM_GUEST_KSEGX(opc) == KVM_GUEST_KSEG0) {
if (KVM_GUEST_KSEGX((unsigned long)opc) == KVM_GUEST_KSEG0) {
paddr = kvm_mips_translate_guest_kseg0_to_hpa(vcpu,
(unsigned long)opc);
vaddr = kmap_atomic(pfn_to_page(PHYS_PFN(paddr)));
Expand Down

0 comments on commit 8296963

Please sign in to comment.