Can't map 4k-aligned pages.

Hi.

I want to use 4k-aligned page mapping through the hv_vm_* apis. But my mac's page size is 16k, so it would occur an error when I do that.

Is there a way to change the permission of a 4k-aligned guest memory?

Thank you.

Answered by Engineer in 780532022

There isn't a way to make 4k with the hv_vm_ APIs.

For the stage 1 page table, Hypervisor exposes and support the 4k and 16k granule. For the stage 2 page table, Hypervisor maps using the host page size, which is 16k.

Traditionally this hasn't been a problem because it's pretty common to have address spaces defined for the largest granule 64k. If your use case absolutely requires 4k for stage 2, please create a new feature request with Feedback Assistant.

Accepted Answer

There isn't a way to make 4k with the hv_vm_ APIs.

For the stage 1 page table, Hypervisor exposes and support the 4k and 16k granule. For the stage 2 page table, Hypervisor maps using the host page size, which is 16k.

Traditionally this hasn't been a problem because it's pretty common to have address spaces defined for the largest granule 64k. If your use case absolutely requires 4k for stage 2, please create a new feature request with Feedback Assistant.

Can't map 4k-aligned pages.
 
 
Q