日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

[答疑]-ATF中异常向量表为何没有实现“Current Exception level with SP_ELx, x>0.“

發布時間:2025/3/21 编程问答 24 豆豆
生活随笔 收集整理的這篇文章主要介紹了 [答疑]-ATF中异常向量表为何没有实现“Current Exception level with SP_ELx, x>0.“ 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

先看下ARM官方文檔中所定義的向量表

第一行描述: 沒有發生Exception切換,且SP使用的是SP_EL0
第二行描述: 沒有發生Exception切換,且SP使用的是SP_ELx(x=1,2,3)
第三行描述: 發生l Exception切換,且target level使用的是aarch64;
第四行描述: 發生l Exception切換,且target level使用的是aarch32;

在宏內核體系中,第一行是不會用到的。不考慮aarch32,第四行也用不著;
如果SCR_EL3.FIQ=1,那么cpu在EL3時來的FIQ,將使用第二行向量表;
如果SCR_EL3.FIQ=1,那么cpu在EL0/1時來的FIQ,將使用第三行向量表;

我們在看下ATF的向量表定義的代碼,發現第二行的向量表沒有實現,這是為什么呢?
.

.section .vectors, "ax"; .align 11.align 7 runtime_exceptions:/* -----------------------------------------------------* Current EL with _sp_el0 : 0x0 - 0x200* -----------------------------------------------------*/ sync_exception_sp_el0:/* -----------------------------------------------------* We don't expect any synchronous exceptions from EL3* -----------------------------------------------------*/bl report_unhandled_exceptioncheck_vector_size sync_exception_sp_el0.align 7/* -----------------------------------------------------* EL3 code is non-reentrant. Any asynchronous exception* is a serious error. Loop infinitely.* -----------------------------------------------------*/ irq_sp_el0:bl report_unhandled_interruptcheck_vector_size irq_sp_el0.align 7 fiq_sp_el0:bl report_unhandled_interruptcheck_vector_size fiq_sp_el0.align 7 serror_sp_el0:bl report_unhandled_exceptioncheck_vector_size serror_sp_el0/* -----------------------------------------------------* Current EL with SPx: 0x200 - 0x400* -----------------------------------------------------*/.align 7 sync_exception_sp_elx:/* -----------------------------------------------------* This exception will trigger if anything went wrong* during a previous exception entry or exit or while* handling an earlier unexpected synchronous exception.* There is a high probability that SP_EL3 is corrupted.* -----------------------------------------------------*/bl report_unhandled_exceptioncheck_vector_size sync_exception_sp_elx.align 7 irq_sp_elx:bl report_unhandled_interruptcheck_vector_size irq_sp_elx.align 7 fiq_sp_elx:bl report_unhandled_interruptcheck_vector_size fiq_sp_elx.align 7 serror_sp_elx:bl report_unhandled_exceptioncheck_vector_size serror_sp_elx/* -----------------------------------------------------* Lower EL using AArch64 : 0x400 - 0x600* -----------------------------------------------------*/.align 7 sync_exception_aarch64:/* -----------------------------------------------------* This exception vector will be the entry point for* SMCs and traps that are unhandled at lower ELs most* commonly. SP_EL3 should point to a valid cpu context* where the general purpose and system register state* can be saved.* -----------------------------------------------------*/handle_sync_exceptioncheck_vector_size sync_exception_aarch64.align 7/* -----------------------------------------------------* Asynchronous exceptions from lower ELs are not* currently supported. Report their occurrence.* -----------------------------------------------------*/ irq_aarch64:handle_interrupt_exception irq_aarch64check_vector_size irq_aarch64.align 7 fiq_aarch64:handle_interrupt_exception fiq_aarch64check_vector_size fiq_aarch64.align 7 serror_aarch64:bl report_unhandled_exceptioncheck_vector_size serror_aarch64/* -----------------------------------------------------* Lower EL using AArch32 : 0x600 - 0x800* -----------------------------------------------------*/.align 7 sync_exception_aarch32:/* -----------------------------------------------------* This exception vector will be the entry point for* SMCs and traps that are unhandled at lower ELs most* commonly. SP_EL3 should point to a valid cpu context* where the general purpose and system register state* can be saved.* -----------------------------------------------------*/handle_sync_exceptioncheck_vector_size sync_exception_aarch32.align 7/* -----------------------------------------------------* Asynchronous exceptions from lower ELs are not* currently supported. Report their occurrence.* -----------------------------------------------------*/ irq_aarch32:handle_interrupt_exception irq_aarch32check_vector_size irq_aarch32.align 7 fiq_aarch32:handle_interrupt_exception fiq_aarch32check_vector_size fiq_aarch32.align 7 serror_aarch32:bl report_unhandled_exceptioncheck_vector_size serror_aarch32

在ATF/docs/firmware-design.md中找到了答案, 原來是在進入ATF之前,disable了所有的exception,ATF又沒有修改PSTATE.DAIF,所有在ATF Runtime時 irq/fiq/serror/svnc都是disabled。所以異常向量表的第二行,也就用不著了。

Required CPU state when calling bl31_entrypoint() during cold boot


This function must only be called by the primary CPU.


On entry to this function the calling primary CPU must be executing in AArch64
EL3, little-endian data access, and all interrupt sources masked:

  • PSTATE.EL = 3
  • PSTATE.RW = 1
  • PSTATE.DAIF = 0xf
  • SCTLR_EL3.EE = 0

總結

以上是生活随笔為你收集整理的[答疑]-ATF中异常向量表为何没有实现“Current Exception level with SP_ELx, x>0.“的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。