From 342fa7135d189bf9c1551851836e151432721ed5 Mon Sep 17 00:00:00 2001 From: Pavel Dovgalyuk Date: Sat, 3 Mar 2018 22:45:02 -0500 Subject: [PATCH] mips: set CP0 Debug DExcCode for SDBBP instruction This patch fixes setting DExcCode field of CP0 Debug register when SDBBP instruction is executed. According to EJTAG specification, this field must be set to the value 9 (Bp). Backports commit c6c2c0fc32362ba234ae3bdad1a55c2d6aefaa12 from qemu --- qemu/target/mips/helper.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/qemu/target/mips/helper.c b/qemu/target/mips/helper.c index 85762f5b..f4679c2c 100644 --- a/qemu/target/mips/helper.c +++ b/qemu/target/mips/helper.c @@ -617,6 +617,8 @@ void mips_cpu_do_interrupt(CPUState *cs) goto set_DEPC; case EXCP_DBp: env->CP0_Debug |= 1 << CP0DB_DBp; + /* Setup DExcCode - SDBBP instruction */ + env->CP0_Debug = (env->CP0_Debug & ~(0x1fULL << CP0DB_DEC)) | 9 << CP0DB_DEC; goto set_DEPC; case EXCP_DDBS: env->CP0_Debug |= 1 << CP0DB_DDBS;