qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH] arm highbank: force ramsize to INT_MAX when loa


From: Alexander Graf
Subject: Re: [Qemu-devel] [PATCH] arm highbank: force ramsize to INT_MAX when loading
Date: Fri, 9 Mar 2012 19:22:43 +0100

On 09.03.2012, at 17:40, Mark Langsdorf wrote:

> On 03/09/2012 10:13 AM, Peter Maydell wrote:
>> On 9 March 2012 15:57, Mark Langsdorf <address@hidden> wrote:
>>> Since the ram_size field of arm_boot_info is only an int, don't set
>>> that field to more than INT_MAX. Signed vs unsigned comparison
>>> overruns are possible otherwise.
>> 
>> Can't we just make arm_boot_info.ram_size a uint32_t (propagating through
>> signedness fixes as required) ?
>> 
>> Actually it should probably be a target_phys_addr_t, thinking ahead
>> to adding LPAE support.
> 
> It really should be a size_t, per the upthread discussion with Andreas
> Faerber.

No, Andreas is wrong. Host data types have nothing to do in target ram fiddling 
code. The type you're searching for is "the size of physical address space the 
guest can handle" and that's target_phys_addr_t. Period.


Alex




reply via email to

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