Revision: 19279
          http://sourceforge.net/p/edk2/code/19279
Author:   hwu1225
Date:     2015-12-15 13:33:46 +0000 (Tue, 15 Dec 2015)
Log Message:
-----------
Fix >4G issue on IDT not restored correctly.

Idtr might be changed inside of FSP. 32bit FSP only knows the <4G address.
If IDTR.Base is >4G, FSP can not handle. So we need save/restore IDTR here.
Interrupt is already disabled here, so it is safety to update IDTR.

(Sync patch r19246 from main trunk.)

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: "Yao, Jiewen" <[email protected]>
Reviewed-by: "Ma, Maurice" <[email protected]>
Reviewed-by: "Mudusuru, Giri P" <[email protected]>
Reviewed-by: "Yarlagadda, Satya P" <[email protected]>

Revision Links:
--------------
    http://sourceforge.net/p/edk2/code/19246

Modified Paths:
--------------
    
branches/UDK2015/IntelFspWrapperPkg/Library/BaseFspApiLib/X64/DispatchExecute.c

Modified: 
branches/UDK2015/IntelFspWrapperPkg/Library/BaseFspApiLib/X64/DispatchExecute.c
===================================================================
--- 
branches/UDK2015/IntelFspWrapperPkg/Library/BaseFspApiLib/X64/DispatchExecute.c 
    2015-12-15 13:28:00 UTC (rev 19278)
+++ 
branches/UDK2015/IntelFspWrapperPkg/Library/BaseFspApiLib/X64/DispatchExecute.c 
    2015-12-15 13:33:46 UTC (rev 19279)
@@ -89,6 +89,18 @@
   IN UINT64      Param1
   )
 {
-  return AsmExecute32BitCode (Function, Param1, 0, &mGdt);
+  EFI_STATUS       Status;
+  IA32_DESCRIPTOR  Idtr;
+
+  //
+  // Idtr might be changed inside of FSP. 32bit FSP only knows the <4G address.
+  // If IDTR.Base is >4G, FSP can not handle. So we need save/restore IDTR 
here for X64 only.
+  // Interrupt is already disabled here, so it is safety to update IDTR.
+  //
+  AsmReadIdtr (&Idtr);
+  Status = AsmExecute32BitCode (Function, Param1, 0, &mGdt);
+  AsmWriteIdtr (&Idtr);
+
+  return Status;
 }
 


------------------------------------------------------------------------------
_______________________________________________
edk2-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/edk2-commits

Reply via email to