Skip to content

memory: memory_region_is_mapped() cleanups

David Hildenbrand qemu-devel 3 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v3 Latest3 patches 8 repliesIn review
  2. v23 patches 7 repliesSuperseded
  3. v12 patches 11 repliesSuperseded

v1 -> v2 from the cover letter

- "memory: Make memory_region_is_mapped() succeed when mapped via an alias"
-- Add an assertion
- Add RBs

Patches in v3 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/3machine: Use host_memory_backend_is_mapped() in machine_consume_memdev()hw/core/machine.c+1 -10 replies
2/3memory: Make memory_region_is_mapped() succeed when mapped via an aliasinclude/exec/memory.h softmmu/memory.c+13 -16 replies
3/3memory: Update description of memory_region_is_mapped()include/exec/memory.h+2 -10 replies

Reviews trailers per patch

All 3 patches have a Reviewed-by or Acked-by.

PatchRichard HendersonIgor MammedovPhilippe Mathieu-DaudéPeter Xu
1/3R-b R-b R-b R-b
2/3R-b R-b
3/3R-b R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 4 reviewers.

Read the v3 thread

Cover letter [PATCH v3 0/3] memory: memory_region_is_mapped() cleanups

Playing with memory_region_is_mapped(), I realized that memory regions mapped via an alias behave a little bit "differently", as they don't have their ->container set.
* memory_region_is_mapped() will never succeed for memory regions mapped via an alias
* memory_region_to_address_space(), memory_region_find(), memory_region_find_rcu(), memory_region_present() won't work, which seems okay, because we don't expect such memory regions getting passed to these functions.
* memory_region_to_absolute_addr() will result in a wrong address. As the result is only used for tracing, that is tolerable.

Let's cleanup/fix the code and documentation of memory_region_is_mapped() and change one user that really should be checking something else.

v1 -> v2:
- "memory: Make memory_region_is_mapped() succeed when mapped via an alias"
-- Add an assertion
- Add RBs

Cc Eduardo Habkost <[email protected]>
Cc Marcel Apfelbaum <[email protected]>
Cc Paolo Bonzini <[email protected]>
Cc Peter Xu <[email protected]>
Cc Igor Mammedov <[email protected]>
Cc Richard Henderson <[email protected]>
Cc "Philippe Mathieu-Daudé" <[email protected]>

David Hildenbrand (3):
machine: Use host_memory_backend_is_mapped() in
machine_consume_memdev()
memory: Make memory_region_is_mapped() succeed when mapped via an
alias
memory: Update description of memory_region_is_mapped()

 hw/core/machine.c     |  2 +-
 include/exec/memory.h |  4 +++-
 softmmu/memory.c      | 13 ++++++++++++-
 3 files changed, 16 insertions(+), 3 deletions(-)
Signature · 1 line
2.31.1