On cores that have the `MPIDR.MT` bit set,
- affinity level 0 is the thread ID
- affinity level 1 is the CPU ID
- affinity level 2 is the cluster ID
Thus, on these cores, the `MPIDR_CPU_ID` (resp. `MPIDR_CLUSTER_ID`) macro should extract bits 8 to 15 (resp. 16 to 23). At the moment, these macros do not inspect the `MPIDR.MT` bit (see [[ https://git.trustedfirmware.org/tf-a-tests.git/tree/include/lib/aarch64/arch.h?id=aef556a8b784fe98fad89591e097b486ab92f6c8#n72 | their definitions ]]) so they will not work as intended on multi-threaded cores.
This can be easily reproduced on the AEM FVP (revC), which has the `MPIDR.MT` bit set for all cores.