qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] hw/core/generic-loader: Fix PC overwriting
@ 2019-01-15 14:36 Julia Suvorova
  2019-01-15 21:51 ` Alistair Francis
                   ` (2 more replies)
  0 siblings, 3 replies; 12+ messages in thread
From: Julia Suvorova @ 2019-01-15 14:36 UTC (permalink / raw)
  To: qemu-devel; +Cc: Peter Maydell, Alistair Francis, Julia Suvorova

If the memory is set using a file, and PC is specified on the command
line, it will be overwritten with the value 'entry'. This is not only
illogical, but also incorrect, because the load_ * functions do not take
into account the specifics of the ARM-M PC.

Signed-off-by: Julia Suvorova <jusual@mail.ru>
---
 hw/core/generic-loader.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/hw/core/generic-loader.c b/hw/core/generic-loader.c
index fbae05fb3b..fc81fd8e14 100644
--- a/hw/core/generic-loader.c
+++ b/hw/core/generic-loader.c
@@ -152,7 +152,7 @@ static void generic_loader_realize(DeviceState *dev, Error **errp)
         if (size < 0 || s->force_raw) {
             /* Default to the maximum size being the machine's ram size */
             size = load_image_targphys_as(s->file, s->addr, ram_size, as);
-        } else {
+        } else if (!s->addr) {
             s->addr = entry;
         }
 
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2019-01-22 19:14 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-01-15 14:36 [Qemu-devel] [PATCH] hw/core/generic-loader: Fix PC overwriting Julia Suvorova
2019-01-15 21:51 ` Alistair Francis
2019-01-16 19:05   ` Julia Suvorova
2019-01-17 10:13     ` Stefan Hajnoczi
2019-01-17 10:58       ` Julia Suvorova
2019-01-17 19:27         ` Peter Maydell
2019-01-17 19:55           ` Peter Maydell
2019-01-21 17:24           ` Peter Maydell
2019-01-22 13:59             ` Julia Suvorova
2019-01-22 14:58               ` Peter Maydell
2019-01-21  3:11 ` no-reply
2019-01-21  3:22 ` no-reply

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).