qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Edgar E. Iglesias" <edgar.iglesias@gmail.com>
To: qemu-devel@nongnu.org
Cc: edgar.iglesias@gmail.com, sstabellini@kernel.org,
	jgross@suse.com, "Edgar E. Iglesias" <edgar.iglesias@amd.com>,
	"David Hildenbrand" <david@redhat.com>,
	"Paolo Bonzini" <pbonzini@redhat.com>,
	"Peter Xu" <peterx@redhat.com>,
	"Philippe Mathieu-Daudé" <philmd@linaro.org>
Subject: [PATCH v7 5/8] softmmu: Replace check for RAMBlock offset 0 with xen_mr_is_memory
Date: Fri, 24 May 2024 12:51:49 +0200	[thread overview]
Message-ID: <20240524105152.1301842-6-edgar.iglesias@gmail.com> (raw)
In-Reply-To: <20240524105152.1301842-1-edgar.iglesias@gmail.com>

From: "Edgar E. Iglesias" <edgar.iglesias@amd.com>

For xen, when checking for the first RAM (xen_memory), use
xen_mr_is_memory() rather than checking for a RAMBlock with
offset 0.

All Xen machines create xen_memory first so this has no
functional change for existing machines.

Signed-off-by: Edgar E. Iglesias <edgar.iglesias@amd.com>
Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
Reviewed-by: David Hildenbrand <david@redhat.com>
---
 system/physmem.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/system/physmem.c b/system/physmem.c
index 5e6257ef65..b7847db1a2 100644
--- a/system/physmem.c
+++ b/system/physmem.c
@@ -2229,7 +2229,7 @@ static void *qemu_ram_ptr_length(RAMBlock *block, ram_addr_t addr,
          * because we don't want to map the entire memory in QEMU.
          * In that case just map the requested area.
          */
-        if (block->offset == 0) {
+        if (xen_mr_is_memory(block->mr)) {
             return xen_map_cache(block->mr, block->offset + addr,
                                  len, lock, lock,
                                  is_write);
-- 
2.40.1



  parent reply	other threads:[~2024-05-24 10:53 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-24 10:51 [PATCH v7 0/8] xen: Support grant mappings Edgar E. Iglesias
2024-05-24 10:51 ` [PATCH v7 1/8] xen: mapcache: Make MCACHE_BUCKET_SHIFT runtime configurable Edgar E. Iglesias
2024-05-24 10:51 ` [PATCH v7 2/8] xen: mapcache: Unmap first entries in buckets Edgar E. Iglesias
2024-05-24 10:51 ` [PATCH v7 3/8] xen: Add xen_mr_is_memory() Edgar E. Iglesias
2024-05-27 16:25   ` Philippe Mathieu-Daudé
2024-05-29 11:10     ` Edgar E. Iglesias
2024-05-24 10:51 ` [PATCH v7 4/8] softmmu: xen: Always pass offset + addr to xen_map_cache Edgar E. Iglesias
2024-05-24 10:51 ` Edgar E. Iglesias [this message]
2024-05-24 10:51 ` [PATCH v7 6/8] xen: mapcache: Pass the ram_addr offset to xen_map_cache() Edgar E. Iglesias
2024-05-27 16:13   ` Philippe Mathieu-Daudé
2024-05-24 10:51 ` [PATCH v7 7/8] xen: mapcache: Add support for grant mappings Edgar E. Iglesias
2024-05-24 10:51 ` [PATCH v7 8/8] hw/arm: xen: Enable use of " Edgar E. Iglesias
2024-05-27 16:12   ` Philippe Mathieu-Daudé

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=20240524105152.1301842-6-edgar.iglesias@gmail.com \
    --to=edgar.iglesias@gmail.com \
    --cc=david@redhat.com \
    --cc=edgar.iglesias@amd.com \
    --cc=jgross@suse.com \
    --cc=pbonzini@redhat.com \
    --cc=peterx@redhat.com \
    --cc=philmd@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=sstabellini@kernel.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).