-
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.
Use SMC for PSCI calls issued from EL2
- Loading branch information
1 parent
4e12172
commit 54f1eda
Showing
3 changed files
with
19 additions
and
15 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,6 +3,7 @@ | |
// Author: Ard Biesheuvel <[email protected]> | ||
|
||
use core::arch::asm; | ||
use crate::current_el; | ||
|
||
const ID_AA64ISAR0_RNDR_SHIFT: usize = 60; | ||
|
||
|
@@ -21,18 +22,6 @@ const ARM_SMCCC_TRNG_RND64: u32 = 0xc4000053; | |
|
||
const MAX_BITS_PER_CALL: usize = 192; | ||
|
||
fn current_el() -> u64 { | ||
let mut l: u64; | ||
unsafe { | ||
asm!( | ||
"mrs {reg}, CurrentEL", | ||
reg = out(reg) l, | ||
options(pure, nomem, nostack, preserves_flags) | ||
); | ||
} | ||
l >> 2 | ||
} | ||
|
||
fn smccc_call(fid: u32, arg: u32, use_smc: bool) -> i32 { | ||
let mut ret: i32; | ||
if use_smc { | ||
|