-
Notifications
You must be signed in to change notification settings - Fork 58
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
arch: Add aarch64 support #205
arch: Add aarch64 support #205
Conversation
8628f53
to
568ed71
Compare
7ee0cf2
to
edeabe7
Compare
I mark this PR as ready for review as I added aarch64 support to some basic tests and CI builds.
|
For the unit test and integration test, is it possible to deploy them to the AArch64 server that is carrying the CI of the Cloud hypervisor repo? |
3b65650
to
907c346
Compare
Thank you for your comment. I added the unit tests to Jenkins CI (907c346). |
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.
Hi @retrage, this is such a great work! Thank you very much for introducing this :)
I quickly went through the series and have two questions. Will have a more detailed review later.
The |
Let me explain the entry code to answer #205 (comment) and #205 (comment). I need to explain the magic instruction: add x13, x18, #0x16 /* code0 */ The assembler encodes this instruction to Anyway, I'll add source code comments to give contexts. [1] https://www.kernel.org/doc/Documentation/arm64/booting.txt |
`E820Entry` is used in `boot::Info` trait, which is x86_64-dependent memory entry data structure. It's confusing if e820 is used in other architectures. This commit introduces an architecture-independent memory entry `bootinfo::MemoryEntry` and replaces `boot::Info` with `bootinfo::Info`. This change is suggested in [1]. [1] cloud-hypervisor#205 (comment) Signed-off-by: Akira Moroo <retrage01@gmail.com>
`E820Entry` is used in `boot::Info` trait, which is x86_64-dependent memory entry data structure. It's confusing if e820 is used in other architectures. This commit introduces an architecture-independent memory entry `bootinfo::MemoryEntry` and replaces `boot::Info` with `bootinfo::Info`. This change is suggested in [1]. [1] cloud-hypervisor#205 (comment) Signed-off-by: Akira Moroo <retrage01@gmail.com>
`E820Entry` is used in `boot::Info` trait, which is x86_64-dependent memory entry data structure. It's confusing if e820 is used in other architectures. This commit introduces an architecture-independent memory entry `bootinfo::MemoryEntry` and replaces `boot::Info` with `bootinfo::Info`. This change is suggested in [1]. [1] #205 (comment) Signed-off-by: Akira Moroo <retrage01@gmail.com>
8b83669
to
b84a04b
Compare
@retrage. Great work! Could you elaborate on this so we can get this included? |
code_start = .; | ||
.text.boot : { *(.text.boot) } | ||
.text : { *(.text .text.*) } | ||
. = ALIGN(4K); |
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.
. = ALIGN(4K); | |
. = ALIGN(64K); |
Paging and TTable code assumes 64KiB pages, but you are aligning to 4KiB here (rest of file as well)
This commit adds initial support for aarch64 build. The goal is to boot Linux with this firmware on aarch64 Cloud Hypervisor. This commit includes a bootstrap assembly and build configs for building a binary that complies the Linux kernel image format [1]. It also includes some stub code to make the aarch64 target buildable with minimal changes. The later commits will implement the code. The current `pe::tests::test_loader` test uses an x86_64 specific disk image. We need to provide aarch64 specific target for the test. [1] https://docs.kernel.org/arm64/booting.html#call-the-kernel-image Signed-off-by: Akira Moroo <retrage01@gmail.com>
This commit adds initial paging support for aarch64. This implementation creates identity mapping translation tables for Cloud Hypervisor. The most of paging implementation is based on [1]. It also introduces use of `asm_const` to parameterize FDT base address and stack base address. [1] https://github.com/rust-embedded/rust-raspberrypi-OS-tutorials/tree/master/10_virtual_mem_part1_identity_mapping Signed-off-by: Akira Moroo <retrage01@gmail.com>
This commit introduces `fdt::StartInfo` to boot using device info from FDT. Signed-off-by: Akira Moroo <retrage01@gmail.com>
Signed-off-by: Akira Moroo <retrage01@gmail.com>
This commit implements aarch64 specific UART device PL011 driver. Signed-off-by: Akira Moroo <retrage01@gmail.com>
This commit implements aarch64 specific RTC device PL031 driver. Signed-off-by: Akira Moroo <retrage01@gmail.com>
Signed-off-by: Akira Moroo <retrage01@gmail.com>
Signed-off-by: Akira Moroo <retrage01@gmail.com>
This commit implements aarch64 specific `rust64_start()` to enable aarch64 boot. Signed-off-by: Akira Moroo <retrage01@gmail.com>
Signed-off-by: Akira Moroo <retrage01@gmail.com>
Signed-off-by: Akira Moroo <retrage01@gmail.com>
Signed-off-by: Akira Moroo <retrage01@gmail.com>
This commit adds aarch64 support to containerized build and test. The integration tests are not yet supported for aarch64. Signed-off-by: Akira Moroo <retrage01@gmail.com>
This commit introduces matrix to add the aarch64 target. The unit tests are disabled for aarch64 target because default GitHub Actions runners are x86_64 only. Signed-off-by: Akira Moroo <retrage01@gmail.com>
NOTE: Because docker pull fallbacks to linux/amd64 even if explicitly specify image platform when linux/arm64 image not found, the unit tests will fail. To avoid this, `--local` option is added to build local container image. This option should be removed after linux/arm64 container image is pushed to the registry. Signed-off-by: Akira Moroo <retrage01@gmail.com>
b84a04b
to
9b21de0
Compare
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.
lgtm from me but I would like to hear review from one of the ARM folks. Also we need to get the integration testing in so this good work doesn't get accidentally broken!
@jongwu , @MrXinWang and me also reviewed and discussed about the code. No more comments from us. |
@retrage Please merge when you're ready. |
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.
As @michael2012z said. No more comment from my side. Thanks for the effort!
Thank you for your approval. Although there is a lot of room for improvement, but I would like to merge this PR so far. I'll keep #198 updated to track remaining issues for aarch64. As for integration testing, I'm still working on getting other disk images other than the custom Ubuntu 18.04 image to work so that we can run integration tests just like x86_64. |
This PR proposes introducing an initial aarch64 support (#198) for aarch64/KVM Cloud Hypervisor.
NOTE: This is a draft PR. It is not ready for review. The main blocking issue is that the changes in commit a2a986f leads to fail existing CI tests. I need to fix the breaking changes.