This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

A question about the access flag fault

Hi, everyone.

 

The CPU will receive a access flag fault if we set the access flag = 0. My question is  if we always set the access flag to be zero in the fault handler, does the CPU get the value in the memory? For example, the instruction "ldr rd, address" loads the value in the address to rd, and we set the access flag of the PTE to be 0. In the software access fault handler, we still set the access flag to be 0.  My understanding is that after the fault handler, the PC register will point to the instruction, and the access flag fault will be triggered again, so the CPU won't load the memory in "address" to rd register.

However, I see a answer from the discussion in this community (https://community.arm.com/processors/f/discussions/5413/the-usage-of-access-flag-bit-in-translation-table-descriptor) that "If keeping the AF flag 0, software still can access the data from the corresponding address space ".

And this answer confuse me. Can anybody help to figure out that whether the CPU can access the data in the corresponding address when access flag is set to be 0?

Best Regards,

Shijun

Parents
  • The writer of the post might have been thinking of the ARMv7/ARMv8 AArch32. When using the short descriptor format, it is possible to turn off AF checking (SCTLR.AFE).

    But in AArch64 (or ARMv7/AArch32 with long descriptor format), software would have to set the AF bit in the translation table entry in order to access the address.

    Note: In ARMv8.1, there is option of hardware update of the AF bit. If this feature is supported/enabled, you wouldn't see the initial fault.
Reply
  • The writer of the post might have been thinking of the ARMv7/ARMv8 AArch32. When using the short descriptor format, it is possible to turn off AF checking (SCTLR.AFE).

    But in AArch64 (or ARMv7/AArch32 with long descriptor format), software would have to set the AF bit in the translation table entry in order to access the address.

    Note: In ARMv8.1, there is option of hardware update of the AF bit. If this feature is supported/enabled, you wouldn't see the initial fault.
Children