浏览代码

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

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().

Signed-off-by: Joelle van Dyne <j@getutm.app>
Joelle van Dyne 8 月之前
父节点
当前提交
c387fd0210
共有 1 个文件被更改,包括 5 次插入0 次删除
  1. 5 0
      hw/arm/virt.c

+ 5 - 0
hw/arm/virt.c

@@ -3047,6 +3047,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;
+    }
+
     /* We freeze the memory map to compute the highest gpa */
     virt_set_memmap(vms, max_ipa_size);