[lkml]   [2004]   [Feb]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
    Patch in this message
    SubjectDoes Flushing the Queue after PG REALLY a Necessity?
    H. Peter Anvin wrote:

    > Anyone happen to know of any legitimate reason not to reload %cs in
    > head.S? I think the following would be a lot cleaner, as well as a
    > lot safer (the jump and indirect branch aren't guaranteed to have the
    > proper effects, although technically neither should be required due to
    > the %cr0 write):

    Anyone happen to know of any legitimate reason to flush the prefetch
    queue after enabling paging?

    I've read the intel manual volume 3 thoroughly. It only says that after
    entering protected mode, flushing is required, but never says
    specifically about whether to do flushing after enabling paging.

    Furthermore the intel example code enables protected mode and paging at
    the same time. So does FreeBSD. There's really no more references to check.

    From the cpu's internal view, flushing for PE is to flush the prefetch
    queue as well as re-load the %cs, since the protected mode is just about
    to begin. But no reason to flushing for PG, since linux maps the
    addresses *identically*.

    If no any reason, please remove the after paging flushing queue code,
    two near jump.


    (patch enclosed)
    Coywolf Qi Hunt
    Admin of and

    --- head.S 2004-02-18 11:57:16.000000000 +0800
    +++ head-cy.S 2004-02-23 17:19:02.000000000 +0800
    @@ -115,11 +115,7 @@
    movl %cr0,%eax
    orl $0x80000000,%eax
    movl %eax,%cr0 /* ..and set paging (PG) bit */
    - jmp 1f /* flush the prefetch-queue */
    - movl $1f,%eax
    - jmp *%eax /* make sure eip is relocated */
    /* Set up the stack pointer */
    lss stack_start,%esp

     \ /
      Last update: 2005-03-22 14:01    [W:4.392 / U:0.016 seconds]
    ©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site