From: David Hildenbrand <david@redhat.com>
To: qemu-devel@nongnu.org
Cc: "Eduardo Habkost" <ehabkost@redhat.com>,
"David Hildenbrand" <david@redhat.com>,
"Richard Henderson" <richard.henderson@linaro.org>,
"Philippe Mathieu-Daudé" <f4bug@amsat.org>,
"Peter Xu" <peterx@redhat.com>,
"Igor Mammedov" <imammedo@redhat.com>,
"Paolo Bonzini" <pbonzini@redhat.com>
Subject: [PATCH v1 0/2] memory: Update description of memory_region_is_mapped()
Date: Mon, 11 Oct 2021 19:45:19 +0200 [thread overview]
Message-ID: <20211011174522.14351-1-david@redhat.com> (raw)
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 clarify the documentation of memory_region_is_mapped() and change
one user that really should be checking something else.
Cc: Eduardo Habkost <ehabkost@redhat.com>
Cc: Marcel Apfelbaum <marcel.apfelbaum@gmail.com>
Cc: Paolo Bonzini <pbonzini@redhat.com>
Cc: Peter Xu <peterx@redhat.com>
Cc: Igor Mammedov <imammedo@redhat.com>
Cc: Richard Henderson <richard.henderson@linaro.org>
Cc: Philippe Mathieu-Daudé <f4bug@amsat.org>
David Hildenbrand (2):
machine: Use host_memory_backend_is_mapped() in
machine_consume_memdev()
memory: Update description of memory_region_is_mapped()
hw/core/machine.c | 2 +-
include/exec/memory.h | 3 ++-
2 files changed, 3 insertions(+), 2 deletions(-)
--
2.31.1
next reply other threads:[~2021-10-11 17:47 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-10-11 17:45 David Hildenbrand [this message]
2021-10-11 17:45 ` [PATCH v1 1/2] machine: Use host_memory_backend_is_mapped() in machine_consume_memdev() David Hildenbrand
2021-10-11 21:16 ` Richard Henderson
2021-10-12 8:25 ` Igor Mammedov
2021-10-11 17:45 ` [PATCH v1 2/2] memory: Update description of memory_region_is_mapped() David Hildenbrand
2021-10-11 21:21 ` Richard Henderson
2021-10-11 22:17 ` Philippe Mathieu-Daudé
2021-10-12 6:50 ` David Hildenbrand
2021-10-12 8:53 ` Igor Mammedov
2021-10-12 9:28 ` David Hildenbrand
2021-10-12 10:00 ` Igor Mammedov
2021-10-12 10:09 ` David Hildenbrand
2021-10-13 7:14 ` David Hildenbrand
2021-10-13 9:43 ` Igor Mammedov
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=20211011174522.14351-1-david@redhat.com \
--to=david@redhat.com \
--cc=ehabkost@redhat.com \
--cc=f4bug@amsat.org \
--cc=imammedo@redhat.com \
--cc=pbonzini@redhat.com \
--cc=peterx@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=richard.henderson@linaro.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 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).