From: Julia Suvorova <jusual@mail.ru>
To: qemu-devel@nongnu.org
Cc: Peter Maydell <peter.maydell@linaro.org>,
Alistair Francis <alistair@alistair23.me>,
Julia Suvorova <jusual@mail.ru>
Subject: [Qemu-devel] [PATCH] hw/core/generic-loader: Fix PC overwriting
Date: Tue, 15 Jan 2019 17:36:50 +0300 [thread overview]
Message-ID: <20190115143650.15725-1-jusual@mail.ru> (raw)
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
next reply other threads:[~2019-01-15 14:37 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-01-15 14:36 Julia Suvorova [this message]
2019-01-15 21:51 ` [Qemu-devel] [PATCH] hw/core/generic-loader: Fix PC overwriting 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
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=20190115143650.15725-1-jusual@mail.ru \
--to=jusual@mail.ru \
--cc=alistair@alistair23.me \
--cc=peter.maydell@linaro.org \
--cc=qemu-devel@nongnu.org \
/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).