Re: [PATCH] Remove the extra jmp

From: Coywolf Qi Hunt (coywolf_at_greatcn.org)
Date: 02/24/04

  • Next message: Darren Williams: "Re: HELP Re: Keyboard not working under 2.6.2"
    Date:	Tue, 24 Feb 2004 18:10:02 +0800
    To: Brian Gerst <bgerst@didntduck.org>
    
    

    Brian Gerst wrote:

    > Coywolf Qi Hunt wrote:
    >
    >> Jamie Lokier wrote:
    >>
    >>>
    >>> Your patch uses two instructions to flush the queue (push+ret) instead
    >>> of one (jmp or ljmp). Is that documented as reliable? I can easily
    >>> imagine an implementation which decodes one instruction after a mode
    >>> change predictably, but not two.
    >>>
    >>> I doubt that it makes a difference - we're setting PG, not changing
    >>> the instruction format - but I'd like us to be sure it cannot fail on
    >>> things like 386s and 486s, and similar non-Intel chips.
    >>
    >>
    >>
    >> push+ret is encouraged/borrowed/stolen from FreeBSD ;) it should be
    >> reliable. And also, old linux uses ret. Since old linux runs on 386,
    >> it is quite reliable. If you still doubt, we can push before PG.
    >>
    >>
    >>
    >> Hello Anvin,
    >>
    >> Please either take the push+ret patch or take the one near jmp patch
    >> enclosed in this email. thanks
    >>
    >> Coywolf
    >>
    >>
    >>
    >> ------------------------------------------------------------------------
    >>
    >> --- head.S.orig 2004-02-18 11:57:16.000000000 +0800
    >> +++ head.S 2004-02-24 11:08:34.000000000 +0800
    >> @@ -117,9 +117,6 @@
    >> movl %eax,%cr0 /* ..and set paging (PG) bit */
    >> jmp 1f /* flush the prefetch-queue */
    >> 1:
    >> - movl $1f,%eax
    >> - jmp *%eax /* make sure eip is relocated */
    >> -1:
    >> /* Set up the stack pointer */
    >> lss stack_start,%esp
    >>
    >
    >
    > This won't work, because the indirect jump is what adds PAGE_OFFSET to
    > %eip (remember, call/jump use relative addressing). Either keep just
    > the indirect jump, or use "jmp __PAGE_OFFSET+1f".
    >

    Any jump works. But I think you did explain very well the reason that
    the author carelessly or over carefully left the two jumps there.

            Coywolf

    -- 
    Coywolf Qi Hunt
    Admin of http://GreatCN.org and http://LoveCN.org
    -
    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: Darren Williams: "Re: HELP Re: Keyboard not working under 2.6.2"

    Relevant Pages

    • Re: [Fastboot] [PATCH 03/03] kexec: Avoid overwriting the current pgd (V2, x86_64)
      ... To avoid overwriting the page table and still work with NX bits we jump ... After the switch the code runs at the same virtual address, ... Linux under xen ... of that is Xen using a different memory map than Linux. ...
      (Linux-Kernel)
    • Re: [Fastboot] [PATCH 03/03] kexec: Avoid overwriting the current pgd (V2, x86_64)
      ... > physical page is now the control page. ... The fact that this bug did not jump out is a clear sign you were ... Linux under xen ... > of that is Xen using a different memory map than Linux. ...
      (Linux-Kernel)
    • RE: Catching NForce2 lockup with NMI watchdog
      ... >table in the system BIOS which the motherboard vendors supply. ... Is it not possible that Linux could be made to handling this hardware ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)
    • Re: 2.7 (future kernel) wish
      ... > I've never seen one give a STOP error from that but I guess a bad driver ... I would like to see the HAL type crap for Linux. ... to have uniform user device control from a gui programmable means. ... 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/ ...
      (Linux-Kernel)
    • [2.6 patch] remove unused drivers/net/wan/lmc/lmc_ver.h
      ... * This is being done to keep 1 central location where all linux ... * made the souce code not only hard to read but version problems hard ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)