Showing changes from revision #2 to #3:
Added | Removed | Changed
Entry | |
---|---|
R2 | Reason code |
- | Other registers dependent on reason code |
Exit | |
---|---|
- | All registers preserved |
This vector is called during serious error reporting and recovery, such as an Abort. It should not be claimed, but called to notify relevant sections of the OS that a serious error has occurred and/or recovery steps have been taken.
Note that handlers of SeriousErrorV have tighter restrictions placed on them than with other vectors. Specifically, reason code 0 will be called from ABT mode, with IRQ+FIQ disabled, and for safety they must stay within that state. For example, a C module cannot use standard CMHG IRQ veneers disabled. directly, At because the veneer time the call is made the stack pointers for the other privileged modes will attempt be in an indeterminate state (e.g. the abort could be due to switch a toSVC mode stack on overflow), entry so (running implementations must be careful to avoid using the risk stacks of for a any recursive other abort modes. if For example, this prevents the use of SVC SWI stack calls, pointer and is it invalid). prevents If your handler is only interested in the direct use ofSVC-mode reason codes, it’s recommended to use a pre-veneer infront of the CMHG veneer veneers which in will C filter modules. out Similarly, all if the codes abort which was you due are to not a interested faulty in. interrupt Currently handler, reason re-enabling code IRQs 0 may is cause the only handler reason to code crash with again, tight restrictions like these, but more reason codes might be introduced in future, so filtering SeriousErrorV out handlers unknown must codes take is care the to safest not approach. re-enable interrupts.
For C modules which are only interested in the reason codes that are called in SVC mode, it’s recommended to use a pre-veneer infront of the CMHG veneer which will filter out all the codes which you are not interested in. Currently reason code 0 is the only reason code which is not called in SVC mode, but more reason codes might be introduced in future, so having your pre-veneer filter out all unknown codes is the safest approach.
0 | Collect. Entered in ABT mode, |
R0 = Pointer to register dump | |
R1 = Pointer to (untranslated) error block | |
1 | Recover. Entered in SVC mode, IRQ disabled |
R0 = Pointer to translated error block | |
2 | Report. Entered in SVC mode, IRQ enabled |
R0 = Pointer to translated error block | |
3 | Custom Report. Entered in SVC mode, IRQ enabled |
R0 = Pointer to translated error block | |
R1 = Flags | |
R3 = Pointer to callback function to receive the report | |
R4 = Callback R0 |
When a serious error occurs, the kernel undertakes the following procedure:
Note that the exact ordering of items is subject to change in future kernel versions, but the overall flow as seen by SeriousErrorV will remain the same.
Software can request that a custom report is generated by calling SeriousErrorV reason codes 0 and 3. For example, when the ZeroPain module emulates a zero page access, it also invokes SeriousErrorV in order to collect information for inclusion in the log file so that the zero page access can be reported to the author of the relevant software. The process for using these reason codes is as follows:
The requirement for reason code 0 to be called in ABT mode means that there is no legal way for software outside the kernel to invoke that reason code. Therefore, at this time, the use of custom reports is restricted to low-level OS components which have enough knowledge of the host system to be able to invoke the vector directly.
The flags for reason code 3 are as follows:
Bit | Meaning |
---|---|
0 | 1 → Produce annotated text dump |
0 → Produce raw hex dump | |
1+ | Reserved |
The callback function pointer provided in R3 must have the following signature:
Entry | |
---|---|
R0 | Parameter provided to SeriousErrorV |
R1 | Pointer to null-terminated string |
Exit | |
---|---|
R0-R3, R12 | Corrupt |
The callback function will be called multiple times as the different areas of the report are output.