|
@@ -2111,7 +2111,8 @@ static void machvirt_init(MachineState *machine)
|
|
|
|
|
|
/*
|
|
/*
|
|
* In accelerated mode, the memory map is computed earlier in kvm_type()
|
|
* In accelerated mode, the memory map is computed earlier in kvm_type()
|
|
- * to create a VM with the right number of IPA bits.
|
|
|
|
|
|
+ * for Linux, or hvf_get_physical_address_range() for macOS to create a
|
|
|
|
+ * VM with the right number of IPA bits.
|
|
*/
|
|
*/
|
|
if (!vms->memmap) {
|
|
if (!vms->memmap) {
|
|
Object *cpuobj;
|
|
Object *cpuobj;
|
|
@@ -3038,6 +3039,11 @@ static int virt_kvm_type(MachineState *ms, const char *type_str)
|
|
return fixed_ipa ? 0 : requested_pa_size;
|
|
return fixed_ipa ? 0 : requested_pa_size;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+static int virt_hvf_get_physical_address_range(MachineState *ms)
|
|
|
|
+{
|
|
|
|
+ return 0;
|
|
|
|
+}
|
|
|
|
+
|
|
static void virt_machine_class_init(ObjectClass *oc, void *data)
|
|
static void virt_machine_class_init(ObjectClass *oc, void *data)
|
|
{
|
|
{
|
|
MachineClass *mc = MACHINE_CLASS(oc);
|
|
MachineClass *mc = MACHINE_CLASS(oc);
|
|
@@ -3098,6 +3104,7 @@ static void virt_machine_class_init(ObjectClass *oc, void *data)
|
|
mc->valid_cpu_types = valid_cpu_types;
|
|
mc->valid_cpu_types = valid_cpu_types;
|
|
mc->get_default_cpu_node_id = virt_get_default_cpu_node_id;
|
|
mc->get_default_cpu_node_id = virt_get_default_cpu_node_id;
|
|
mc->kvm_type = virt_kvm_type;
|
|
mc->kvm_type = virt_kvm_type;
|
|
|
|
+ mc->hvf_get_physical_address_range = virt_hvf_get_physical_address_range;
|
|
assert(!mc->get_hotplug_handler);
|
|
assert(!mc->get_hotplug_handler);
|
|
mc->get_hotplug_handler = virt_machine_get_hotplug_handler;
|
|
mc->get_hotplug_handler = virt_machine_get_hotplug_handler;
|
|
hc->pre_plug = virt_machine_device_pre_plug_cb;
|
|
hc->pre_plug = virt_machine_device_pre_plug_cb;
|