@@ -73,12 +73,6 @@ pub unsafe fn entry_point_el1(arg0: u64, arg1: u64, arg2: u64, arg3: u64, entry_
7373 arch:: elr_el2:: write ( entry_point) ;
7474 }
7575
76- // Set stack pointer for EL1
77- // SAFETY: We only affect EL1.
78- unsafe {
79- arch:: sp_el1:: write ( arch:: sp ( ) ) ;
80- }
81-
8276 // SAFETY: The caller ensures that the provided arguments are valid and that this is called
8377 // from EL2. We've set the `elr_el2` system register right before calling this, and the caller
8478 // ensured that the value we've set is a valid address for EL1 execution that never returns.
@@ -181,10 +175,6 @@ unsafe fn handle_psci(fn_id: u64, arg0: u64, arg1: u64, arg2: u64) -> Result<u64
181175
182176 let psci_fn = arm_psci:: Function :: try_from ( & [ fn_id, arg0, arg1, arg2] ) ?;
183177 match psci_fn {
184- CpuSuspend { state, entry } => {
185- let result = psci_cpu_suspend ( state, entry) ;
186- Ok ( result)
187- }
188178 Version
189179 | CpuOff
190180 | AffinityInfo { .. }
@@ -205,6 +195,7 @@ unsafe fn handle_psci(fn_id: u64, arg0: u64, arg1: u64, arg2: u64) -> Result<u64
205195 | SetSuspendMode { .. }
206196 | StatResidency { .. }
207197 | StatCount { .. } => {
198+ // forward the PSCI call
208199 let mut smc_args = [ 0 ; 17 ] ;
209200 smc_args[ 0 ] = arg0;
210201 smc_args[ 1 ] = arg1;
@@ -220,6 +211,10 @@ unsafe fn handle_psci(fn_id: u64, arg0: u64, arg1: u64, arg2: u64) -> Result<u64
220211 let result = psci_cpu_on ( fn_id, target_cpu, entry) ;
221212 Ok ( u64:: from ( i32:: from ( result) . cast_unsigned ( ) ) )
222213 }
214+ CpuSuspend { state, entry } => {
215+ let result = psci_cpu_suspend ( state, entry) ;
216+ Ok ( result)
217+ }
223218 }
224219}
225220
0 commit comments