lkml.org 
[lkml]   [2001]   [Mar]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: [PATCH for 2.5] preemptible kernel
    Hi Pavel,

    Thanks for you comments.

    On Sat, 17 Mar 2001, Pavel Machek wrote:
    > > diff -Nur 2.4.2/arch/i386/kernel/traps.c linux/arch/i386/kernel/traps.c
    > > --- 2.4.2/arch/i386/kernel/traps.c Wed Mar 14 12:16:46 2001
    > > +++ linux/arch/i386/kernel/traps.c Wed Mar 14 12:22:45 2001
    > > @@ -973,7 +973,7 @@
    > > set_trap_gate(11,&segment_not_present);
    > > set_trap_gate(12,&stack_segment);
    > > set_trap_gate(13,&general_protection);
    > > - set_trap_gate(14,&page_fault);
    > > + set_intr_gate(14,&page_fault);
    > > set_trap_gate(15,&spurious_interrupt_bug);
    > > set_trap_gate(16,&coprocessor_error);
    > > set_trap_gate(17,&alignment_check);
    >
    > Are you sure about this piece? Add least add a comment, because it
    > *looks* strange.

    With a preemptible kernel, we need to enter the page fault handler with
    interrupts disabled to protect the cr2 register. The interrupt state is
    restored immediately after cr2 has been saved. Otherwise, an interrupt
    could cause the faulting thread to be preempted, and the new thread
    could also fault, clobbering the cr2 register for the preempted thread.
    See the diff for linux/arch/i386/mm/fault.c.

    Nigel Gamble nigel@nrg.org
    Mountain View, CA, USA. http://www.nrg.org/

    MontaVista Software nigel@mvista.com

    -
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/

    \
     
     \ /
      Last update: 2005-03-22 13:29    [W:0.021 / U:30.372 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site