Skip to content
  • Peter Maydell's avatar
    80d2b43b
    target/arm: Make writes to MDCR_EL3 use PMU start/finish calls · 80d2b43b
    Peter Maydell authored
    
    
    In commit 01765386 we fixed a bug where we weren't correctly
    bracketing changes to some registers with pmu_op_start() and
    pmu_op_finish() calls for changes which affect whether the PMU
    counters might be enabled.  However, we missed the case of writes to
    the AArch64 MDCR_EL3 register, because (unlike its AArch32
    counterpart) they are currently done directly to the CPU state struct
    without going through the sdcr_write() function.
    
    Give MDCR_EL3 a writefn which handles the PMU start/finish calls.
    The SDCR writefn then simplfies to "call the MDCR_EL3 writefn after
    masking off the bits which don't exist in the AArch32 register".
    
    Signed-off-by: default avatarPeter Maydell <peter.maydell@linaro.org>
    Reviewed-by: default avatarRichard Henderson <richard.henderson@linaro.org>
    Message-id: 20220923123412.1214041-3-peter.maydell@linaro.org
    80d2b43b
    target/arm: Make writes to MDCR_EL3 use PMU start/finish calls
    Peter Maydell authored
    
    
    In commit 01765386 we fixed a bug where we weren't correctly
    bracketing changes to some registers with pmu_op_start() and
    pmu_op_finish() calls for changes which affect whether the PMU
    counters might be enabled.  However, we missed the case of writes to
    the AArch64 MDCR_EL3 register, because (unlike its AArch32
    counterpart) they are currently done directly to the CPU state struct
    without going through the sdcr_write() function.
    
    Give MDCR_EL3 a writefn which handles the PMU start/finish calls.
    The SDCR writefn then simplfies to "call the MDCR_EL3 writefn after
    masking off the bits which don't exist in the AArch32 register".
    
    Signed-off-by: default avatarPeter Maydell <peter.maydell@linaro.org>
    Reviewed-by: default avatarRichard Henderson <richard.henderson@linaro.org>
    Message-id: 20220923123412.1214041-3-peter.maydell@linaro.org
Loading