2
0
Эх сурвалжийг харах

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 сар өмнө
parent
commit
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 default_ipa_size = hvf_arm_get_default_ipa_bit_size();
     int max_ipa_size = hvf_arm_get_max_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 */
     /* We freeze the memory map to compute the highest gpa */
     virt_set_memmap(vms, max_ipa_size);
     virt_set_memmap(vms, max_ipa_size);