Re: [PATCH] kvm tools: Fix type mismatches on GCC 4.4 on 32-bit systems

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



* Sasha Levin <levinsasha928@xxxxxxxxx> wrote:

> On Fri, 2011-05-13 at 10:19 +0200, Ingo Molnar wrote:
> > FYI, the tools/kvm build still fails on 32-bit:
> > 
> >  cc1: warnings being treated as errors
> >  qcow.c: In function âqcow1_write_sectorâ:
> >  qcow.c:307: error: comparison between signed and unsigned integer expressions
> >  make: *** [qcow.o] Error 1
> >  make: *** Waiting for unfinished jobs....
> > 
> > using:
> > 
> >  gcc version 4.4.4 20100630 (Red Hat 4.4.4-10) (GCC)
> > 
> > The patch below addresses them but i haven't tested it beyond checking that it 
> > builds.
> > 
> > The double cast of userspace_addr is doubly sad - it highlights our 32-bitness 
> > problems which are visible in the guest_pfn_to_host() function as well.
> 
> KVM API uses 64-bit addresses no matter the host bitness, so we can't
> really get around doing these sort of casts.

that bit is OK - the KVM ABI has to be for the largest bit width.

Note that this kind of ABI compatibility allows (in theory) to run a 32-bit kvm 
binary on a 64-bit kernel, and still everything would work despite hypervisor 
user-space being 32-bit.

So the cast to (unsigned long) is fine and clean.

Thanks,

	Ingo
--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux