From 9138579845615f0a75b1c08be5264bf96719d791 Mon Sep 17 00:00:00 2001 From: Konstantin Belousov Date: Mon, 3 Jun 2013 17:40:05 +0000 Subject: [PATCH] Assert that interrupts are enabled in the trap handlers on x86 before calling generic code to deliver signals. Discussed with: bde Tested by: pho MFC after: 1 week --- sys/amd64/amd64/trap.c | 1 + sys/i386/i386/trap.c | 1 + 2 files changed, 2 insertions(+) diff --git a/sys/amd64/amd64/trap.c b/sys/amd64/amd64/trap.c index 1e6b58c81827..3eaf3fd1b10d 100644 --- a/sys/amd64/amd64/trap.c +++ b/sys/amd64/amd64/trap.c @@ -630,6 +630,7 @@ trap(struct trapframe *frame) fubyte((void *)(frame->tf_rip + 6)), fubyte((void *)(frame->tf_rip + 7))); } + KASSERT((read_rflags() & PSL_I) != 0, ("interrupts disabled")); trapsignal(td, &ksi); user: diff --git a/sys/i386/i386/trap.c b/sys/i386/i386/trap.c index 9c8b62de8052..3fe7c0c36e93 100644 --- a/sys/i386/i386/trap.c +++ b/sys/i386/i386/trap.c @@ -780,6 +780,7 @@ trap(struct trapframe *frame) fubyte((void *)(frame->tf_eip + 6)), fubyte((void *)(frame->tf_eip + 7))); } + KASSERT((read_eflags() & PSL_I) != 0, ("interrupts disabled")); trapsignal(td, &ksi); #ifdef DEBUG