All of lore.kernel.org
 help / color / mirror / Atom feed
From: Richard Henderson <richard.henderson@linaro.org>
To: Peter Maydell <peter.maydell@linaro.org>,
	qemu-arm@nongnu.org, qemu-devel@nongnu.org
Cc: "Philippe Mathieu-Daudé" <f4bug@amsat.org>
Subject: Re: [PATCH for-6.0 v2 5/5] target/arm: Make M-profile VTOR loads on reset handle memory aliasing
Date: Thu, 18 Mar 2021 12:44:41 -0600	[thread overview]
Message-ID: <e9f44dba-bfc5-41b2-e60e-6101e96c8f63@linaro.org> (raw)
In-Reply-To: <20210318174823.18066-6-peter.maydell@linaro.org>

On 3/18/21 11:48 AM, Peter Maydell wrote:
> For Arm M-profile CPUs, on reset the CPU must load its initial PC and
> SP from a vector table in guest memory.  Because we can't guarantee
> reset ordering, we have to handle the possibility that the ROM blob
> loader's reset function has not yet run when the CPU resets, in which
> case the data in an ELF file specified by the user won't be in guest
> memory to be read yet.
> 
> We work around the reset ordering problem by checking whether the ROM
> blob loader has any data for the address where the vector table is,
> using rom_ptr().  Unfortunately this does not handle the possibility
> of memory aliasing.  For many M-profile boards, memory can be
> accessed via multiple possible physical addresses; if the board has
> the vector table at address X but the user's ELF file loads data via
> a different address Y which is an alias to the same underlying guest
> RAM then rom_ptr() will not find it.
> 
> Use the new rom_ptr_for_as() function, which deals with memory
> aliasing when locating a relevant ROM blob.
> 
> Signed-off-by: Peter Maydell<peter.maydell@linaro.org>
> ---
>   target/arm/cpu.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>

r~



      reply	other threads:[~2021-03-18 18:51 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-18 17:48 [PATCH for-6.0 v2 0/5] arm: Make M-profile VTOR loads on reset handle memory aliasin Peter Maydell
2021-03-18 17:48 ` [PATCH for-6.0 v2 1/5] memory: Make flatview_cb return bool, not int Peter Maydell
2021-03-18 18:39   ` Richard Henderson
2021-03-18 20:55   ` Philippe Mathieu-Daudé
2021-03-18 17:48 ` [PATCH for-6.0 v2 2/5] memory: Document flatview_for_each_range() Peter Maydell
2021-03-18 18:40   ` Richard Henderson
2021-03-18 20:58   ` Philippe Mathieu-Daudé
2021-03-18 17:48 ` [PATCH for-6.0 v2 3/5] memory: Add offset_in_region to flatview_cb arguments Peter Maydell
2021-03-18 18:40   ` Richard Henderson
2021-03-18 21:01   ` Philippe Mathieu-Daudé
2021-03-18 17:48 ` [PATCH for-6.0 v2 4/5] hw/core/loader: Add new function rom_ptr_for_as() Peter Maydell
2021-03-18 18:44   ` Richard Henderson
2021-03-18 19:02     ` Peter Maydell
2021-03-18 21:14       ` Richard Henderson
2021-03-18 21:28         ` Peter Maydell
2021-03-18 21:56           ` Richard Henderson
2021-03-18 17:48 ` [PATCH for-6.0 v2 5/5] target/arm: Make M-profile VTOR loads on reset handle memory aliasing Peter Maydell
2021-03-18 18:44   ` Richard Henderson [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=e9f44dba-bfc5-41b2-e60e-6101e96c8f63@linaro.org \
    --to=richard.henderson@linaro.org \
    --cc=f4bug@amsat.org \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-arm@nongnu.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 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.