Re: 2.6.12-rc2-mm3

From: Ingo Molnar (mingo_at_elte.hu)
Date: 04/13/05

  • Next message: Ingo Molnar: "Re: [patch] sched: fix active load balance"
    Date:	Wed, 13 Apr 2005 22:04:26 +0200
    To: Stas Sergeev <stsp@aknet.ru>
    
    

    * Stas Sergeev <stsp@aknet.ru> wrote:

    > Hi Ingo.
    >
    > I have some programs that crash
    > in 2.6.12-rc2-mm3. After seeing this:
    > http://www.uwsg.iu.edu/hypermail/linux/kernel/0504.1/1091.html

    does the patch below fix the problem for you? (already in Andrew's tree,
    should be in the next -mm patch)

            Ingo

    --
    delay the reloading of segment registers into switch_mm(), so that if
    the LDT size changes we dont get a (silent) fault and a zeroed selector
    register upon reloading.
    Signed-off-by: Ingo Molnar <mingo@elte.hu>
    --- linux/arch/i386/kernel/process.c.orig
    +++ linux/arch/i386/kernel/process.c
    @@ -612,12 +612,12 @@ struct task_struct fastcall * __switch_t
     	asm volatile("movl %%gs,%0":"=m" (*(int *)&prev->gs));
     
     	/*
    -	 * Restore %fs and %gs if needed.
    +	 * Clear selectors if needed:
     	 */
    -	if (unlikely(prev->fs | prev->gs | next->fs | next->gs)) {
    -		loadsegment(fs, next->fs);
    -		loadsegment(gs, next->gs);
    -	}
    +        if (unlikely((prev->fs | prev->gs) && !(next->fs | next->gs))) {
    +                loadsegment(fs, next->fs);
    +                loadsegment(gs, next->gs);
    +        }
     
     	/*
     	 * Now maybe reload the debug registers
    --- linux/include/asm-i386/mmu_context.h.orig
    +++ linux/include/asm-i386/mmu_context.h
    @@ -61,6 +61,13 @@ static inline void switch_mm(struct mm_s
     		}
     	}
     #endif
    +	/*
    +	 * Now that we've switched the LDT, load segments:
    +	 */
    +	if (unlikely(current->thread.fs | current->thread.gs)) {
    +		loadsegment(fs, current->thread.fs);
    +		loadsegment(gs, current->thread.gs);
    +	}
     }
     
     #define deactivate_mm(tsk, mm) \
    -
    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/
    

  • Next message: Ingo Molnar: "Re: [patch] sched: fix active load balance"

    Relevant Pages

    • Re: 2.6.12-rc2-mm3
      ... > Turned out it was some old ups software that got reactivated on the box displaying the ... register upon reloading. ... Now maybe reload the debug registers ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)
    • Re: [PATCH] nvidiafb support for 6600 and 6200
      ... > in one of the registers (instead of deriving it from the pci device id) and ... Uhh, disregard the previous patch, try this one. ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)
    • Re: 2.6.10: e100 network broken after swsusp/resume
      ... > doubt it's driver bugs. ... The following patch is a ridiculously dirty kludge which ... unloading and reloading 8139too will make it work again ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)
    • [PATCH][RFC] Remove uneeded resource structures from pci_dev
      ... The following patch remove irq_resource and dma_resource from pci_dev. ... appears that the serial pci driver depends on irq_resource, however, it may be ... /* Use successive BARs (PCI base address registers), ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)
    • Re: [PATCH] Reduce stack usage in module.c
      ... >> Before patch ... > So all function local variables are in registers? ... all function local variables of the patched who_is_doing_it ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)