arm: Raise an alignment fault if a PC has illegal alignment
authorAndreas Sandberg <Andreas.Sandberg@ARM.com>
Tue, 23 Dec 2014 14:31:17 +0000 (09:31 -0500)
committerAndreas Sandberg <Andreas.Sandberg@ARM.com>
Tue, 23 Dec 2014 14:31:17 +0000 (09:31 -0500)
commit184fefbb3bbaf93bccd65e73d3d08c7decc16e8a
tree0e8eb2625b018079821cddbdf1930144c4b762b7
parentb33812ba430bba0ab5ff4e6372b47f4b323f0891
arm: Raise an alignment fault if a PC has illegal alignment

We currently don't handle unaligned PCs correctly. There is one check
for unaligned PCs in the TLB when running in aarch64 mode, but this
check does not cover cases where the CPU does not do a TLB lookup when
decoding an instruction (e.g., a branch stays within the same cache
line). Additionally, the Decoder class sometimes throws an assertion
for unaligned PCs which breaks speculation.

This changeset introduces a decoder fault bit field in the ExtMachInst
structure. This field can be used to signal a decoder failure. If set,
the decoder generates an internal gem5fault instruction instead of a
normal instruction. This instruction in turns either panics (fault
type PANIC), returns an PCAlignmentFault (fault type UNALIGNED,
aarch64) or PrefetchAbort (fault type UNALIGNED, aarch32).

The patch causes minor changes to the realview64 regressions, and a
stats bump will follow.
src/arch/arm/SConscript
src/arch/arm/decoder.cc
src/arch/arm/insts/pseudo.cc [new file with mode: 0644]
src/arch/arm/insts/pseudo.hh [new file with mode: 0644]
src/arch/arm/isa/bitfields.isa
src/arch/arm/isa/decoder/decoder.isa
src/arch/arm/isa/formats/formats.isa
src/arch/arm/isa/formats/pseudo.isa [new file with mode: 0644]
src/arch/arm/isa/includes.isa
src/arch/arm/tlb.cc
src/arch/arm/types.hh