]> git.ipfire.org Git - people/ms/u-boot.git/commitdiff
x86: Invalidate TLB as early as possible
authorSimon Glass <sjg@chromium.org>
Thu, 6 Nov 2014 20:20:03 +0000 (13:20 -0700)
committerSimon Glass <sjg@chromium.org>
Fri, 21 Nov 2014 06:24:09 +0000 (07:24 +0100)
We should invalidate the TLB right at the start to ensure that we don't get
false address translations even though paging is disabled.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
arch/x86/cpu/start16.S

index e718d4b26ff5fd79a9a08a0bfba38c426e373bb6..445d5a17345585b1cf467b9d80c649bf95f6e68e 100644 (file)
@@ -24,6 +24,9 @@ start16:
        /* Set the Cold Boot / Hard Reset flag */
        movl    $GD_FLG_COLD_BOOT, %ebx
 
+       xorl    %eax, %eax
+       movl    %eax, %cr3    /* Invalidate TLB */
+
        /* Turn off cache (this might require a 486-class CPU) */
        movl    %cr0, %eax
        orl     $(X86_CR0_NW | X86_CR0_CD), %eax