• P
    target/arm: Factor out code to calculate FSR for debug exceptions · 81621d9a
    Peter Maydell 提交于
    When a debug exception is taken to AArch32, it appears as a Prefetch
    Abort, and the Instruction Fault Status Register (IFSR) must be set.
    The IFSR has two possible formats, depending on whether LPAE is in
    use. Factor out the code in arm_debug_excp_handler() which picks
    an FSR value into its own utility function, update it to use
    arm_fi_to_lfsc() and arm_fi_to_sfsc() rather than hard-coded constants,
    and use the correct condition to select long or short format.
    
    In particular this fixes a bug where we could select the short
    format because we're at EL0 and the EL1 translation regime is
    not using LPAE, but then route the debug exception to EL2 because
    of MDCR_EL2.TDE and hand EL2 the wrong format FSR.
    Signed-off-by: NPeter Maydell <peter.maydell@linaro.org>
    Reviewed-by: NPhilippe Mathieu-Daudé <f4bug@amsat.org>
    Message-id: 20180320134114.30418-3-peter.maydell@linaro.org
    81621d9a
op_helper.c 41.4 KB