Revision: 19246
          http://sourceforge.net/p/edk2/code/19246
Author:   jyao1
Date:     2015-12-15 04:27:00 +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.

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]>

Modified Paths:
--------------
    trunk/edk2/IntelFspWrapperPkg/Library/BaseFspApiLib/X64/DispatchExecute.c

Modified: 
trunk/edk2/IntelFspWrapperPkg/Library/BaseFspApiLib/X64/DispatchExecute.c
===================================================================
--- trunk/edk2/IntelFspWrapperPkg/Library/BaseFspApiLib/X64/DispatchExecute.c   
2015-12-15 02:53:34 UTC (rev 19245)
+++ trunk/edk2/IntelFspWrapperPkg/Library/BaseFspApiLib/X64/DispatchExecute.c   
2015-12-15 04:27:00 UTC (rev 19246)
@@ -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