qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Joelle van Dyne <j@getutm.app>
To: qemu-devel@nongnu.org
Cc: Joelle van Dyne <j@getutm.app>,
	Cameron Esfahani <dirty@apple.com>,
	Roman Bolshakov <rbolshakov@ddn.com>,
	Phil Dennis-Jordan <phil@philjordan.eu>,
	Mads Ynddal <mads@ynddal.dk>
Subject: [PATCH] hvf: warn when attempting to add unaligned page size
Date: Tue,  2 Dec 2025 19:58:47 -0800	[thread overview]
Message-ID: <20251203035847.94102-2-j@getutm.app> (raw)
In-Reply-To: <20251203035847.94102-1-j@getutm.app>

Instead of silently failing, we should print a warning so it is clear why
a future guest access to that location might cause an exception.

Signed-off-by: Joelle van Dyne <j@getutm.app>
---
 accel/hvf/hvf-all.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/accel/hvf/hvf-all.c b/accel/hvf/hvf-all.c
index 0a4b498e83..7823d8416c 100644
--- a/accel/hvf/hvf-all.c
+++ b/accel/hvf/hvf-all.c
@@ -112,6 +112,14 @@ static void hvf_set_phys_mem(MemoryRegionSection *section, bool add)
 
     if (!QEMU_IS_ALIGNED(int128_get64(section->size), page_size) ||
         !QEMU_IS_ALIGNED(section->offset_within_address_space, page_size)) {
+        if (add) {
+            warn_report("Cannot add 0x%016llX:0x%016llX because it is not "
+                        "aligned to page size (0x%X)",
+                        section->offset_within_address_space,
+                        section->offset_within_address_space +
+                        int128_get64(section->size),
+                        (uint32_t)page_size);
+        }
         /* Not page aligned, so we can not map as RAM */
         add = false;
     }
-- 
2.41.0



  reply	other threads:[~2025-12-03  3:59 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-12-03  3:58 [PATCH] hvf: allow slot size to increase Joelle van Dyne
2025-12-03  3:58 ` Joelle van Dyne [this message]
2025-12-03  6:59 ` 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=20251203035847.94102-2-j@getutm.app \
    --to=j@getutm.app \
    --cc=dirty@apple.com \
    --cc=mads@ynddal.dk \
    --cc=phil@philjordan.eu \
    --cc=qemu-devel@nongnu.org \
    --cc=rbolshakov@ddn.com \
    /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).