From: "Blue Swirl" <blauwirbel@gmail.com>
To: "takasi-y@ops.dti.ne.jp" <takasi-y@ops.dti.ne.jp>
Cc: qemu-devel@nongnu.org
Subject: [Qemu-devel] Re: When should I use qemu_ram_alloc(), and how?
Date: Tue, 4 Nov 2008 21:14:47 +0200 [thread overview]
Message-ID: <f43fc5580811041114v3ff74305md4a287d67f3cc13e@mail.gmail.com> (raw)
In-Reply-To: <200811041527.mA4FRPo2005575@smtp12.dti.ne.jp>
On 11/4/08, takasi-y@ops.dti.ne.jp <takasi-y@ops.dti.ne.jp> 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.
next prev parent reply other threads:[~2008-11-04 19:14 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-11-02 2:12 [Qemu-devel] [PATCH] SM501 emulation for R2D-SH4 Shin-ichiro KAWASAKI
2008-11-02 3:27 ` andrzej zaborowski
2008-11-04 14:31 ` Shin-ichiro KAWASAKI
2008-11-02 6:52 ` Blue Swirl
2008-11-04 15:10 ` Shin-ichiro KAWASAKI
2008-11-04 19:11 ` Blue Swirl
2008-11-05 17:09 ` [Qemu-devel] [PATCH] [RESEND] " Shin-ichiro KAWASAKI
2008-11-05 18:25 ` Blue Swirl
2008-11-05 20:13 ` andrzej zaborowski
2008-11-05 20:26 ` Blue Swirl
2008-11-04 15:27 ` [Qemu-devel] When should I use qemu_ram_alloc(), and how? takasi-y
2008-11-04 19:14 ` Blue Swirl [this message]
2008-11-04 19:32 ` [Qemu-devel] " Anthony Liguori
2008-11-05 13:29 ` takasi-y
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=f43fc5580811041114v3ff74305md4a287d67f3cc13e@mail.gmail.com \
--to=blauwirbel@gmail.com \
--cc=qemu-devel@nongnu.org \
--cc=takasi-y@ops.dti.ne.jp \
/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).