-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This commit adds support for the arm64 (aarch64) architecture. This is achived by adapting the compact unwind information generation to deal with the DWARF registers that this architecture maps to and by modifying the unwinder. These changes support PAC (Pointer Authentication Code), see test plan for more details. While working on this feature I realised that the vDSO included in Ubuntu 24.10 (6.11.0-12-generic) does not contain unwind information. In the future we should synthetise it which should be easy enough as it seems to be compiled with frame pointers. Test Plan ========= Ran tests locally on the arm64 machine mentioned above, and the PAC-enabled binary (see tests/testprogs/). The tests will also be run for this arch. ``` 2025-01-22T12:59:32.726079Z INFO lightswitch::profiler: unwinder stats: unwinder_stats_t { total: 44, success_dwarf: 44, error_truncated: 0, error_unsupported_expression: 0, error_unsupported_frame_pointer_action: 0, error_unsupported_cfa_register: 0, error_previous_rsp_zero: 0, error_previous_rip_zero: 0, error_previous_rbp_zero: 0, error_should_never_happen: 0, error_mapping_not_found: 0, error_mapping_does_not_contain_pc: 0, error_chunk_not_found: 0, error_binary_search_exhausted_iterations: 0, error_sending_new_process_event: 0, error_cfa_offset_did_not_fit: 0, error_rbp_offset_did_not_fit: 0, bp_non_zero_for_bottom_frame: 0, vdso_encountered: 0, jit_encountered: 0 } ```
- Loading branch information
1 parent
a45d67e
commit cf98322
Showing
10 changed files
with
131 additions
and
37 deletions.
There are no files selected for viewing
This file contains 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 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 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 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 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 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 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 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 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,15 @@ | ||
#[derive(PartialEq)] | ||
pub enum Architecture { | ||
Arm64, | ||
X86, | ||
} | ||
|
||
#[cfg(target_arch = "aarch64")] | ||
pub fn architecture() -> Architecture { | ||
Architecture::Arm64 | ||
} | ||
|
||
#[cfg(target_arch = "x86_64")] | ||
pub fn architecture() -> Architecture { | ||
Architecture::X86 | ||
} |
This file contains 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,6 +1,9 @@ | ||
mod arch; | ||
mod cpu; | ||
mod lpm; | ||
|
||
pub use arch::architecture; | ||
pub use arch::Architecture; | ||
pub use cpu::get_online_cpus; | ||
pub use lpm::summarize_address_range; | ||
pub use lpm::AddressBlockRange; |