سؤال

I am trying to find explanation for my observastion

a) Assuming that PERIPHBASE is at 0x2c000000 and MMU is disabled. If accessed address 0x21000000 would there be a DABT? I got a DABT

b) Assuming that MMU translation is enabled and 1:1 mapping is created using 1G blocks only (Lpae). So there exists a 1:1 mapping for 0x2100000. Accessing it again gives a DABT.

c) MMU is enabled but the entry 1 which contains 0-1G is marked invalid. Access to 0x21000000 gives again DABT.

If you are writing an exception / trap handler, how would you recognize which of (a) (b) (c) caused the exception/trap.

Need inputs, a bit confused here...

هل كانت مفيدة؟

المحلول

PERIPHBASE is not really relevant to the question.

There are two basic types of data aborts (DABT):

  • Internal (generated by the MMU)
  • External (returned by the interconnect, or slave device)

So for (a), only an external abort is possible (MMU will only trigger aborts when it is enabled).

(b) Given that we know that the act of trying to access a peripheral at the given address will cause an abort, it is likely that the abort with MMU on and a valid mapping is also an external abort. But in this instance either is possible (alignment checking could generate an internal abort even if the mapping is valid).

(c) If the MMU is on and the mapping is invalid, no external access will be made - so this will be an internal abort.

As Jitesh points out, the Data Fault Status Register (DFSR) can give you information about the fault. The Fault Status field will inform you how the access failed, and if the abort was external the ExT bit will inform you about whether the fault was generated by the interconnect (DECERR) or was an error response from a slave device (SLVERR).

نصائح أخرى

It is actually fairly straightforward.

(a) I suspect you cannot get a data abort when MMU is disabled. From what I know, data abort is a property of the MMU. In any case, SCTRL's bit 0 will tell you whether MMU is enabled or disabled.

(b) and (c) Using the DFSR you can differentiate between these cases. If you get a data-abort when the mapping is there, it is most likely a permission fault. Else, its just a translation fault.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top