qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Philippe Mathieu-Daudé" <f4bug@amsat.org>
To: qemu-devel@nongnu.org
Cc: "Stephen Checkoway" <stephen.checkoway@oberlin.edu>,
	qemu-block@nongnu.org,
	"Richard Henderson" <richard.henderson@linaro.org>,
	"Philippe Mathieu-Daudé" <f4bug@amsat.org>,
	"David Edmondson" <david.edmondson@oracle.com>,
	qemu-arm@nongnu.org
Subject: [PATCH v2 0/7] hw/misc: Add memory_region_add_subregion_aliased() helper [pflash part]
Date: Mon, 19 Apr 2021 11:43:22 +0200	[thread overview]
Message-ID: <20210419094329.1402767-1-f4bug@amsat.org> (raw)

Hi,

This series introduce the memory_region_add_subregion_aliased()
helper which basically create a device which maps a subregion
multiple times.

Since v1:
- Split series in 2, keeping the I/O regions (showed with the q800
  machine) part for 2nd part
- Added R-b tags

Examples are easier, so having a subregion aliased every @span_size
then mapped onto a container at an offset, you get something like:

          ^-----------^
          |           |
          |           |
          | +-------+ |                 +---------+          <--+
          |           |                 +---------+             |
          |           |                 |         |             |
          |           |   +-----------> | alias#3 |             |
          |           |   |             |         |             |
          |           |   |             +---------+             |
          |           |   |             +---------+             |
          |           |   |             |         |             |
          |           |   |   +-------> | alias#2 |             |
          |           |   |   |         |         |             |region
          | container |   |   |         +---------+             | size
          |           |   |   |         +---------+             |
          |           |   |   |         |         |             |
          |           |   |   |  +----> | alias#1 |             |
          |           |   |   |  |      |         |             |
          |           |   |   |  |      +---------+  <--+       |
          |           | +-+---+--+--+   +---------+     |       |
          |           | |           |   |         |     |span   |
          |           | | subregion +-> | alias#0 |     |size   |
   offset |           | |           |   |         |     |       |
   +----> | +-------+ | +-----------+   +---------+  <--+    <--+
   |      |           |
   |      |           |
   |      |           |
   |      |           |
   |      |           |
   |      ^-----------^

I know it need more documentation and tests, but I prefer to send
as draft RFC for early review before spending more time on it.

Supersedes: <20210326002728.1069834-1-f4bug@amsat.org>
Based-on: <20210325120921.858993-1-f4bug@amsat.org>
https://www.mail-archive.com/qemu-devel@nongnu.org/msg795218.html

Philippe Mathieu-Daudé (7):
  hw/misc: Add device to help managing aliased memory regions
  hw/arm/musicpal: Open-code pflash_cfi02_register() call
  hw/arm/musicpal: Map flash using memory_region_add_subregion_aliased()
  hw/arm/digic: Open-code pflash_cfi02_register() call
  hw/arm/digic: Map flash using memory_region_add_subregion_aliased()
  hw/block/pflash_cfi02: Remove pflash_setup_mappings()
  hw/block/pflash_cfi02: Simplify pflash_cfi02_register() prototype

 include/hw/block/flash.h         |   1 -
 include/hw/misc/aliased_region.h |  87 ++++++++++++++++++++
 hw/arm/digic_boards.c            |  28 +++++--
 hw/arm/musicpal.c                |  29 +++++--
 hw/arm/xilinx_zynq.c             |   2 +-
 hw/block/pflash_cfi02.c          |  36 +--------
 hw/lm32/lm32_boards.c            |   4 +-
 hw/misc/aliased_region.c         | 132 +++++++++++++++++++++++++++++++
 hw/ppc/ppc405_boards.c           |   6 +-
 hw/sh4/r2d.c                     |   2 +-
 MAINTAINERS                      |   6 ++
 hw/arm/Kconfig                   |   2 +
 hw/misc/Kconfig                  |   3 +
 hw/misc/meson.build              |   1 +
 14 files changed, 285 insertions(+), 54 deletions(-)
 create mode 100644 include/hw/misc/aliased_region.h
 create mode 100644 hw/misc/aliased_region.c

-- 
2.26.3



             reply	other threads:[~2021-04-19  9:45 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-19  9:43 Philippe Mathieu-Daudé [this message]
2021-04-19  9:43 ` [RFC PATCH v2 1/7] hw/misc: Add device to help managing aliased memory regions Philippe Mathieu-Daudé
2021-04-22  1:33   ` Richard Henderson
2021-07-06 21:24     ` Philippe Mathieu-Daudé
2021-04-19  9:43 ` [PATCH v2 2/7] hw/arm/musicpal: Open-code pflash_cfi02_register() call Philippe Mathieu-Daudé
2021-04-22  1:37   ` Richard Henderson
2021-04-19  9:43 ` [PATCH v2 3/7] hw/arm/musicpal: Map flash using memory_region_add_subregion_aliased() Philippe Mathieu-Daudé
2021-04-22  1:41   ` Richard Henderson
2021-04-19  9:43 ` [PATCH v2 4/7] hw/arm/digic: Open-code pflash_cfi02_register() call Philippe Mathieu-Daudé
2021-04-22  1:42   ` Richard Henderson
2021-04-19  9:43 ` [PATCH v2 5/7] hw/arm/digic: Map flash using memory_region_add_subregion_aliased() Philippe Mathieu-Daudé
2021-04-22  1:43   ` Richard Henderson
2021-04-19  9:43 ` [PATCH v2 6/7] hw/block/pflash_cfi02: Remove pflash_setup_mappings() Philippe Mathieu-Daudé
2021-04-22  1:47   ` Richard Henderson
2021-04-19  9:43 ` [PATCH v2 7/7] hw/block/pflash_cfi02: Simplify pflash_cfi02_register() prototype Philippe Mathieu-Daudé
2021-04-22  1:48   ` Richard Henderson

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=20210419094329.1402767-1-f4bug@amsat.org \
    --to=f4bug@amsat.org \
    --cc=david.edmondson@oracle.com \
    --cc=qemu-arm@nongnu.org \
    --cc=qemu-block@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=richard.henderson@linaro.org \
    --cc=stephen.checkoway@oberlin.edu \
    /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).