qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH] hw/core/generic-loader: Fix PC overwriting


From: Alistair Francis
Subject: Re: [Qemu-devel] [PATCH] hw/core/generic-loader: Fix PC overwriting
Date: Tue, 15 Jan 2019 13:51:05 -0800

On Tue, Jan 15, 2019 at 7:04 AM Julia Suvorova via Qemu-devel
<address@hidden> wrote:
>
> 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.

How does this come up?
I see that the value of entry will force overwrite the PC addr, but
doesn't force_raw fix that? Is there a common use case of loading an
ELF/uimage but having to manually specify a start address?

Alistair

>
> Signed-off-by: Julia Suvorova <address@hidden>
> ---
>  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
>
>



reply via email to

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