kernel - cli interlock with critcount in interrupt assembly
authorMatthew Dillon <dillon@apollo.backplane.com>
Mon, 25 Jul 2016 04:44:33 +0000 (21:44 -0700)
committerMatthew Dillon <dillon@apollo.backplane.com>
Mon, 25 Jul 2016 04:44:33 +0000 (21:44 -0700)
commitae18e11d61f5cb1b3d4f1ecc8c70eff9bdd31df0
tree4831bb3bbc6ab17b2c35d90b85be14c0ad6788e8
parent3dda54c60cbb0c8677ed2e76c97a5e0c9ac90e38
kernel - cli interlock with critcount in interrupt assembly

* Disable interrupts when decrementing the critical section count
  and gd_intr_nesting_level, just prior to jumping into doreti.
  This prevents a stacking interrupt from occurring in this roughly
  10-instruction window.

* While limited stacking is not really a problem, this closes a very
  small and unlikely window where multiple device interrupts could
  stack excessively and run the kernel thread out of stack space.
  (unlikely that it has ever happened in real life, but becoming more
  likely as some modern devices are capable of much higher interrupt
  rates).
sys/platform/pc64/apic/apic_vector.s