From: "Alex Bennée" <alex.bennee@linaro.org>
To: "Edgar E. Iglesias" <edgar.iglesias@gmail.com>
Cc: qemu-devel@nongnu.org, sstabellini@kernel.org,
anthony@xenproject.org, paul@xen.org, edgar.iglesias@amd.com,
xen-devel@lists.xenproject.org,
"Paolo Bonzini" <pbonzini@redhat.com>,
"Peter Xu" <peterx@redhat.com>,
"David Hildenbrand" <david@redhat.com>,
"Philippe Mathieu-Daudé" <philmd@linaro.org>
Subject: Re: [PATCH v1 1/2] physmem: Bail out qemu_ram_block_from_host() for invalid ram addrs
Date: Thu, 04 Jul 2024 11:26:02 +0100 [thread overview]
Message-ID: <87ikxlo3lx.fsf@draig.linaro.org> (raw)
In-Reply-To: <20240701224421.1432654-2-edgar.iglesias@gmail.com> (Edgar E. Iglesias's message of "Tue, 2 Jul 2024 00:44:20 +0200")
"Edgar E. Iglesias" <edgar.iglesias@gmail.com> writes:
> From: "Edgar E. Iglesias" <edgar.iglesias@amd.com>
>
> Bail out in qemu_ram_block_from_host() when
> xen_ram_addr_from_mapcache() does not find an existing
> mapping.
>
> Signed-off-by: Edgar E. Iglesias <edgar.iglesias@amd.com>
> ---
> system/physmem.c | 4 ++++
> 1 file changed, 4 insertions(+)
>
> diff --git a/system/physmem.c b/system/physmem.c
> index 33d09f7571..59d1576c2b 100644
> --- a/system/physmem.c
> +++ b/system/physmem.c
> @@ -2277,6 +2277,10 @@ RAMBlock *qemu_ram_block_from_host(void *ptr, bool round_offset,
> ram_addr_t ram_addr;
> RCU_READ_LOCK_GUARD();
> ram_addr = xen_ram_addr_from_mapcache(ptr);
> + if (ram_addr == RAM_ADDR_INVALID) {
> + return NULL;
> + }
> +
Isn't this indicative of a failure? Should there at least be a trace
point for failed mappings?
> block = qemu_get_ram_block(ram_addr);
> if (block) {
> *offset = ram_addr - block->offset;
--
Alex Bennée
Virtualisation Tech Lead @ Linaro
next prev parent reply other threads:[~2024-07-04 10:27 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-07-01 22:44 [PATCH v1 0/2] xen: mapcache: Fix unmapping of first the entry in a bucket Edgar E. Iglesias
2024-07-01 22:44 ` [PATCH v1 1/2] physmem: Bail out qemu_ram_block_from_host() for invalid ram addrs Edgar E. Iglesias
2024-07-04 10:26 ` Alex Bennée [this message]
2024-07-04 11:42 ` Edgar E. Iglesias
2024-07-04 12:33 ` Alex Bennée
2024-07-08 23:14 ` Stefano Stabellini
2024-07-01 22:44 ` [PATCH v1 2/2] xen: mapcache: Fix unmapping of first entries in buckets Edgar E. Iglesias
2024-07-04 14:23 ` Anthony PERARD
2024-07-04 16:44 ` Alex Bennée
2024-07-04 18:48 ` Edgar E. Iglesias via
2024-07-06 6:27 ` Edgar E. Iglesias
2024-07-07 8:45 ` Alex Bennée
2024-07-08 23:16 ` Stefano Stabellini
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=87ikxlo3lx.fsf@draig.linaro.org \
--to=alex.bennee@linaro.org \
--cc=anthony@xenproject.org \
--cc=david@redhat.com \
--cc=edgar.iglesias@amd.com \
--cc=edgar.iglesias@gmail.com \
--cc=paul@xen.org \
--cc=pbonzini@redhat.com \
--cc=peterx@redhat.com \
--cc=philmd@linaro.org \
--cc=qemu-devel@nongnu.org \
--cc=sstabellini@kernel.org \
--cc=xen-devel@lists.xenproject.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).