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 <[email protected]>
---
 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 via email to