Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[PoC] Change the default pagesize on aarch64 from 4k to 16k to support apple hardware #530

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

kit-ty-kate
Copy link

This is an attempt at hotfixing #529 for 16k aarch64 hardware as I need to have a working solo5 to test mirage/ocaml-solo5#122 on my work laptop (apple M1 hardware).

I don't think this should be merged as-is as I think sysconf(_SC_PAGESIZE) should be used instead but the goal is to show which parts of the code needs to change for solo5 to work on 16k pagesize hardware.

As of afa7fdf: only solo5-spt works. solo5-hvt infinit loops for some reason, so something else might be needed.

@TImada
Copy link

TImada commented Oct 25, 2022

For solo5-hvt, modification of aarch64_setup_memory_mapping [1] and TCR_TG_FLAGS [2] will be needed at least.

The current implementation creates a page table having mixed 1GB/2MB/4KB blocks. However, a page table having mixed 32MB/16KB blocks needs to be created to support Apple hardware.
(Check [3] for details)

In addition, TG0 and TG1 bits of TCR_EL1 needs to be configured to use the 16KB granule size.
(Check [4] for details)

[1] https://github.com/Solo5/solo5/blob/master/tenders/hvt/hvt_cpu_aarch64.c#L38
[2] https://github.com/Solo5/solo5/blob/master/tenders/hvt/hvt_kvm_aarch64.c#L131
[3] https://developer.arm.com/documentation/den0024/a/The-Memory-Management-Unit/Translation-tables-in-ARMv8-A/Effect-of-granule-sizes-on-translation-tables
[4] https://developer.arm.com/documentation/ddi0595/2020-12/AArch64-Registers/TCR-EL1--Translation-Control-Register--EL1-

16KB page size support requires slightly complicated work. 😢

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants