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: takasi-y
Subject: [Qemu-devel] Re: When should I use qemu_ram_alloc(), and how?
Date: Wed, 5 Nov 2008 22:29:29 +0900 (JST)

Thank you!

> 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.
I come to know why yours and my case worked fine even without using
 qemu_ram_alloc(). What important was offset(phys_ram_alloc_offset).
Anyway I will use qemu_ram_alloc() to maintain the offset.

> >  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.
Ah, finally I came to know what a comment at allocating BIOS in pc.c says.
It means that When memory layout is like "32M(ROM)+32M(blank)+64M(RAM)"
I have to allocate 32M blank(without registering) to keep offset between
host and (emulated)CPU address consistent.

> >  -    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.
Ah, sorry. I have attached the patch to aid explanation. But I think it
can not be merged into main repository. (Unfortunately?) real cirrus VGA
claims 32M memory regardless with VRAM size. So, if I modified the
code, it will be an emulation of something not really exists.

/yoshii




reply via email to

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