Skip to content

Commit 8296963

Browse files
James Hoganbonzini
authored andcommitted
MIPS: KVM: Fix ptr->int cast via KVM_GUEST_KSEGX()
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>
1 parent 172e02d commit 8296963

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

arch/mips/kvm/dyntrans.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ static int kvm_mips_trans_replace(struct kvm_vcpu *vcpu, u32 *opc,
3333
unsigned long paddr, flags;
3434
void *vaddr;
3535

36-
if (KVM_GUEST_KSEGX(opc) == KVM_GUEST_KSEG0) {
36+
if (KVM_GUEST_KSEGX((unsigned long)opc) == KVM_GUEST_KSEG0) {
3737
paddr = kvm_mips_translate_guest_kseg0_to_hpa(vcpu,
3838
(unsigned long)opc);
3939
vaddr = kmap_atomic(pfn_to_page(PHYS_PFN(paddr)));

0 commit comments

Comments
 (0)