hv_vcpu_run on M1 suppose to return but it is not

Hi,

I'm building a Virtual Machine Manager on top of Hypervisor Framework and having a problem with hv_vcpu_run never return somehow. I tested the same code on Asahi Linux using KVM and everything are working correctly. I really have no idea what I'm doing wrong here.

How I setup a vCPU: https://github.com/obhq/obliteration/blob/main/gui/src/vmm/aarch64.rs

How I use the Hypervisor Framework: https://github.com/obhq/obliteration/blob/main/gui/src/vmm/hv/macos/cpu.rs#L402

Thanks in advance.

Answered by ultimaweapon in 813359022

Found the problem. The problem is hv_vm_map ignore all memory that returned from mmap with PROT_NONE. So the fix is just invoke hv_vm_map each time the memory protection is changed from PROT_NONE.

Accepted Answer

Found the problem. The problem is hv_vm_map ignore all memory that returned from mmap with PROT_NONE. So the fix is just invoke hv_vm_map each time the memory protection is changed from PROT_NONE.

hv_vcpu_run on M1 suppose to return but it is not
 
 
Q