Skip to content

Commit

Permalink
Handle epoch_enter at APC_LEVEL
Browse files Browse the repository at this point in the history
Signed-off-by: Alan Jowett <alanjo@microsoft.com>
  • Loading branch information
Alan-Jowett committed Mar 16, 2023
1 parent 2cbb2de commit 5f0501a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion libs/platform/ebpf_state.c
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ _ebpf_state_get_entry(
// High frequency call, don't log entry/exit.
ebpf_state_entry_t* local_entry = NULL;

if (execution_context_state->current_irql == PASSIVE_LEVEL) {
if (execution_context_state->current_irql <= DISPATCH_LEVEL >) {
ebpf_result_t return_value;
uint64_t current_thread_id = execution_context_state->id.thread;

Expand Down
4 changes: 2 additions & 2 deletions libs/platform/kernel/ebpf_platform_kernel.c
Original file line number Diff line number Diff line change
Expand Up @@ -390,7 +390,7 @@ _Requires_lock_held_(*lock) _Releases_lock_(*lock) _IRQL_requires_(DISPATCH_LEVE
_Must_inspect_result_ ebpf_result_t
ebpf_set_current_thread_affinity(uintptr_t new_thread_affinity_mask, _Out_ uintptr_t* old_thread_affinity_mask)
{
if (KeGetCurrentIrql() > PASSIVE_LEVEL) {
if (KeGetCurrentIrql() >= DISPATCH_LEVEL) {
return EBPF_OPERATION_NOT_SUPPORTED;
}

Expand Down Expand Up @@ -808,7 +808,7 @@ bool
ebpf_should_yield_processor()
{
// Don't yield if we are at passive level as the scheduler can preempt us.
if (KeGetCurrentIrql() == PASSIVE_LEVEL)
if (KeGetCurrentIrql() <= DISPATCH_LEVEL)
return false;

// KeShouldYieldProcessor returns TRUE if the current thread should yield the processor.
Expand Down

0 comments on commit 5f0501a

Please sign in to comment.