qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Anthony Liguori <aliguori@us.ibm.com>
To: Fabrice Bellard <fabrice@bellard.org>
Cc: kvm-devel@lists.sourceforge.net, qemu-devel@nongnu.org,
	Paul Brook <paul@codesourcery.com>
Subject: [Qemu-devel] Re: [PATCH 1/6] Use correct types to enable > 2G support
Date: Fri, 01 Feb 2008 08:35:44 -0600	[thread overview]
Message-ID: <47A32E40.3000204@us.ibm.com> (raw)
In-Reply-To: <47A2F3C7.6060409@bellard.org>

Fabrice Bellard wrote:
> Anthony Liguori wrote:
>> +    /* above 4giga memory allocation */
>> +    if (above_4g_mem_size > 0) {
>> +        ram_addr = qemu_ram_alloc(above_4g_mem_size);
>> +        cpu_register_physical_memory(0x100000000, above_4g_mem_size, 
>> ram_addr);
>> +    }
>> +
>
> Why do you need this ? All the RAM can be registered with a single 
> call.  I fear you need to do that because of KVM RAM handling 
> limitations.

On the x86, there is a rather large hole at the top of memory.  
Currently, we do separate allocations around this whole.    You can't 
get away from doing multiple cpu_register_physical_memory calls here.  
We've discussed just allocating a single chunk with qemu_ram_alloc since 
so many places in QEMU assume that you can do phys_ram_base + PA.

I think I'll change this too into a single qemu_ram_alloc.  That will 
fix the bug with KVM when using -kernel and large memory anyway :-)

>> Index: qemu/osdep.c
>> ===================================================================
>> --- qemu.orig/osdep.c    2008-01-30 13:47:00.000000000 -0600
>> +++ qemu/osdep.c    2008-01-30 13:47:31.000000000 -0600
>> @@ -113,7 +113,7 @@
>>              int64_t free_space;
>>              int ram_mb;
>>  
>> -            extern int ram_size;
>> +            extern int64_t ram_size;
>>              free_space = (int64_t)stfs.f_bavail * stfs.f_bsize;
>>              if ((ram_size + 8192 * 1024) >= free_space) {
>>                  ram_mb = (ram_size / (1024 * 1024));
>> @@ -202,7 +202,7 @@
>>  #ifdef _BSD
>>      return valloc(size);
>>  #else
>> -    return memalign(4096, size);
>> +    return memalign(TARGET_PAGE_SIZE, size);
>>  #endif
>>  }
>
> No fully correct because it is intended to be the host page size.

Indeed.  I'm dropping this.  It was added for the ia64 port and since 
that's not included in this patch set, I'll let them fix it properly 
when they submit support for ia64.

>> +extern int64_t ram_size;
>
> I agree with the fact that ram_size should be 64 bit. Maybe each 
> machine could test the value and emit an error message if it is too 
> big. Maybe an uint64_t would be better though.

uint64_t is probably more reasonable.  I wouldn't begin to know what the 
appropriate amount of ram was for each machine though so I'll let the 
appropriate people handle that :-)

Regards,

Anthony Liguori

> Fabrice.

  reply	other threads:[~2008-02-01 14:36 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-01-31 22:36 [Qemu-devel] [PATCH 0/6] Support for the Kernel Virtual Machine interface Anthony Liguori
2008-01-31 22:36 ` [Qemu-devel] [PATCH 1/6] Use correct types to enable > 2G support Anthony Liguori
2008-01-31 23:54   ` [Qemu-devel] " Paul Brook
2008-02-01  0:25     ` Anthony Liguori
2008-02-01  0:37       ` Paul Brook
2008-02-01  0:40         ` Anthony Liguori
2008-02-01 10:26   ` Fabrice Bellard
2008-02-01 14:35     ` Anthony Liguori [this message]
2008-02-01 15:13       ` Avi Kivity
2008-02-01 11:56         ` Robert William Fuller
2008-02-01 16:09           ` M. Warner Losh
2008-02-01 16:47             ` Philip Boulain
2008-02-01 17:35           ` Jamie Lokier
2008-02-01 15:33         ` [Qemu-devel] Re: [kvm-devel] " Anthony Liguori
2008-02-01 15:40           ` Ian Jackson
2008-02-01 17:53             ` [kvm-devel] [Qemu-devel] " Anthony Liguori
2008-02-01 17:57               ` Daniel P. Berrange
2008-02-01 20:31                 ` Anthony Liguori
2008-02-01 21:33                   ` Paul Brook
2008-02-01 16:00       ` Paul Brook
2008-02-01 16:21         ` Fabrice Bellard
2008-02-05 11:34           ` Ian Jackson
2008-02-01 17:49         ` [Qemu-devel] Re: [kvm-devel] " Anthony Liguori
2008-02-03  8:58   ` Izik Eidus
2008-01-31 22:36 ` [Qemu-devel] [PATCH 2/6] SCI fixes Anthony Liguori
2008-01-31 22:36 ` [Qemu-devel] [PATCH 3/6] Fix daemonize options Anthony Liguori
2008-01-31 22:36 ` [Qemu-devel] [PATCH 4/6] Tell BIOS about the number of CPUs Anthony Liguori
2008-02-01  0:14   ` [Qemu-devel] " Paul Brook
2008-02-01  0:28     ` Anthony Liguori
2008-02-01  0:40       ` Paul Brook
2008-01-31 22:36 ` [Qemu-devel] [PATCH 5/6] Refactor option ROM loading Anthony Liguori
2008-01-31 22:36 ` [Qemu-devel] [PATCH 6/6] QEMU support for the Kernel Virtual Machine interface Anthony Liguori
2008-02-01  9:49   ` [Qemu-devel] " Fabrice Bellard
2008-02-01 14:18     ` Anthony Liguori
2008-01-31 22:53 ` [qemu-devel] [PATCH 0/6] Support " Anthony Liguori

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=47A32E40.3000204@us.ibm.com \
    --to=aliguori@us.ibm.com \
    --cc=fabrice@bellard.org \
    --cc=kvm-devel@lists.sourceforge.net \
    --cc=paul@codesourcery.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).