-
Notifications
You must be signed in to change notification settings - Fork 63
arch: Add aarch64 support #205
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
Merged
retrage
merged 15 commits into
cloud-hypervisor:main
from
retrage:aarch64-ch-support-clean-v2
Jan 22, 2023
Merged
Changes from all commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
5ac5659
build: Add initial support for aarch64 build
retrage a1914d5
aarch64: Implement paging
retrage c63bced
fdt: Add support for booting using FDT info
retrage 95f36f5
delay: Add arch-dependent instruction calls for aarch64
retrage cae6821
serial: Add aarch64 PrimeCell UART (PL011) support
retrage 016ec3e
rtc: Add aarch64 PrimeCell RTC (PL031) support
retrage 418d940
pci: Implement ECAM-based PCI config access for aarch64
retrage 3f42e05
arch/aarch64: Add `MEM_LAYOUT` for aarch64
retrage f520b34
build: Implement startup function for aarch64
retrage d77c2bb
scripts: Remove unused option `--dev`
retrage 9e23fbe
scripts: Add option to use local container image
retrage 2324ce7
resources: Add aarch64 support to Dockerfile
retrage dcddbcb
scripts: Add aarch64 support to containerized build
retrage bc1745a
build: Add aarch64 target to GitHub Actions build
retrage 9b21de0
tests: Add unit tests for aarch64
retrage File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| { | ||
| "llvm-target": "aarch64-unknown-none", | ||
| "abi": "softfloat", | ||
| "arch": "aarch64", | ||
| "data-layout": "e-m:e-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128", | ||
| "disable-redzone": true, | ||
| "features": "+strict-align,-neon,-fp-armv8", | ||
| "linker": "rust-lld", | ||
| "linker-flavor": "ld.lld", | ||
| "os": "none", | ||
| "executables": true, | ||
| "max-atomic-width": 128, | ||
| "panic-strategy": "abort", | ||
| "code-model": "small", | ||
| "relocation-model": "pic", | ||
| "target-pointer-width": "64", | ||
| "pre-link-args": { | ||
| "ld.lld": ["--script=aarch64-unknown-none.ld", "--oformat=binary"] | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -0,0 +1,44 @@ | ||||||
| ENTRY(ram64_start) | ||||||
|
|
||||||
| /* Cloud Hypervisor Memory layout: | ||||||
| DRAM: [0x4000_0000-0xfc00_0000] | ||||||
| FDT: [0x4000_0000-0x401f_ffff) | ||||||
| ACPI: [0x4020_0000-0x403f_ffff) | ||||||
| kernel: [0x4048_0000-] | ||||||
| The stack start is at the end of the DRAM region. */ | ||||||
| ram_min = 0x40480000; | ||||||
|
|
||||||
| SECTIONS | ||||||
| { | ||||||
| /* Mapping the program headers and note into RAM makes the file smaller. */ | ||||||
| . = ram_min; | ||||||
|
|
||||||
| /* These sections are mapped into RAM from the file. Omitting :ram from | ||||||
| later sections avoids emitting empty sections in the final binary. */ | ||||||
| code_start = .; | ||||||
| .text.boot : { *(.text.boot) } | ||||||
| .text : { *(.text .text.*) } | ||||||
| . = ALIGN(4K); | ||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
Paging and TTable code assumes 64KiB pages, but you are aligning to 4KiB here (rest of file as well) |
||||||
| code_end = .; | ||||||
|
|
||||||
| data_start = .; | ||||||
| .data : { *(.data .data.*) } | ||||||
| .rodata : { *(.rodata .rodata.*) } | ||||||
|
|
||||||
| /* The BSS section isn't mapped from file data. It is just zeroed in RAM. */ | ||||||
| .bss : { | ||||||
| *(.bss .bss.*) | ||||||
| } | ||||||
| . = ALIGN(4K); | ||||||
| data_end = .; | ||||||
|
|
||||||
| stack_start = .; | ||||||
| .stack (NOLOAD) : ALIGN(4K) { . += 128K; } | ||||||
| stack_end = .; | ||||||
|
|
||||||
| /* Strip symbols from the output binary (comment out to get symbols) */ | ||||||
| /DISCARD/ : { | ||||||
| *(.symtab) | ||||||
| *(.strtab) | ||||||
| } | ||||||
| } | ||||||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,6 @@ | ||
| fn main() { | ||
| println!("cargo:rerun-if-changed=aarch64-unknown-none.json"); | ||
| println!("cargo:rerun-if-changed=aarch64-unknown-none.ld"); | ||
| println!("cargo:rerun-if-changed=x86_64-unknown-none.json"); | ||
| println!("cargo:rerun-if-changed=x86_64-unknown-none.ld"); | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,5 @@ | ||
| [toolchain] | ||
| channel = "nightly-2022-11-12" | ||
| components = ["rust-src", "clippy", "rustfmt"] | ||
| targets = ["x86_64-unknown-linux-gnu"] | ||
| targets = ["aarch64-unknown-linux-gnu", "x86_64-unknown-linux-gnu"] | ||
| profile = "default" |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.