qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PULL 17/43] loader: support for unmapped ROM blobs


From: Michael S. Tsirkin
Subject: Re: [Qemu-devel] [PULL 17/43] loader: support for unmapped ROM blobs
Date: Sat, 9 Nov 2013 19:21:24 +0200

On Fri, Nov 08, 2013 at 01:54:18AM +0100, Alexander Graf wrote:
> 
> On 14.10.2013, at 16:58, Michael S. Tsirkin <address@hidden> wrote:
> 
> > Support ROM blobs not mapped into guest memory:
> > same as ROM files really but use caller's buffer.
> > 
> > Support invoking callback on access and
> > return memory pointer making it easier
> > for caller to update memory if necessary.
> > 
> > Reviewed-by: Gerd Hoffmann <address@hidden>
> > Tested-by: Gerd Hoffmann <address@hidden>
> > Reviewed-by: Laszlo Ersek <address@hidden>
> > Reviewed-by: Igor Mammedov <address@hidden>
> > Tested-by: Igor Mammedov <address@hidden>
> > Signed-off-by: Michael S. Tsirkin <address@hidden>
> 
> This patch breaks -M bamboo. Let explain inline why.

Thanks a lot for the report and the explanation.
rom_add_blob never fails, so I think it's
easiest to just avoid checking the return value.
If we do, we can remove the return value from rom_add_blob_fixed, too.

Could you please confirm that the below helps?

-->

loader: drop return value for rom_add_blob_fixed

rom_add_blob never fails, and neither does rom_add_blob_fixed,
so there's no need to return value from it.

In fact, rom_add_blob_fixed was erroneously returning -1 unconditionally
which made the only system that checked the return value -M bamboo fail
to start.

Drop the return value and drop checks from ppc440_bamboo to
fix this failure.

Reported-by: Alexander Graf <address@hidden>
Signed-off-by: Michael S. Tsirkin <address@hidden>

---

diff --git a/include/hw/loader.h b/include/hw/loader.h
index 58eca98..7a23d6b 100644
--- a/include/hw/loader.h
+++ b/include/hw/loader.h
@@ -55,7 +55,7 @@ void do_info_roms(Monitor *mon, const QDict *qdict);
 #define rom_add_file_fixed(_f, _a, _i)          \
     rom_add_file(_f, NULL, _a, _i)
 #define rom_add_blob_fixed(_f, _b, _l, _a)      \
-    (rom_add_blob(_f, _b, _l, _a, NULL, NULL, NULL) ? 0 : -1)
+    rom_add_blob(_f, _b, _l, _a, NULL, NULL, NULL)
 
 #define PC_ROM_MIN_VGA     0xc0000
 #define PC_ROM_MIN_OPTION  0xc8000
diff --git a/hw/ppc/ppc440_bamboo.c b/hw/ppc/ppc440_bamboo.c
index 655e499..67597df 100644
--- a/hw/ppc/ppc440_bamboo.c
+++ b/hw/ppc/ppc440_bamboo.c
@@ -110,8 +110,9 @@ static int bamboo_load_device_tree(hwaddr addr,
     qemu_devtree_setprop_cell(fdt, "/cpus/address@hidden", 
"timebase-frequency",
                               tb_freq);
 
-    ret = rom_add_blob_fixed(BINARY_DEVICE_TREE_FILE, fdt, fdt_size, addr);
+    rom_add_blob_fixed(BINARY_DEVICE_TREE_FILE, fdt, fdt_size, addr);
     g_free(fdt);
+    return 0;
 
 out:
 



reply via email to

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