[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 6/9] target/arm: Suppress debug exceptions when OS Lock set
From: |
Peter Maydell |
Subject: |
[PULL 6/9] target/arm: Suppress debug exceptions when OS Lock set |
Date: |
Thu, 7 Jul 2022 13:27:31 +0100 |
The "OS Lock" in the Arm debug architecture is a way for software
to suppress debug exceptions while it is trying to power down
a CPU and save the state of the breakpoint and watchpoint
registers. In QEMU we implemented the support for writing
the OS Lock bit via OSLAR_EL1 and reading it via OSLSR_EL1,
but didn't implement the actual behaviour.
The required behaviour with the OS Lock set is:
* debug exceptions (apart from BKPT insns) are suppressed
* some MDSCR_EL1 bits allow write access to the corresponding
EDSCR external debug status register that they shadow
(we can ignore this because we don't implement external debug)
* similarly with the OSECCR_EL1 which shadows the EDECCR
(but we don't implement OSECCR_EL1 anyway)
Implement the missing behaviour of suppressing debug
exceptions.
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-id: 20220630194116.3438513-4-peter.maydell@linaro.org
---
target/arm/debug_helper.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/target/arm/debug_helper.c b/target/arm/debug_helper.c
index 9a78c1db966..691b9b74c4a 100644
--- a/target/arm/debug_helper.c
+++ b/target/arm/debug_helper.c
@@ -142,6 +142,9 @@ static bool aa32_generate_debug_exceptions(CPUARMState *env)
*/
bool arm_generate_debug_exceptions(CPUARMState *env)
{
+ if (env->cp15.oslsr_el1 & 1) {
+ return false;
+ }
if (is_a64(env)) {
return aa64_generate_debug_exceptions(env);
} else {
--
2.25.1
- [PULL 0/9] target-arm queue, Peter Maydell, 2022/07/07
- [PULL 1/9] hw/arm/virt: dt: add rng-seed property, Peter Maydell, 2022/07/07
- [PULL 2/9] target/arm: Fix MTE check in sve_ldnfff1_r, Peter Maydell, 2022/07/07
- [PULL 3/9] target/arm: Record tagged bit for user-only in sve_probe_page, Peter Maydell, 2022/07/07
- [PULL 4/9] target/arm: Fix code style issues in debug helper functions, Peter Maydell, 2022/07/07
- [PULL 6/9] target/arm: Suppress debug exceptions when OS Lock set,
Peter Maydell <=
- [PULL 7/9] target/arm: Implement AArch32 DBGDEVID, DBGDEVID1, DBGDEVID2, Peter Maydell, 2022/07/07
- [PULL 5/9] target/arm: Move define_debug_regs() to debug_helper.c, Peter Maydell, 2022/07/07
- [PULL 9/9] target/arm: Fix qemu-system-arm handling of LPAE block descriptors for highmem, Peter Maydell, 2022/07/07
- [PULL 8/9] target/arm: Correctly implement Feat_DoubleLock, Peter Maydell, 2022/07/07
- Re: [PULL 0/9] target-arm queue, Richard Henderson, 2022/07/07