Revision: 14037
          http://edk2.svn.sourceforge.net/edk2/?rev=14037&view=rev
Author:   li-elvin
Date:     2013-01-07 07:12:19 +0000 (Mon, 07 Jan 2013)
Log Message:
-----------
Current Thunk16.asm implementation clears reserved bits, which does not follow 
IA32 SDM. Now the fix is to only clear PAE and PSE bit of CR4 for real mode.

Modified Paths:
--------------
    trunk/edk2/MdePkg/Library/BaseLib/Ia32/Thunk16.S
    trunk/edk2/MdePkg/Library/BaseLib/Ia32/Thunk16.asm
    trunk/edk2/MdePkg/Library/BaseLib/X64/Thunk16.S
    trunk/edk2/MdePkg/Library/BaseLib/X64/Thunk16.asm

Modified: trunk/edk2/MdePkg/Library/BaseLib/Ia32/Thunk16.S
===================================================================
--- trunk/edk2/MdePkg/Library/BaseLib/Ia32/Thunk16.S    2013-01-06 06:12:50 UTC 
(rev 14036)
+++ trunk/edk2/MdePkg/Library/BaseLib/Ia32/Thunk16.S    2013-01-07 07:12:19 UTC 
(rev 14037)
@@ -1,6 +1,6 @@
 #------------------------------------------------------------------------------
 #
-# Copyright (c) 2006 - 2011, Intel Corporation. All rights reserved.<BR>
+# Copyright (c) 2006 - 2013, Intel Corporation. All rights reserved.<BR>
 # This program and the accompanying materials
 # are licensed and made available under the terms and conditions of the BSD 
License
 # which accompanies this distribution.  The full text of the license may be 
found at
@@ -175,7 +175,7 @@
     andl    $0x7ffffffe, %eax           # clear PE, PG bits
     movl    %cr4, %ebp
     mov     %ebp, 0xfffffff1(%edx)
-    andl    $0x300, %ebp                # clear all but PCE and OSFXSR bits
+    andl    $0xffffffcf, %ebp           # clear PAE, PSE bits
     pushl   $0x10
     pop     %ecx                        # ecx <- selector for data segments
     lgdtl   0x20(%edx)

Modified: trunk/edk2/MdePkg/Library/BaseLib/Ia32/Thunk16.asm
===================================================================
--- trunk/edk2/MdePkg/Library/BaseLib/Ia32/Thunk16.asm  2013-01-06 06:12:50 UTC 
(rev 14036)
+++ trunk/edk2/MdePkg/Library/BaseLib/Ia32/Thunk16.asm  2013-01-07 07:12:19 UTC 
(rev 14037)
@@ -3,7 +3,7 @@
 
 ;------------------------------------------------------------------------------
 ;
-; Copyright (c) 2006 - 2011, Intel Corporation. All rights reserved.<BR>
+; Copyright (c) 2006 - 2013, Intel Corporation. All rights reserved.<BR>
 ; This program and the accompanying materials
 ; are licensed and made available under the terms and conditions of the BSD 
License
 ; which accompanies this distribution.  The full text of the license may be 
found at
@@ -237,7 +237,7 @@
     and     eax, 7ffffffeh              ; clear PE, PG bits
     mov     ebp, cr4
     mov     [edx + (SavedCr4 - SavedCr0)], ebp
-    and     ebp, 300h                   ; clear all but PCE and OSFXSR bits
+    and     ebp, NOT 30h                ; clear PAE, PSE bits
     push    10h
     pop     ecx                         ; ecx <- selector for data segments
     lgdt    fword ptr [edx + (_16Gdtr - SavedCr0)]

Modified: trunk/edk2/MdePkg/Library/BaseLib/X64/Thunk16.S
===================================================================
--- trunk/edk2/MdePkg/Library/BaseLib/X64/Thunk16.S     2013-01-06 06:12:50 UTC 
(rev 14036)
+++ trunk/edk2/MdePkg/Library/BaseLib/X64/Thunk16.S     2013-01-07 07:12:19 UTC 
(rev 14037)
@@ -1,6 +1,6 @@
 #------------------------------------------------------------------------------
 #
-# Copyright (c) 2006 - 2011, Intel Corporation. All rights reserved.<BR>
+# Copyright (c) 2006 - 2013, Intel Corporation. All rights reserved.<BR>
 # This program and the accompanying materials
 # are licensed and made available under the terms and conditions of the BSD 
License
 # which accompanies this distribution.  The full text of the license may be 
found at
@@ -295,7 +295,7 @@
     andl    $0x7ffffffe,%eax            # clear PE, PG bits
     movq    %cr4, %rbp
     movl    %ebp, (%rcx)                # save CR4 in SavedCr4
-    andl    $0x300,%ebp                 # clear all but PCE and OSFXSR bits
+    andl    $0xffffffcf,%ebp            # clear PAE, PSE bits
     movl    %r8d, %esi                  # esi <- 16-bit stack segment
     .byte      0x6a, DATA32
     popq    %rdx

Modified: trunk/edk2/MdePkg/Library/BaseLib/X64/Thunk16.asm
===================================================================
--- trunk/edk2/MdePkg/Library/BaseLib/X64/Thunk16.asm   2013-01-06 06:12:50 UTC 
(rev 14036)
+++ trunk/edk2/MdePkg/Library/BaseLib/X64/Thunk16.asm   2013-01-07 07:12:19 UTC 
(rev 14037)
@@ -3,7 +3,7 @@
 
 ;------------------------------------------------------------------------------
 ;
-; Copyright (c) 2006 - 2011, Intel Corporation. All rights reserved.<BR>
+; Copyright (c) 2006 - 2013, Intel Corporation. All rights reserved.<BR>
 ; This program and the accompanying materials
 ; are licensed and made available under the terms and conditions of the BSD 
License
 ; which accompanies this distribution.  The full text of the license may be 
found at
@@ -282,7 +282,7 @@
     and     eax, 7ffffffeh              ; clear PE, PG bits
     mov     rbp, cr4
     mov     [rcx], ebp                  ; save CR4 in SavedCr4
-    and     ebp, 300h                   ; clear all but PCE and OSFXSR bits
+    and     ebp, NOT 30h                ; clear PAE, PSE bits
     mov     esi, r8d                    ; esi <- 16-bit stack segment
     DB      6ah, DATA32                 ; push DATA32
     pop     rdx                         ; rdx <- 32-bit data segment selector

This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.


------------------------------------------------------------------------------
Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS,
MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current
with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft
MVPs and experts. SALE $99.99 this month only -- learn more at:
http://p.sf.net/sfu/learnmore_122412
_______________________________________________
edk2-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/edk2-commits

Reply via email to