Hi,
I am receiving an Unsupported Exclusive or Atomic access exception when dereferencing a capability. The ESR value is: 96000035. The same code works fine on bare metal, but under a hypervisor (bhyve) it fails with this exception.
My question is: what does this exception actually mean?
It sounds like your code is performing an atomic memory operation on device memory? Perhaps by running without firmware on top of bhyve you're missing initialisation of MAIR_EL1 (resets to UNKNOWN, which bhyve implements as 0)?
The register specification of ESR_ELx can be found in the Arm ARMv8-A (see the link below).
developer.arm.com/.../
For example, ESL_EL1 can be found in D19.2.37 ESR_EL1, Exception Syndrome Register (EL1) of the Arm ARMv8-A (J.a) above.
Since EC (bits [31:26]) is showing 0b100101 in your case, it means:
EC == 0b100101 Data Abort exception taken without a change in Exception level. Used for MMU faults generated by data accesses, alignment faults other than those caused by Stack Pointer misalignment, and synchronous External aborts, including synchronous parity or ECC errors. Not used for debug-related exceptions.
And, DFSC (bits[5:0]) is showing 0b110101, it means:
0b110101 IMPLEMENTATION DEFINED fault (Unsupported Exclusive or Atomic access).
Further info about this encoding may be found in a core's TRM as it's IMPLEMENTATION DEFINED.
Ah that was indeed the problem!