[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v3 07/14] loader: support for unmapped ROM blobs
From: |
Gerd Hoffmann |
Subject: |
Re: [Qemu-devel] [PATCH v3 07/14] loader: support for unmapped ROM blobs |
Date: |
Thu, 25 Jul 2013 14:43:53 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130621 Thunderbird/17.0.7 |
On 07/25/13 14:28, Michael S. Tsirkin wrote:
> On Thu, Jul 25, 2013 at 02:14:40PM +0200, Gerd Hoffmann wrote:
>> On 07/24/13 18:01, Michael S. Tsirkin wrote:
>>> QTAILQ_FOREACH(rom, &roms, next) {
>>> + if (rom->mr) {
>>> + continue;
>>> + }
>>> if (rom->fw_file) {
>>> continue;
>>> }
>>> if (rom->data == NULL) {
>>> continue;
>>> }
>>> - cpu_physical_memory_write_rom(rom->addr, rom->data, rom->datasize);
>>> + if (rom->mr) {
>>> + void *host = memory_region_get_ram_ptr(rom->mr);
>>> + memcpy(host, rom->data, rom->datasize);
>>
>> I think this code never ever runs ...
>>
>> cheers,
>> Gerd
>>
>
>
> Could you be clearer please? This chunk is in rom_reset,
> I think it runs on reset.
You have the "if (rom->mr)" twice in the loop. The first does continue
so the second will never ever evaluate to true, thereby making the
memcpy dead code.
cheers,
Gerd
[Qemu-devel] [PATCH v3 05/14] loader: use file path size from fw_cfg.h, Michael S. Tsirkin, 2013/07/24
[Qemu-devel] [PATCH v3 08/14] loader: allow adding ROMs in done callbacks, Michael S. Tsirkin, 2013/07/24
[Qemu-devel] [PATCH v3 09/14] i386: define pc guest info, Michael S. Tsirkin, 2013/07/24