Why linux kernel use trap gate to handle divide_error exception?
问题 In kernel 2.6.11.5, divide zero exception handler is set up as: set_trap_gate(0,÷_error); According to "Understanding The Linux Kernel", Intel trap gate cannot be accessed by a User Mode process. But it's quite possible that a user mode process also generate a divide_error . So why Linux implement it in this way? [Edit] I think that the question is still open, since set_trap_gate() sets DPL value of IDT entry to 0, which means only CPL=0 (read kernel) code can execute it, so it's