The state of the AArch64 port

32 views
Skip to first unread message

Waldek Kozaczuk

unread,
Jul 21, 2020, 2:12:37 PM7/21/20
to OSv Development
Last month or so I have stayed mainly focused on trying to improve the AArch64 port of OSv. And even though I have made quite many strides in that direction, there is still quite a lot of work left to do. Relatedly I have updated the AArch64 wiki page with more details - https://github.com/cloudius-systems/osv/wiki/AArch64 - feel free to make any corrections you see fit. 

First of I wanted to say that OSv runs on newest Raspberry PI 4 on both QEMU and Firecracker with KVM on. If you want to replicate my setup please see this portion of the wiki page - https://github.com/cloudius-systems/osv/wiki/AArch64#setup-raspberry-pi-4-for-osv. The one I am using has 4GB of memory (these days you can get the 8GB one for around 50$ I think) and boots from SSD which makes it much faster.

So here is what works:
  • OSv can boot in both emulated AArch64 mode on QEMU as well as on QEMU and Firecracker with KVM acceleration on real AArch64 hardware (this has only been tested on Raspberry PI 4, though original part of the Wiki mentions Foundation model)
  • Both PCI and MMIO devices seem to function well (no MSI/X though)
  • Networking seems to function on both QEMU and Firecracker at least based on some simple ping experiments
  • OSv Aarch64 kernel and other binaries can be cross-compiled on Fedora (it should not be difficult to make it build natively on RP4 and it might not be that slow but main OSv makefile would need to be adapted)
  • Both RAMFS and ROFS images can be built and run
  • All unit tests except for Java can be built for Aarch64 and many of them (have not done inventory yet) seem to be passing
  • It is possible to debug OSv with the support of the updated loader.py
    • the best debugging experience for debugging OSv running on RPI4 is to remote debug it from the Fedora machine where it was cross-compiled)
Here is what is left (the details are in the Wiki page and in newly opened issues):

If anyone has ideas on how to solve those newly open issues (especially the arm clock and SMP one) or fill other gaps (for example the floating point support and multiple stacks), please share your knowledge. Even the high-level pointers to what needs to be done especially in regards to adding the floating-point support would be helpful.

Waldek

Nadav Har'El

unread,
Jul 21, 2020, 3:13:55 PM7/21/20
to Waldek Kozaczuk, OSv Development
On Tue, Jul 21, 2020 at 9:12 PM Waldek Kozaczuk <jwkoz...@gmail.com> wrote:
Last month or so I have stayed mainly focused on trying to improve the AArch64 port of OSv. And even though I have made quite many strides in that direction, there is still quite a lot of work left to do. Relatedly I have updated the AArch64 wiki page with more details - https://github.com/cloudius-systems/osv/wiki/AArch64 - feel free to make any corrections you see fit. 

Very nice work!


First of I wanted to say that OSv runs on newest Raspberry PI 4 on both QEMU and Firecracker with KVM on. If you want to replicate my setup please see this portion of the wiki page - https://github.com/cloudius-systems/osv/wiki/AArch64#setup-raspberry-pi-4-for-osv. The one I am using has 4GB of memory (these days you can get the 8GB one for around 50$ I think) and boots from SSD which makes it much faster.

So here is what works:
  • OSv can boot in both emulated AArch64 mode on QEMU as well as on QEMU and Firecracker with KVM acceleration on real AArch64 hardware (this has only been tested on Raspberry PI 4, though original part of the Wiki mentions Foundation model)
  • Both PCI and MMIO devices seem to function well (no MSI/X though)
  • Networking seems to function on both QEMU and Firecracker at least based on some simple ping experiments
  • OSv Aarch64 kernel and other binaries can be cross-compiled on Fedora (it should not be difficult to make it build natively on RP4 and it might not be that slow but main OSv makefile would need to be adapted)
  • Both RAMFS and ROFS images can be built and run
  • All unit tests except for Java can be built for Aarch64 and many of them (have not done inventory yet) seem to be passing
  • It is possible to debug OSv with the support of the updated loader.py
    • the best debugging experience for debugging OSv running on RPI4 is to remote debug it from the Fedora machine where it was cross-compiled)
Here is what is left (the details are in the Wiki page and in newly opened issues):

If anyone has ideas on how to solve those newly open issues (especially the arm clock and SMP one) or fill other gaps (for example the floating point support and multiple stacks), please share your knowledge. Even the high-level pointers to what needs to be done especially in regards to adding the floating-point support would be helpful.

Unfortunately I can't give you any advice on aarch64 - I really know nothing about it. The only general piece of advice I can offer is that if you're stuck on some area, you can take a look at what Linux did in that area, and get good ideas on how to continue. I'm sure Linux supports floating point and all the other stuff you mentioned. For TLS, I would take a look at drepper's TLS document, I seem to remember it mentions a lot of different architectures, maybe it mentions aarch64 as well. Or take a look at what Linux and/or GCC do there.

Good luck!



Waldek

--
You received this message because you are subscribed to the Google Groups "OSv Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email to osv-dev+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/osv-dev/b13b617e-6c2c-4389-bcc4-34ef551423e8n%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages