thermosphere: add proper memory/instruction barriers for breakpoint stuff

This commit is contained in:
TuxSH
2020-01-09 22:47:22 +00:00
parent 0dd5f1f6d4
commit edb942a032
6 changed files with 19 additions and 3 deletions

View File

@@ -74,12 +74,14 @@ static inline bool doApplySoftwareBreakpoint(size_t id)
static void applySoftwareBreakpointHandler(void *p)
{
u64 flags = maskIrq();
__dmb_sy();
doApplySoftwareBreakpoint(*(size_t *)p);
restoreInterruptFlags(flags);
}
static void applySoftwareBreakpoint(size_t id)
{
__dmb_sy();
executeFunctionOnAllCores(applySoftwareBreakpointHandler, &id, true);
}
@@ -101,12 +103,14 @@ static inline bool doRevertSoftwareBreakpoint(size_t id)
static void revertSoftwareBreakpointHandler(void *p)
{
u64 flags = maskIrq();
__dmb_sy();
doRevertSoftwareBreakpoint(*(size_t *)p);
restoreInterruptFlags(flags);
}
static void revertSoftwareBreakpoint(size_t id)
{
__dmb_sy();
executeFunctionOnAllCores(revertSoftwareBreakpointHandler, &id, true);
}
@@ -223,4 +227,4 @@ int removeAllSoftwareBreakpoints(bool keepPersistent)
recursiveSpinlockUnlock(&g_softwareBreakpointManager.lock);
return ret;
}
}