qemu-devel
[Top][All Lists]
Advanced

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

[Qemu-devel] target_phys_addr_t definition


From: Johannes Luber
Subject: [Qemu-devel] target_phys_addr_t definition
Date: Fri, 11 Sep 2009 11:39:13 +0200

Hi,

I've been looking through the sources and stumbled over targphys.h, which 
contains:

/* target_phys_addr_t is the type of a physical address (its size can
   be different from 'target_ulong'). We have sizeof(target_phys_addr)
   = max(sizeof(unsigned long),
   sizeof(size_of_target_physical_address)) because we must pass a
   host pointer to memory operations in some cases */

#if TARGET_PHYS_ADDR_BITS == 32
typedef uint32_t target_phys_addr_t;
#define TARGET_PHYS_ADDR_MAX UINT32_MAX
#define TARGET_FMT_plx "%08x"
#elif TARGET_PHYS_ADDR_BITS == 64
typedef uint64_t target_phys_addr_t;
#define TARGET_PHYS_ADDR_MAX UINT64_MAX
#define TARGET_FMT_plx "%016" PRIx64
#endif

The comment says "sizeof(target_phys_addr) = max(...)" yet I don't the actual 
definition depending on the host at all. This means that on 64 bit hosts things 
are going wrong. sizeof(uint32_t) will be always 4 and actually using 
sizeof(unsigned long) will still result on 64-bit Windows in 4, despite pointer 
having 8 bytes.

As the comment remarks this won't work with physical pointers which reference 
pages beyond the 4 GB limit (unless the pointers don't have always some high 
bits set). So my question is: Does Qemu support 64-bit compilation for hosts 
correctly?

Best regards,
Johannes
-- 
Neu: GMX Doppel-FLAT mit Internet-Flatrate + Telefon-Flatrate
für nur 19,99 Euro/mtl.!* http://portal.gmx.net/de/go/dsl02




reply via email to

[Prev in Thread] Current Thread [Next in Thread]