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

plat/kvm/arm64: Firecracker support on arm64 #989

Closed
wants to merge 2 commits into from

Conversation

michpappas
Copy link
Member

Prerequisite checklist

  • Read the contribution guidelines regarding submitting new changes to the project;
  • Tested your changes against relevant architectures and platforms;
  • Ran the checkpatch.uk on your commit series before opening this PR;
  • Updated relevant documentation.

Base target

  • Architecture(s): [arm_64]
  • Platform(s): [kvm]
  • Application(s): [N/A]

Additional configuration

Enables using CONFIG_KVM_VMM_FIRECRACKER on arm64.

Description of changes

This PR enables Firecracker support on arm64. It introduces a set of boot pagetables for Firecracker and updates Config.uk to allow using CONFIG_KVM_VMM_FIRECRACER on arm64. Remaining work such as the linux boot probotol on arm64 and ns16550 are handled on depending PRs.

GitHub-Depends-On: #988
GitHub-Depends-On: #986
GitHub-Depends-On: #985
GitHub-Depends-On: #912

@michpappas michpappas requested review from a team as code owners July 24, 2023 04:51
@razvand razvand removed request for a team July 24, 2023 06:12
@razvand razvand added this to the v0.14.0 (Prometheus) milestone Jul 24, 2023
@razvand razvand added area/plat Unikraft Patform plat/kvm Unikraft for KVM kind/proposal arch/arm64 labels Jul 24, 2023
@unikraft-bot unikraft-bot added arch/arm arch/x86_64 area/arch Unikraft Architecture area/include Part of include/uk area/kconfig Part of the Unikraft KConfig option system area/lib Internal Unikraft Microlibrary labels Jul 24, 2023
@unikraft-bot unikraft-bot added area/makefile Part of the Unikraft Makefile build system lang/c Issues or PRs to do with C/C++ lang/python Issues or PRs to do with Python lib/ukboot plat/common Common to all platforms plat/driver plat/driver/gic plat/driver/virtio plat/xen Unikraft for Xen labels Jul 24, 2023

/* ------------------- Memory Map of Firecracker on Arm64 -----------------
*
* 0x0000000000000000 - 0x0000000007ffffff Devices: 0 - 2GiB
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

2GiB should correspond to 0x000000007fffffff instead of 0x0000000007fffff.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, fixed

Copy link
Member

@mogasergiu mogasergiu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor repetitive comments for you to lose your sanity 🐕‍🦺.

@@ -6,7 +6,11 @@
#ifndef __KVM_ARM64_IMAGE_H__
#define __KVM_ARM64_IMAGE_H__

#if defined(CONFIG_KVM_VMM_QEMU)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now that Simon mentioned it. Maybe we can just go with #if?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes will fix thanks


#include <arm/arm64/pagetable.S>

#include <arch/reloc.h>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe it should be uk/reloc.h now

ur_pte arm64_bpt_l2_pt511, PTE_TYPE_TABLE
#else
pte_zero , 1
#endif /* CONFIG_PAGING */
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

!CONFIG_PAGING

ur_pte arm64_bpt_l2_pt0, PTE_TYPE_TABLE
ur_pte arm64_bpt_l2_pt1, PTE_TYPE_TABLE
pte_zero , 509
#ifdef CONFIG_PAGING
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ditto for #if

arm64_bpt_l2_pt1:
pte_fill 0x0000008000000000, 512, 2, PTE_BLOCK_NORMAL_RW

#ifdef CONFIG_PAGING
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ditto 🐦

ur_pte arm64_bpt_l2_pt511, PTE_TYPE_TABLE
#else
pte_zero , 1
#endif /* CONFIG_PAGING */
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

!CONFIG_PAGING

pte_zero , 509
#ifdef CONFIG_PAGING
ur_pte arm64_bpt_l2_pt511, PTE_TYPE_TABLE
#else
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/* CONFIG_PAGING */ 🐶

pte_zero , 509
#ifdef CONFIG_PAGING
ur_pte arm64_bpt_l2_pt511, PTE_TYPE_TABLE
#else
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/* CONFIG_PAGING */ 🦤

Copy link
Member

@mogasergiu mogasergiu Aug 11, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry meant with an ! of course 🤓 ☝️

EDIT: No, I am dumb it's fine 🤦‍♂️ 😆

arm64_bpt_l2_pt1:
pte_fill 0x0000008000000000, 512, 2, PTE_BLOCK_DEVICE_nGnRE

#ifdef CONFIG_PAGING
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ditto for #if

ur_pte arm64_bpt_l2_pt0, PTE_TYPE_TABLE
ur_pte arm64_bpt_l2_pt1, PTE_TYPE_TABLE
pte_zero , 509
#ifdef CONFIG_PAGING
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ditto 🦜

@michpappas michpappas force-pushed the arm64_firecracker branch 2 times, most recently from a236474 to 79d924c Compare August 11, 2023 17:40
Copy link
Member

@mogasergiu mogasergiu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FC, meet the superior architecture! 💪

Reviewed-by: Sergiu Moga sergiu@unikraft.io

Copy link
Contributor

@razvand razvand left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved-by: Razvan Deaconescu razvand@unikraft.io

@razvand razvand requested a review from zhxj9823 August 11, 2023 19:59
The memory map of Firecracker on Arm64 is:

0x0000000000000000 - 0x000000007fffffff     Devices:     0 -    2GiB
0x0000000080000000 - 0x000000ffffffffff     DRAM:     2GiB - 1024GiB

https://github.com/firecracker-microvm/firecracker
441fc98a src/vmm/src/arch/aarch64/layout.rs

Signed-off-by: Michalis Pappas <michalis@unikraft.io>
Signed-off-by: Michalis Pappas <michalis@unikraft.io>
unikraft-bot pushed a commit that referenced this pull request Aug 11, 2023
Signed-off-by: Michalis Pappas <michalis@unikraft.io>
Reviewed-by: Sergiu Moga <sergiu@unikraft.io>
Approved-by: Razvan Deaconescu <razvand@unikraft.io>
Tested-by: Unikraft CI <monkey@unikraft.io>
GitHub-Closes: #989
@unikraft-bot unikraft-bot added the ci/merged Merged by CI label Aug 11, 2023
@nderjung nderjung added the release-note Denotes a PR that will be considered when it comes time to generate release notes. label Aug 11, 2023
@unikraft-bot
Copy link
Member

Checkpatch passed

Beep boop! I ran Unikraft's checkpatch.pl support script on your pull request and it all looks good!

SHA commit checkpatch
97a4187 plat/kvm/arm: Add pagetables for Firecracker
a24c625 plat/kvm: Enable Firecracker on arm64

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
arch/arm arch/arm64 arch/x86_64 area/arch Unikraft Architecture area/include Part of include/uk area/kconfig Part of the Unikraft KConfig option system area/lib Internal Unikraft Microlibrary area/makefile Part of the Unikraft Makefile build system area/plat Unikraft Patform ci/merged Merged by CI kind/proposal lang/c Issues or PRs to do with C/C++ lang/python Issues or PRs to do with Python lib/ukboot plat/common Common to all platforms plat/driver/gic plat/driver/virtio plat/driver plat/kvm Unikraft for KVM plat/xen Unikraft for Xen release-note Denotes a PR that will be considered when it comes time to generate release notes.
Projects
Status: Done!
Development

Successfully merging this pull request may close these issues.

None yet

7 participants