qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH 2/2] pc: Fix RTC CMOS info on RAM for ram_size <


From: Markus Armbruster
Subject: Re: [Qemu-devel] [PATCH 2/2] pc: Fix RTC CMOS info on RAM for ram_size < 1MiB
Date: Wed, 15 Aug 2012 10:23:16 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.1 (gnu/linux)

Blue Swirl <address@hidden> writes:

> On Tue, Aug 14, 2012 at 11:58 AM, Markus Armbruster <address@hidden> wrote:
>> pc_cmos_init() always claims 640KiB base memory, and ram_size - 1MiB
>> extended memory.  The latter can underflow to "lots of extended
>> memory".  Fix both, and clean up some.
>>
>> Note: SeaBIOS currently requires 1MiB of RAM, and doesn't check
>> whether it got enough.
>>
>> Signed-off-by: Markus Armbruster <address@hidden>
>> ---
>>  hw/pc.c | 27 +++++++++++++++------------
>>  1 file changed, 15 insertions(+), 12 deletions(-)
>>
>> diff --git a/hw/pc.c b/hw/pc.c
>> index e8bcfc0..1597fe6 100644
>> --- a/hw/pc.c
>> +++ b/hw/pc.c
>> @@ -337,32 +337,35 @@ void pc_cmos_init(ram_addr_t ram_size, ram_addr_t 
>> above_4g_mem_size,
>>      /* various important CMOS locations needed by PC/Bochs bios */
>>
>>      /* memory size */
>> -    val = 640; /* base memory in K */
>> +    /* base memory (first MiB) */
>> +    val = MIN(ram_size / 1024, 640);
>>      rtc_set_memory(s, 0x15, val);
>>      rtc_set_memory(s, 0x16, val >> 8);
>> -
>> -    val = (ram_size / 1024) - 1024;
>> +    /* extended memory (next 64MiB) */
>> +    if (ram_size > 1024 * 1024)
>
> Please add braces.

Done in v2.

[...]



reply via email to

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