qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Damien Hedde <damien.hedde@greensocs.com>
To: Peter Maydell <peter.maydell@linaro.org>
Cc: "Alistair Francis" <alistair23@gmail.com>,
	"Philippe Mathieu-Daudé" <philmd@redhat.com>,
	qemu-devel@nongnu.org
Subject: Re: [PATCH v2] generic-loader: check that binary file target location exists
Date: Tue, 2 Nov 2021 15:38:23 +0100	[thread overview]
Message-ID: <024819b5-6108-9d08-6cbc-be3394b57548@greensocs.com> (raw)
In-Reply-To: <CAFEAcA8WbkD_HiAeykSyFPwoGLmOJce_gqFSmF9q9kXvNtsB4Q@mail.gmail.com>



On 11/2/21 15:15, Peter Maydell wrote:
> On Tue, 2 Nov 2021 at 14:04, Damien Hedde <damien.hedde@greensocs.com> wrote:
>>
>>
>>
>> On 11/1/21 11:53, Peter Maydell wrote:
>>> Won't this break the case of loading a file that spans two
>>> consecutive-but-different memory regions ?
>>
>> yes. I did not thought about that.
>>
>>>                                             I think if we want
>>> to catch "we tried to load something to an address not backed
>>> by something" we should do that by making load_image_targetphys_as()
>>> correctly handle errors from the memory accesses it makes and
>>> propagate an error-return to the caller.
>>>
>>
>> The problem is that load_image_targetphys_as() just uses rom_load_...().
>> And these macros/functions only put some "rom to load" objects in a list
>> without doing any real accesses.
> 
> Oh yes, I'd forgotten that this was all using the rom blob
> mechanism underneath.
> 
> I think in that case that whatever we do we should aim
> to be consistent between the different load-image functions;
> we shouldn't add a check to load_image_targetphys_as() which
> we don't do in eg load_elf_as(). That probably means we should
> only be looking to warn or error at the point where we actually
> load the ROM blobs into memory.
> 
> -- PMM
> 

I'll look into that.

Thanks,
Damien


      reply	other threads:[~2021-11-02 15:02 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-26 14:03 [PATCH v2] generic-loader: check that binary file target location exists Damien Hedde
2021-10-27 22:43 ` Alistair Francis
2021-11-01 10:53 ` Peter Maydell
2021-11-02 14:04   ` Damien Hedde
2021-11-02 14:15     ` Peter Maydell
2021-11-02 14:38       ` Damien Hedde [this message]

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=024819b5-6108-9d08-6cbc-be3394b57548@greensocs.com \
    --to=damien.hedde@greensocs.com \
    --cc=alistair23@gmail.com \
    --cc=peter.maydell@linaro.org \
    --cc=philmd@redhat.com \
    --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).