All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Philippe Mathieu-Daudé" <philmd@linaro.org>
To: qemu-devel@nongnu.org
Cc: "Cameron Esfahani" <dirty@apple.com>,
	"Peter Maydell" <peter.maydell@linaro.org>,
	qemu-arm@nongnu.org, "Roman Bolshakov" <rbolshakov@ddn.com>,
	"Mads Ynddal" <mads@ynddal.dk>,
	"Phil Dennis-Jordan" <phil@philjordan.eu>,
	"Alexander Graf" <agraf@csgraf.de>,
	"Philippe Mathieu-Daudé" <philmd@linaro.org>
Subject: [PATCH-for-10.1 3/3] hw/arm/virt: Warn when HVF doesn't report IPA bit length
Date: Wed, 16 Jul 2025 19:28:13 +0200	[thread overview]
Message-ID: <20250716172813.73405-4-philmd@linaro.org> (raw)
In-Reply-To: <20250716172813.73405-1-philmd@linaro.org>

Emit a warning when HVF doesn't return the IPA bit length
and return -1 as "this accelerator is not usable", allowing
QEMU to try with the next one (when using '-accel hvf:tcg').

Reported-by: Ivan Krasilnikov
Resolves: https://gitlab.com/qemu-project/qemu/-/issues/2981
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
 hw/arm/virt.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/hw/arm/virt.c b/hw/arm/virt.c
index ef6be3660f5..062812bf252 100644
--- a/hw/arm/virt.c
+++ b/hw/arm/virt.c
@@ -3149,8 +3149,12 @@ static int virt_hvf_get_physical_address_range(MachineState *ms)
 {
     VirtMachineState *vms = VIRT_MACHINE(ms);
 
-    int default_ipa_size = hvf_arm_get_default_ipa_bit_size();
-    int max_ipa_size = hvf_arm_get_max_ipa_bit_size();
+    uint32_t default_ipa_size = hvf_arm_get_default_ipa_bit_size();
+    uint32_t max_ipa_size = hvf_arm_get_max_ipa_bit_size();
+    if (!default_ipa_size || !max_ipa_size) {
+        warn_report("HVF didn't report IPA bit length");
+        return -1;
+    }
 
     /* We freeze the memory map to compute the highest gpa */
     virt_set_memmap(vms, max_ipa_size);
-- 
2.49.0



  parent reply	other threads:[~2025-07-16 17:29 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-07-16 17:28 [PATCH-for-10.1 0/3] accel/hvf: Do not abort in hvf_arm_get_*_ipa_bit_size() Philippe Mathieu-Daudé
2025-07-16 17:28 ` [PATCH-for-10.1 1/3] accel/hvf: Display executable bit as 'X' Philippe Mathieu-Daudé
2025-07-16 18:12   ` Alex Bennée
2025-07-17 10:09   ` Mads Ynddal
2025-07-17 13:08   ` Xiaoyao Li
2025-07-17 14:55     ` BALATON Zoltan
2025-07-16 17:28 ` [PATCH-for-10.1 2/3] accel/hvf: Do not abort in hvf_arm_get_*_ipa_bit_size() Philippe Mathieu-Daudé
2025-07-17 10:02   ` Mads Ynddal
2025-07-16 17:28 ` Philippe Mathieu-Daudé [this message]
2025-07-17 10:06   ` [PATCH-for-10.1 3/3] hw/arm/virt: Warn when HVF doesn't report IPA bit length Mads Ynddal
2025-07-17 11:15     ` Philippe Mathieu-Daudé
2025-07-17 12:15       ` Mads Ynddal
2025-07-21 10:41   ` Peter Maydell
2025-07-21 12:40 ` [PATCH-for-10.1 0/3] accel/hvf: Do not abort in hvf_arm_get_*_ipa_bit_size() Peter Maydell
2025-07-21 13:14   ` 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=20250716172813.73405-4-philmd@linaro.org \
    --to=philmd@linaro.org \
    --cc=agraf@csgraf.de \
    --cc=dirty@apple.com \
    --cc=mads@ynddal.dk \
    --cc=peter.maydell@linaro.org \
    --cc=phil@philjordan.eu \
    --cc=qemu-arm@nongnu.org \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.