fsr = compute_fsr_fsc(env, fi, target_el, mmu_idx, &fsc);
if (access_type == MMU_INST_FETCH) {
- syn = syn_insn_abort(same_el, fi->ea, fi->s1ptw, fsc);
+ if (fi->type == ARMFault_Alignment) {
+ syn = syn_pcalignment();
+ } else {
+ syn = syn_insn_abort(same_el, fi->ea, fi->s1ptw, fsc);
+ }
exc = EXCP_PREFETCH_ABORT;
} else {
bool gcs = regime_is_gcs(core_to_arm_mmu_idx(env, mmu_idx));
}
/*
- * Per R_XCHFJ, alignment fault not due to memory type has
- * highest precedence. Otherwise, walk the page table and
- * and collect the page description.
+ * PC alignment faults should be dealt with at translation time
+ * but we also need to catch them while being probed.
+ *
+ * Then per R_XCHFJ, alignment fault not due to memory type take
+ * precedence. Otherwise, walk the page table and and collect the
+ * page description.
+ *
*/
- if (address & ((1 << memop_alignment_bits(memop)) - 1)) {
+ if (access_type == MMU_INST_FETCH && !cpu->env.thumb &&
+ (address & 3)) {
+ fi->type = ARMFault_Alignment;
+ } else if (address & ((1 << memop_alignment_bits(memop)) - 1)) {
fi->type = ARMFault_Alignment;
} else if (!get_phys_addr(&cpu->env, address, access_type, memop,
core_to_arm_mmu_idx(&cpu->env, mmu_idx),