Page MenuHomeFreeBSD

D44350.id136019.diff
No OneTemporary

D44350.id136019.diff

diff --git a/sys/arm64/arm64/debug_monitor.c b/sys/arm64/arm64/debug_monitor.c
--- a/sys/arm64/arm64/debug_monitor.c
+++ b/sys/arm64/arm64/debug_monitor.c
@@ -193,6 +193,15 @@
("%s: debug exceptions are not masked", __func__));
kdb_frame->tf_spsr |= PSR_SS;
+
+ /*
+ * TODO: Handle single stepping over instructions that access
+ * the DAIF values. On a read the value will be incorrect.
+ */
+ kernel_monitor.dbg_flags &= ~PSR_DAIF;
+ kernel_monitor.dbg_flags |= kdb_frame->tf_spsr & PSR_DAIF;
+ kdb_frame->tf_spsr |= (PSR_A | PSR_I | PSR_F);
+
WRITE_SPECIALREG(mdscr_el1, READ_SPECIALREG(mdscr_el1) |
MDSCR_SS | MDSCR_KDE);
@@ -214,6 +223,9 @@
KASSERT((READ_SPECIALREG(daif) & PSR_D) == PSR_D,
("%s: debug exceptions are not masked", __func__));
+ kdb_frame->tf_spsr &= ~PSR_DAIF;
+ kdb_frame->tf_spsr |= kernel_monitor.dbg_flags & PSR_DAIF;
+
WRITE_SPECIALREG(mdscr_el1, READ_SPECIALREG(mdscr_el1) &
~(MDSCR_SS | MDSCR_KDE));

File Metadata

Mime Type
text/plain
Expires
Tue, Apr 7, 1:36 PM (13 h, 54 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
31034725
Default Alt Text
D44350.id136019.diff (973 B)

Event Timeline