All of lore.kernel.org
 help / color / mirror / Atom feed
From: Peter Maydell <peter.maydell@linaro.org>
To: "Philippe Mathieu-Daudé" <f4bug@amsat.org>
Cc: Kumar Gala <kumar.gala@linaro.org>,
	Paolo Bonzini <pbonzini@redhat.com>,
	qemu-arm <qemu-arm@nongnu.org>,
	QEMU Developers <qemu-devel@nongnu.org>
Subject: Re: [PATCH for-6.0 2/2] target/arm: Make M-profile VTOR loads on reset handle memory aliasing
Date: Thu, 18 Mar 2021 17:14:42 +0000	[thread overview]
Message-ID: <CAFEAcA-WoS9-VPz948s-X8BxesF00jt0oKK1WwPeXR4GxPYCJg@mail.gmail.com> (raw)
In-Reply-To: <f9bbdc90-51ca-8ba6-26d8-3db820193a15@amsat.org>

On Fri, 12 Mar 2021 at 20:17, Philippe Mathieu-Daudé <f4bug@amsat.org> wrote:
> Your solution seems generic, and the problem is not resticted
> to Cortex-M:
>
> $ git grep rom_ptr target
> target/arm/cpu.c:334:        rom = rom_ptr(vecbase, 8);
> target/rx/cpu.c:61:    resetvec = rom_ptr(0xfffffffc, 4);
>
> Some thoughs:
> - make find_rom_for_addr() generic ("hw/loader.h" again?)
> - poison rom_ptr() under target/ to restrict it to hw/

This problem isn't specific to code in target/, that's just
the particular case I care about. The uses in hw/ are mostly
in board init code, which (like cpu reset code) runs before
the rom blob reset function, and so wants to directly look
at the blob data. If a board has multiple aliases for a piece
of RAM then rom_ptr() will cause problems for code in hw/ too.
The only advantage that uses of rom_ptr() in hw/ have is that
they can know which board model they're running on and so either
(a) be sure that the address they're looking at doesn't have any
aliases elsewhere in the AddressSpace or (b) manually look at
every alias address in turn.

thanks
-- PMM


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

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-12 17:29 [PATCH for-6.0 0/2] arm: Make M-profile VTOR loads on reset handle memory aliasing Peter Maydell
2021-03-12 17:29 ` [PATCH for-6.0 1/2] memory: Add offset_in_region to flatview_cb arguments Peter Maydell
2021-03-12 20:09   ` Philippe Mathieu-Daudé
2021-03-12 17:29 ` [PATCH for-6.0 2/2] target/arm: Make M-profile VTOR loads on reset handle memory aliasing Peter Maydell
2021-03-12 20:17   ` Philippe Mathieu-Daudé
2021-03-13 19:03     ` Richard Henderson
2021-03-18 17:14     ` Peter Maydell [this message]
2021-03-12 18:59 ` [PATCH for-6.0 0/2] arm: " Peter Maydell
2021-03-13 19:05   ` Richard Henderson
2021-03-13 19:41     ` Peter Maydell

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-WoS9-VPz948s-X8BxesF00jt0oKK1WwPeXR4GxPYCJg@mail.gmail.com \
    --to=peter.maydell@linaro.org \
    --cc=f4bug@amsat.org \
    --cc=kumar.gala@linaro.org \
    --cc=pbonzini@redhat.com \
    --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.