All of lore.kernel.org
 help / color / mirror / Atom feed
From: Peter Maydell <peter.maydell@linaro.org>
To: KONRAD Frederic <frederic.konrad@adacore.com>
Cc: "QEMU Developers" <qemu-devel@nongnu.org>,
	"Alex Bennée" <alex.bennee@linaro.org>,
	"Paolo Bonzini" <pbonzini@redhat.com>,
	alistair@alistair23.me
Subject: Re: [Qemu-devel] [PATCH v1 2/3] arm: fix the armv7m reset state
Date: Thu, 29 Jun 2017 16:14:07 +0100	[thread overview]
Message-ID: <CAFEAcA-tuehYiJkYo148N0VPJ3hwhcxYDDersmbs4TOqxQCEKw@mail.gmail.com> (raw)
In-Reply-To: <1498728533-23160-3-git-send-email-frederic.konrad@adacore.com>

On 29 June 2017 at 10:28, KONRAD Frederic <frederic.konrad@adacore.com> wrote:
> This fixes an odd bug when a ROM is present somewhere and an alias @0x00000000
> is pointing to the ROM. The "if (rom)" test fails and we don't get a valid reset
> state. QEMU later crashes with an exception because the ARMv7-M starts with the
> ARM instruction set. (eg: PC & 0x01 is 0).
>
> This patch uses memory_region_get_offset_within_address_space introduced before
> to check if an alias doesn't point to a flash somewhere.
>
> Signed-off-by: KONRAD Frederic <frederic.konrad@adacore.com>

This is awkward, because in the "we have a ROM but it's not been
copied into memory yet" case, the only thing we have is the
rom->addr, which is the address which the user's ROM blob said
it ought to be loaded in at. If the user didn't actually provide
a ROM blob that loads at 0 that seems a bit like a user error,
and I don't think this patch will catch all the cases of that
sort of mistake. For instance if address 0 is real flash and the
high address alias is modelled by having the high address be the
alias, then if the user passes us an ELF file saying "load to
the high address" then this change won't catch that I think
(because doing the memory_region_find/get_offset_within_address_space
will return 0, which has already been tried). You'd need to
somehow have a way to say "find all the addresses within this
AS where this MR is mapped" and try them all...

thanks
-- PMM

  reply	other threads:[~2017-06-29 15:14 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-06-29  9:28 [Qemu-devel] [PATCH v1 0/3] Some armv7m fixes KONRAD Frederic
2017-06-29  9:28 ` [Qemu-devel] [PATCH v1 1/3] add memory_region_get_offset_within_address_space KONRAD Frederic
2017-06-29  9:28 ` [Qemu-devel] [PATCH v1 2/3] arm: fix the armv7m reset state KONRAD Frederic
2017-06-29 15:14   ` Peter Maydell [this message]
2017-06-29 16:41     ` KONRAD Frederic
2017-06-29 16:45       ` Peter Maydell
2017-06-30  8:24         ` KONRAD Frederic
2017-06-30  9:06           ` Peter Maydell
2017-07-03  7:31             ` KONRAD Frederic
2017-07-03  8:51               ` Peter Maydell
2017-07-03  9:04                 ` KONRAD Frederic
2017-06-29  9:28 ` [Qemu-devel] [PATCH v1 3/3] armv7m_systick: abort instead of locking on a bad rate KONRAD Frederic
2017-06-29 12:35   ` Philippe Mathieu-Daudé
2017-06-29 12:43     ` Peter Maydell
2017-06-29 12:48       ` KONRAD Frederic
2017-06-29 13:02       ` Philippe Mathieu-Daudé
2017-06-29 13:17         ` KONRAD Frederic
2017-07-06 23:49 ` [Qemu-devel] [PATCH v1 0/3] Some armv7m fixes no-reply
2017-07-07  0:03   ` Fam Zheng

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=CAFEAcA-tuehYiJkYo148N0VPJ3hwhcxYDDersmbs4TOqxQCEKw@mail.gmail.com \
    --to=peter.maydell@linaro.org \
    --cc=alex.bennee@linaro.org \
    --cc=alistair@alistair23.me \
    --cc=frederic.konrad@adacore.com \
    --cc=pbonzini@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.