Skip to contentSkip to conversation

hw/arm/virt: handle hvf with unknown max IPA size

PATCH Peter Maydell 1 participant 1 message Jan 10, 2025 2 messages not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

A message that is not in the archive (sent off-list or not yet received): [email protected]

#2 lore raw
Quoted 15 lines · Joelle van Dyne

When it is not possible to determine the max IPA bit size, the helper function will return 0. We do not try to set up the memmap in this case and instead fall back to the default in machvirt_init().

---
 hw/arm/virt.c | 5 +++++
 1 file changed, 5 insertions(+)
hw/arm/virt.c +0 -0
index f9b3380815..8c431e24b3 100644

hw/arm/virt.c static int virt_hvf_get_physical_address_range(MachineState *ms) · line 3059

Quoted 7 lines
hw/arm/virt.c +4 -0
@@ -3053,6 +3053,11 @@ static int virt_hvf_get_physical_address_range(MachineState *ms)
     int default_ipa_size = hvf_arm_get_default_ipa_bit_size();
     int max_ipa_size = hvf_arm_get_max_ipa_bit_size();
 
+    /* Unknown max ipa size, we'll let the caller figure it out */
+    if (max_ipa_size == 0) {
+        return 0;
+    }

When can this happen? There are other places where we call hvf_arm_get_max_ipa_bit_size() and assume it's valid. The implementation calls assert_hvf_ok(ret), so if it returns at all then we ought to have got a valid IPA size from macos...

thanks
-- PMM