我可以检测到从哪种模式(EL1,EL0,...)引起了 SError 中断吗?
Can I detect from which mode (EL1, EL0,...) SError interrupt was caused?
据我所知,有单独的向量来处理由 EL0 和 EL1 引起的 SError。
我的问题如下:
由于 SError 是异步的,我可以相信如果 cpu 输入 serror_el1_vector 来处理 SError,那么 SError 就是造成的在 EL1 中(不在 EL0、EL2、EL3 中)并且如果 cpu 输入 serror_el0_vector 那么 SError 正是在 EL0 中引起的?换句话说,是否可能出现以下情况:
- EL0:
1.1。对某些设备寄存器的不正确访问(例如写入 RO 寄存器)会导致 SError 中断。这种访问不会立即产生访问错误,但在稍后的某个时刻,当 AXI 事务实际发生时,内存系统 returns 出现故障,报告为异步中止。
1.2。 SError 仍未生成,用户有时间使 svc 进入 EL1
- EL1:
2.1。现在 cpu 在 EL1 模式中由步骤 1.2
进入
2.2。 step 1.1引起的SError最终产生了但是现在cpu在EL1中,而不是在EL0中,所以向量cpu会进入处理SError:serror_el1_vector 还是 serror_el0_vector?因为最初不正确的访问是在 EL0 中导致的,但现在 cpu 在 EL1 状态。
提前致谢!
Can I detect from which mode (EL1, EL0,…) SError interrupt was caused?
否,除非您有比 ARM Architecture Reference Manual 中给出的保证更强的保证。
问题是几乎所有的东西都是实现定义的。
首先,似乎无法保证 SError 甚至是由 PE 引起的。第 D1-2198 页:
An External abort generated by the memory system might be taken asynchronously using the SError interrupt. These SError interrupts always behave as edge-triggered interrupts. An implementation might include other sources of SError interrupt.
因此,SError 的来源完全有可能是片外的。
此外,在多核系统中,似乎没有什么可以阻止核心 1 发出导致 SError 随后发送到核心 2 的写入的可能性。
接下来,让我们看看SError携带了哪些信息。第 D1-2170 页:
If the exception is a synchronous exception or an SError interrupt, information characterizing the reason for the exception is saved in the ESR_ELx at the target Exception level.
查看 D12-2798 页上的 ESR_EL1
:
IDS, bit [24]
IMPLEMENTATION DEFINED syndrome. Possible values of this bit are:
- 0b0
Bits[23:0] of the ISS field holds the fields described in this encoding.
---------- Note ----------
If the RAS Extension is not implemented, this means that bits[23:0] of the ISS field are RES0.
--------------------------
- 0b1
Bits[23:0] of the ISS field holds IMPLEMENTATION DEFINED syndrome information that can be used to provide additional information about the SError interrupt.
因此 PE 可以实现自定义寄存器配置,提供您正在寻找的信息,但同样:这是实现定义的。
这也超出了 PE 规范的范围,但内存系统可能提供了一种恢复 SError 源的方法。
底线:所有的实现都已定义,因此请参阅特定硬件的手册。
据我所知,有单独的向量来处理由 EL0 和 EL1 引起的 SError。
我的问题如下:
由于 SError 是异步的,我可以相信如果 cpu 输入 serror_el1_vector 来处理 SError,那么 SError 就是造成的在 EL1 中(不在 EL0、EL2、EL3 中)并且如果 cpu 输入 serror_el0_vector 那么 SError 正是在 EL0 中引起的?换句话说,是否可能出现以下情况:
- EL0:
1.1。对某些设备寄存器的不正确访问(例如写入 RO 寄存器)会导致 SError 中断。这种访问不会立即产生访问错误,但在稍后的某个时刻,当 AXI 事务实际发生时,内存系统 returns 出现故障,报告为异步中止。
1.2。 SError 仍未生成,用户有时间使 svc 进入 EL1
- EL1:
2.1。现在 cpu 在 EL1 模式中由步骤 1.2
进入2.2。 step 1.1引起的SError最终产生了但是现在cpu在EL1中,而不是在EL0中,所以向量cpu会进入处理SError:serror_el1_vector 还是 serror_el0_vector?因为最初不正确的访问是在 EL0 中导致的,但现在 cpu 在 EL1 状态。
提前致谢!
Can I detect from which mode (EL1, EL0,…) SError interrupt was caused?
否,除非您有比 ARM Architecture Reference Manual 中给出的保证更强的保证。
问题是几乎所有的东西都是实现定义的。
首先,似乎无法保证 SError 甚至是由 PE 引起的。第 D1-2198 页:
An External abort generated by the memory system might be taken asynchronously using the SError interrupt. These SError interrupts always behave as edge-triggered interrupts. An implementation might include other sources of SError interrupt.
因此,SError 的来源完全有可能是片外的。
此外,在多核系统中,似乎没有什么可以阻止核心 1 发出导致 SError 随后发送到核心 2 的写入的可能性。
接下来,让我们看看SError携带了哪些信息。第 D1-2170 页:
If the exception is a synchronous exception or an SError interrupt, information characterizing the reason for the exception is saved in the ESR_ELx at the target Exception level.
查看 D12-2798 页上的 ESR_EL1
:
IDS, bit [24]
IMPLEMENTATION DEFINED syndrome. Possible values of this bit are:
- 0b0
Bits[23:0] of the ISS field holds the fields described in this encoding.
---------- Note ----------
If the RAS Extension is not implemented, this means that bits[23:0] of the ISS field are RES0.
--------------------------- 0b1
Bits[23:0] of the ISS field holds IMPLEMENTATION DEFINED syndrome information that can be used to provide additional information about the SError interrupt.
因此 PE 可以实现自定义寄存器配置,提供您正在寻找的信息,但同样:这是实现定义的。
这也超出了 PE 规范的范围,但内存系统可能提供了一种恢复 SError 源的方法。
底线:所有的实现都已定义,因此请参阅特定硬件的手册。