qemu-devel
[Top][All Lists]
Advanced

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

[Qemu-devel] Re: When should I use qemu_ram_alloc(), and how?


From: Blue Swirl
Subject: [Qemu-devel] Re: When should I use qemu_ram_alloc(), and how?
Date: Tue, 4 Nov 2008 21:14:47 +0200

On 11/4/08, address@hidden <address@hidden> wrote:
> Hi,
>  # Reusing thread, to video memory allocation related question.
>  Could you please give me answer to my question ?
>
>  Attached diff is for adding cirrus_vga onto r2d, for explanatin.
>  The point is here.
>  -    cpu_register_physical_memory(SDRAM_BASE, SDRAM_SIZE, 0);
>  +    r = qemu_ram_alloc(SDRAM_SIZE);
>  +    cpu_register_physical_memory(SDRAM_BASE, SDRAM_SIZE, r);

Well, I haven't been using qemu_ram_alloc on Sparc but instead used
direct offsets. Maybe I should convert. Also, all ram allocation
should be done using qemu_ram_alloc (especially system RAM), not just
some devices.

>  Apparently, r2d had not used qemu_ram_alloc() (it is working, though).
>  I added it here without knowing well about qemu memory system
>  (this one is working fine, too).
>
>  Maybe, allocation is needed always(even when without VGA), isn't it?

I don't think so, unallocated memory will be just unused.

>  Are there any restriction between alloced address and register address?
>  I am worried about it because PC seems to make them equal.

There are some code that assumes that CPU address for RAM can be
converted to host address using phys_ram_base + CPU address.

>  -    pci_register_io_region((PCIDevice *)d, 0, 0x2000000,
>  +    pci_register_io_region((PCIDevice *)d, 0, vga_ram_size,

To me this change looks OK, but I think it should be separate and the
PC folks should consider if it breaks something.




reply via email to

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