1- use aarch64_cpu:: registers:: { ESR_EL2 , HCR_EL2 , Readable , SCTLR_EL1 , VTCR_EL2 , VTTBR_EL2 } ;
2-
3- use axaddrspace:: GuestPhysAddr ;
4- use axaddrspace:: device:: AccessWidth ;
5- use axerrno:: { AxError , AxResult } ;
6- use axvcpu:: AxVCpuExitReason ;
7-
81use crate :: TrapFrame ;
92use crate :: exception_utils:: {
103 exception_class, exception_class_value, exception_data_abort_access_is_write,
@@ -15,6 +8,15 @@ use crate::exception_utils::{
158 exception_sysreg_direction_write, exception_sysreg_gpr,
169} ;
1710
11+ use aarch64_cpu:: registers:: { ESR_EL2 , HCR_EL2 , Readable , SCTLR_EL1 , VTCR_EL2 , VTTBR_EL2 } ;
12+ use axaddrspace:: {
13+ GuestPhysAddr ,
14+ device:: { AccessWidth , SysRegAddr } ,
15+ } ;
16+ use axerrno:: { AxError , AxResult } ;
17+ use axvcpu:: AxVCpuExitReason ;
18+ use log:: error;
19+
1820numeric_enum_macro:: numeric_enum! {
1921#[ repr( u8 ) ]
2022#[ derive( Debug ) ]
@@ -179,6 +181,7 @@ fn handle_data_abort(context_frame: &mut TrapFrame) -> AxResult<AxVCpuExitReason
179181 width,
180182 reg,
181183 reg_width,
184+ signed_ext : false ,
182185 } )
183186}
184187
@@ -204,11 +207,14 @@ fn handle_system_register(context_frame: &mut TrapFrame) -> AxResult<AxVCpuExitR
204207 context_frame. set_exception_pc ( val) ;
205208 if write {
206209 return Ok ( AxVCpuExitReason :: SysRegWrite {
207- addr,
210+ addr : SysRegAddr :: new ( addr ) ,
208211 value : context_frame. gpr ( reg as usize ) as u64 ,
209212 } ) ;
210213 }
211- Ok ( AxVCpuExitReason :: SysRegRead { addr, reg } )
214+ Ok ( AxVCpuExitReason :: SysRegRead {
215+ addr : SysRegAddr :: new ( addr) ,
216+ reg,
217+ } )
212218}
213219
214220/// Handles HVC or SMC exceptions that serve as psci (Power State Coordination Interface) calls.
@@ -284,6 +290,14 @@ fn current_el_irq_handler(_tf: &mut TrapFrame) {
284290/// Handles synchronous exceptions that occur from the current exception level.
285291#[ unsafe( no_mangle) ]
286292fn current_el_sync_handler ( tf : & mut TrapFrame ) {
293+ let esr = ESR_EL2 . extract ( ) ;
294+ let ec = ESR_EL2 . read ( ESR_EL2 :: EC ) ;
295+ let iss = ESR_EL2 . read ( ESR_EL2 :: ISS ) ;
296+
297+ error ! ( "ESR_EL2: {:#x}" , esr. get( ) ) ;
298+ error ! ( "Exception Class: {:#x}" , ec) ;
299+ error ! ( "Instruction Specific Syndrome: {:#x}" , iss) ;
300+
287301 panic ! (
288302 "Unhandled synchronous exception from current EL: {:#x?}" ,
289303 tf
0 commit comments