[Top][All Lists]
[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
- Re: [Qemu-devel] [PATCH] SM501 emulation for R2D-SH4, (continued)
- Re: [Qemu-devel] [PATCH] SM501 emulation for R2D-SH4, Blue Swirl, 2008/11/02
- Re: [Qemu-devel] [PATCH] SM501 emulation for R2D-SH4, Shin-ichiro KAWASAKI, 2008/11/04
- Re: [Qemu-devel] [PATCH] SM501 emulation for R2D-SH4, Blue Swirl, 2008/11/04
- [Qemu-devel] [PATCH] [RESEND] SM501 emulation for R2D-SH4, Shin-ichiro KAWASAKI, 2008/11/05
- Re: [Qemu-devel] [PATCH] [RESEND] SM501 emulation for R2D-SH4, Blue Swirl, 2008/11/05
- Re: [Qemu-devel] [PATCH] [RESEND] SM501 emulation for R2D-SH4, andrzej zaborowski, 2008/11/05
- Re: [Qemu-devel] [PATCH] [RESEND] SM501 emulation for R2D-SH4, Blue Swirl, 2008/11/05
[Qemu-devel] When should I use qemu_ram_alloc(), and how?, takasi-y, 2008/11/04