]> git.proxmox.com Git - mirror_edk2.git/commitdiff
Fix >4G issue on IDT not restored correctly.
authorYao, Jiewen <jiewen.yao@intel.com>
Tue, 15 Dec 2015 04:27:00 +0000 (04:27 +0000)
committerjyao1 <jyao1@Edk2>
Tue, 15 Dec 2015 04:27:00 +0000 (04:27 +0000)
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" <jiewen.yao@intel.com>
Reviewed-by: "Ma, Maurice" <maurice.ma@intel.com>
Reviewed-by: "Mudusuru, Giri P" <giri.p.mudusuru@intel.com>
Reviewed-by: "Yarlagadda, Satya P" <satya.p.yarlagadda@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19246 6f19259b-4bc3-4df7-8a09-765794883524

IntelFspWrapperPkg/Library/BaseFspApiLib/X64/DispatchExecute.c

index e2f44225347c844d0025f8b3ccf7b1d811c7196c..360327ed08f53391a229b4ebfaf7c55ee4bc2aaf 100644 (file)
@@ -89,6 +89,18 @@ Execute32BitCode (
   IN UINT64      Param1\r
   )\r
 {\r
-  return AsmExecute32BitCode (Function, Param1, 0, &mGdt);\r
+  EFI_STATUS       Status;\r
+  IA32_DESCRIPTOR  Idtr;\r
+\r
+  //\r
+  // Idtr might be changed inside of FSP. 32bit FSP only knows the <4G address.\r
+  // If IDTR.Base is >4G, FSP can not handle. So we need save/restore IDTR here for X64 only.\r
+  // Interrupt is already disabled here, so it is safety to update IDTR.\r
+  //\r
+  AsmReadIdtr (&Idtr);\r
+  Status = AsmExecute32BitCode (Function, Param1, 0, &mGdt);\r
+  AsmWriteIdtr (&Idtr);\r
+\r
+  return Status;\r
 }\r
 \r