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
arm64/xen: Introduce xen support for aarch64 architecture #726
arm64/xen: Introduce xen support for aarch64 architecture #726
Conversation
Thanks, @oleksiimoisieiev. I've added tags, reviewers and assignees. We'll aim to get the work done for release 0.13 in late April. |
oleksiimoisieiev many thanks. Approved-by: Michalis Pappas michalis@unikraft.io |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't mind me, just leaving the tag again.
Approved-by: Michalis Pappas michalis@unikraft.io
Changes in this commit were extracted from Mini-OS and implement arm64 loader support for the Unikraft. Implemented features on this stage are the following: * create unikernel binary both ELF and ZBOOT (include ZBOOT entry) * initialization of the basic hardware * enable emergency console to show program output * modify configuration to allow selecting XEN guest for aarch64 * event channels implementation * hypervisor console implementation Checkpatch-Ignore: AVOID_BUG Checkpatch-Ignore: AVOID_EXTERNS Reviewed-by: Oleksandr Grytsov <Oleksandr_Grytsov@epam.com> Signed-off-by: Oleksii Moisieiev <oleksii_moisieiev@epam.com> Reviewed-by: Michalis Pappas <michalis@unikraft.io> Reviewed-by: Andrei Stan <andreistan2003@gmail.com> Approved-by: Michalis Pappas <michalis@unikraft.io> GitHub-Closes: #726
Implementation of the grant-table support and interrupt support. Partly moved from Mini-OS and from plat/xen/kvm. Interrupt support was adopted to use gicv2 and gicv3. Checkpatch-Ignore: AVOID_BUG Checkpatch-Ignore: AVOID_EXTERNS Reviewed-by: Oleksandr Grytsov <Oleksandr_Grytsov@epam.com> Signed-off-by: Oleksii Moisieiev <oleksii_moisieiev@epam.com> Reviewed-by: Michalis Pappas <michalis@unikraft.io> Reviewed-by: Andrei Stan <andreistan2003@gmail.com> Approved-by: Michalis Pappas <michalis@unikraft.io> GitHub-Closes: #726
Some platforms may require additional steps to init interrupt controller properly. That's why introducing platform_specific init function which is called after address read and before probe finish for interrupt controller. This function accepts struct uk_intctlr_plat_data pointer as input parameter and generic pointer as output parameter which has to be interpreted by interrupt controller. If function was not defined - it just returns 0. For aarch64 Xen platform struct uk_intctlr_plat_probe accepts address of destributor/redistributor address from GIC pair and returns mapped address that can be used to access registers. Signed-off-by: Oleksii Moisieiev <oleksii_moisieiev@epam.com> Reviewed-by: Michalis Pappas <michalis@unikraft.io> Reviewed-by: Andrei Stan <andreistan2003@gmail.com> Approved-by: Michalis Pappas <michalis@unikraft.io> GitHub-Closes: #726
uk_intctlr_plat_probe is platform specific initialization for GIC drivers. It maps destributor/redistributor address to the page table so system can access registers and returns mapped addresses to GIC driver. Signed-off-by: Oleksii Moisieiev <oleksii_moisieiev@epam.com> Reviewed-by: Michalis Pappas <michalis@unikraft.io> Reviewed-by: Andrei Stan <andreistan2003@gmail.com> Approved-by: Michalis Pappas <michalis@unikraft.io> GitHub-Closes: #726
Add platform specific init support for GIC drivers. Some platforms, such as Xen may require GIC destributor/redistributor address to be mapped to the mmu tables so system can access registers. So addresses are passed to the uk_intctlr_plat_probe and mapped addresses are expected. Signed-off-by: Oleksii Moisieiev <oleksii_moisieiev@epam.com> Reviewed-by: Michalis Pappas <michalis@unikraft.io> Reviewed-by: Andrei Stan <andreistan2003@gmail.com> Approved-by: Michalis Pappas <michalis@unikraft.io> GitHub-Closes: #726
arch_timer implemented for arm32 is not suitable for aarch64 because it doesn't use interrupts so makes system to wait forever during sleep call. Added support for generic interrupt based timer. Reviewed-by: Oleksandr Grytsov <Oleksandr_Grytsov@epam.com> Signed-off-by: Oleksii Moisieiev <oleksii_moisieiev@epam.com> Reviewed-by: Michalis Pappas <michalis@unikraft.io> Reviewed-by: Andrei Stan <andreistan2003@gmail.com> Approved-by: Michalis Pappas <michalis@unikraft.io> GitHub-Closes: #726
Added check to __XEN_INTERFACE_VERSION__ being empty. In this case default value should also be set. Reviewed-by: Oleksandr Grytsov <Oleksandr_Grytsov@epam.com> Signed-off-by: Oleksii Moisieiev <oleksii_moisieiev@epam.com> Reviewed-by: Michalis Pappas <michalis@unikraft.io> Reviewed-by: Andrei Stan <andreistan2003@gmail.com> Approved-by: Michalis Pappas <michalis@unikraft.io> GitHub-Closes: #726
Adaptation of the netfront and 9p drivers to compile and start on aarch64. Reviewed-by: Oleksandr Grytsov <Oleksandr_Grytsov@epam.com> Signed-off-by: Oleksii Moisieiev <oleksii_moisieiev@epam.com> Reviewed-by: Michalis Pappas <michalis@unikraft.io> Reviewed-by: Andrei Stan <andreistan2003@gmail.com> Approved-by: Michalis Pappas <michalis@unikraft.io> GitHub-Closes: #726
When multiprocessor configuration is enabled, run and wakeup interrupts should be registered. Signed-off-by: Oleksii Moisieiev <oleksii_moisieiev@epam.com> Reviewed-by: Michalis Pappas <michalis@unikraft.io> Reviewed-by: Andrei Stan <andreistan2003@gmail.com> Approved-by: Michalis Pappas <michalis@unikraft.io> GitHub-Closes: #726
Event IRQ (31) is responsible for getting responses from event channels. Signed-off-by: Oleksii Moisieiev <oleksii_moisieiev@epam.com> Reviewed-by: Michalis Pappas <michalis@unikraft.io> Reviewed-by: Andrei Stan <andreistan2003@gmail.com> Approved-by: Michalis Pappas <michalis@unikraft.io> GitHub-Closes: #726
Moving to common place to prevent copying code. Signed-off-by: Oleksii Moisieiev <oleksii_moisieiev@epam.com> Reviewed-by: Michalis Pappas <michalis@unikraft.io> Reviewed-by: Andrei Stan <andreistan2003@gmail.com> Approved-by: Michalis Pappas <michalis@unikraft.io> GitHub-Closes: #726
grant_table region, reading from the DTB has an address, which is outside of the memory region, allocated for the domain. That's why grant_table region should be mapped to the page table. Also removed setup_table call because it shouldn't be called with XENMEM_add_to_physmap. Signed-off-by: Oleksii Moisieiev <oleksii_moisieiev@epam.com> Reviewed-by: Michalis Pappas <michalis@unikraft.io> Reviewed-by: Andrei Stan <andreistan2003@gmail.com> Approved-by: Michalis Pappas <michalis@unikraft.io> GitHub-Closes: #726
Signed-off-by: Oleksii Moisieiev <oleksii_moisieiev@epam.com> Reviewed-by: Michalis Pappas <michalis@unikraft.io> Reviewed-by: Andrei Stan <andreistan2003@gmail.com> Approved-by: Michalis Pappas <michalis@unikraft.io> GitHub-Closes: #726
MAIR values should be programed to different slots, which are made by MAIR macro. It moves MAIR_* mask left on MT_* * 8 bits so MAIR masks won't overlap. Signed-off-by: Volodymyr Babchuk <volodymyr_babchuk@epam.com> Reviewed-by: Michalis Pappas <michalis@unikraft.io> Reviewed-by: Andrei Stan <andreistan2003@gmail.com> Approved-by: Michalis Pappas <michalis@unikraft.io> GitHub-Closes: #726
fdt64_ld function generate correct memory-aligned value. This call is safer than fdt_to_cpu because it accepts pointer, which potentially can be an array. For example libfdt is using fdt64_ld_ function to parse addresses (although it's a wrapper around fdt64_to_cpu. Signed-off-by: Oleksii Moisieiev <oleksii_moisieiev@epam.com> Reviewed-by: Michalis Pappas <michalis@unikraft.io> Reviewed-by: Andrei Stan <andreistan2003@gmail.com> Approved-by: Michalis Pappas <michalis@unikraft.io> GitHub-Closes: #726
When building PLAT_XEN for ARCH_ARM_64 enable GICv3 as default interrupt controller for the platform. Signed-off-by: Oleksii Moisieiev <oleksii_moisieiev@epam.com> Reviewed-by: Michalis Pappas <michalis@unikraft.io> Reviewed-by: Andrei Stan <andreistan2003@gmail.com> Approved-by: Michalis Pappas <michalis@unikraft.io> GitHub-Closes: #726
During xenbus state switch function checks if state was already set. There should be used state_path instead of xenbus->nodename to read the correct state information. Signed-off-by: Oleksii Moisieiev <oleksii_moisieiev@epam.com> Reviewed-by: Michalis Pappas <michalis@unikraft.io> Reviewed-by: Andrei Stan <andreistan2003@gmail.com> Approved-by: Michalis Pappas <michalis@unikraft.io> GitHub-Closes: #726
Set vaddr as pbase in mrd region to handle correctly heap region space. Signed-off-by: Oleksii Moisieiev <oleksii_moisieiev@epam.com> Reviewed-by: Michalis Pappas <michalis@unikraft.io> Reviewed-by: Andrei Stan <andreistan2003@gmail.com> Approved-by: Michalis Pappas <michalis@unikraft.io> GitHub-Closes: #726
There is no need to stop probe sequence when some devtype probe was failed. For example if system can't probe 9pfs it shouldn't skip probing other device types, such as netdev or blkdev. System is workable without 9pfs support. Signed-off-by: Oleksii Moisieiev <oleksii_moisieiev@epam.com> Reviewed-by: Michalis Pappas <michalis@unikraft.io> Reviewed-by: Andrei Stan <andreistan2003@gmail.com> Approved-by: Michalis Pappas <michalis@unikraft.io> GitHub-Closes: #726
Sets correct permissions for the segments and assigns sections to the correct segments for Xen Arm64 architecture. This is an enhancement of the PHDRs introduced in: Commit c2245ac ("build: Place sections into segments with correct permissions") Signed-off-by: Oleksii Moisieiev <oleksii_moisieiev@epam.com> Reviewed-by: Michalis Pappas <michalis@unikraft.io> Reviewed-by: Andrei Stan <andreistan2003@gmail.com> Approved-by: Michalis Pappas <michalis@unikraft.io> GitHub-Closes: #726
According to the new driver model, XEN related drivers were moved from plat and placed in drivers directory with conditional build. Signed-off-by: Oleksii Moisieiev <oleksii_moisieiev@epam.com> Reviewed-by: Michalis Pappas <michalis@unikraft.io> Reviewed-by: Andrei Stan <andreistan2003@gmail.com> Approved-by: Michalis Pappas <michalis@unikraft.io> GitHub-Closes: #726
Prerequisite checklist
checkpatch.pl
on your commit series before opening this PR;Base target
arm64
]xen
]Additional configuration
CONFIG_ARCH_ARM_64=y
CONFIG_PLAT_XEN=y
CONFIG_XEN_GNTTAB=y
CONFIG_LIBXEN_XENBUS=y
CONFIG_XEN_KERNEL_HV_CONSOLE=y
CONFIG_XEN_KERNEL_EMG_CONSOLE=y
CONFIG_XEN_DEBUG_HV_CONSOLE=y
CONFIG_XEN_DEBUG_EMG_CONSOLE=y
CONFIG_LIBXEN_NETFRONT=y
CONFIG_LIBXEN_BLKFRONT=y
CONFIG_LIBXEN_BLKFRONT_GREFPOOL=y
Description of changes
This is the implementation of the arm64 support for XEN hypervisor. Includes the following features:
GitHub-DependsOn: #1269