Interrupts during page fault exceptions

Shrikant Giridhar shrikantgiridhar at gmail.com
Tue May 7 13:19:18 EDT 2019


Hi,

I was looking at arch code setting up page fault handling in the kernel and
came away with a couple of questions.

Can hardware interrupts (non-NMI) occur during page faults? On x86, I
notice that the page fault handler is set up with an interrupt gate which
should clear the IF (Interrupt Enable) bit - disabling maskable interrupts
in the process. I also don't see interrupts being enabled later in the
handler (arch/x86/mm/fault.c:do_page_fault).

However, from a quick skim, it doesn't look like the same rule is followed
on ARM (32-bit) where local IRQs are enabled after we enter the page fault
handler (arch/arm/mm/fault.c:do_page_fault).

Is there a general policy for interrupt handling during page faults? I
would have guessed that (non-threaded) interrupts be disabled during page
faults because of the possibility of a recursive lock acquire or stack
overflow if the interrupt handler itself page faults.

Is there an arch-specific factor involved which prevents (AFAICT)
interrupts being serviced while the page fault is in progress on x86 but
not on ARM or did I miss something in my reading of the code?


Shrikant
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20190507/0f102906/attachment.html>


More information about the Kernelnewbies mailing list