![]() Use the rpi-imager to format an SD card with the regular default Raspberry Pi OS. You also need a UART connection to get early output from Xen and Linux please refer to this article. See this tutorial on how to set up and configure a TFTP server. I like to use TFTP because it makes it extremely fast to update any binary during development. If you intend to hack on Xen on ARM and would like to use the RPi4 to do it, here is what you need to do to get Xen up and running using UBoot and TFTP. We will show you how to run Xen on RPi4, the real Xen hacker way, and as part of a downstream distribution for a much easier end-user experience. Once Linux 5.9 is out, we will have Xen working on RPi4 out of the box. With the Xen and Linux patches applied, Xen and Dom0 work flawlessly. Solving the address translation issue was the end of our fun hacking adventure. The Linux patches are in master and will be available in Linux 5.9. Once we understood the problem, a dozen patches later, we had full support for handling DMA/physical address conversions in Linux. To our surprise and astonishment, the Raspberry Pi 4 was the very first platform to have physical addresses different from DMA addresses, causing the Xen subsystem in Linux to break. It uses it to convert physical addresses, as seen by the guest, to physical addresses, as seen by Xen. The Xen subsystem in Linux is exploiting the DMA/physical address duality for its own address translations. In practice, none of the x86, ARM, and ARM64 platforms where Xen could run had DMA addresses different from physical addresses. The Linux kernel has always had the concept of physical addresses and DMA addresses, where DMA addresses are used to program devices and could be different from physical addresses. We are good to go!” No, not yet. It turns out that the most significant issue was yet to be discovered. We felt confident that we finally reached the end of the line. The patch is now present in Linux’s master branch. The fix was to use a different address translation function when appropriate. It turns out that the RPi4 Linux kernel would sometimes pass virtual addresses that cannot be translated to physical addresses using virt_to_phys, and doing so would result in serious errors. The Xen subsystem in Linux uses virt_to_phys to convert virtual addresses to physical addresses, which works for most virtual addresses but not all. “This lower-than-1GB limitation is uncommon, but now that it is fixed, it is just going to work.” We were wrong again. Julien Grall solved this problem with a simple one-line fix to increase the memory allocation below 1GB for Dom0 on RPi4. The amount of memory below 1GB in Dom0 was not enough. RPi4 has devices that can only access the first 1GB of RAM. The first hurdle was the availability of low memory addresses. We were utterly oblivious that we were about to embark on an adventure deep in the belly of the Xen memory allocator and Linux address translation layers. “It might even work out of the box,” we wrote in our reply. Soon Roman Shaposhnik of Project EVE and a few other community members started asking about it on the xen-devel mailing list. ![]() Finally, we could run Xen on an RPi device. Then the Raspberry Pi 4 came along, together with a regular GIC-400 interrupt controller that Xen supports out of the box. Specifically, a non-standard interrupt controller without virtualization support. We have always been eager to get the Xen hypervisor running on it, but technical differences between RPi and other Arm platforms made it impractical for the longest time. According to the RPi Foundation, over 35 million have been sold, with 44% of these sold into industry. Raspberry Pi (RPi) has been a key enabling device for the Arm community for years, given the low price and widespread adoption. Read more to learn about how Xen now runs on RPi and how to get started. This is an exciting step for both hobbyists and industries. Originally posted on, the Xen Project is excited to share that the Xen Hypervisor now runs on Raspberry Pi. Written by Roman Shaposhnik, Project EVE lead and Co-Founder &VP of Products and Strategy at ZEDEDA, and Stefano Stabellini, Principal Engineer for Xilinx ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |