Page MenuHomeFreeBSD

D44350.id135742.diff
No OneTemporary

D44350.id135742.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
Thu, Feb 19, 11:37 AM (4 h, 22 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
28877138
Default Alt Text
D44350.id135742.diff (973 B)

Event Timeline