]> git.proxmox.com Git - mirror_edk2.git/blobdiff - UefiCpuPkg/Library/CpuExceptionHandlerLib/SecPeiCpuException.c
UefiCpuPkg/CpuExceptionHandler: Add base support for the #VE exception
[mirror_edk2.git] / UefiCpuPkg / Library / CpuExceptionHandlerLib / SecPeiCpuException.c
index c614d5b0b6f17274ea3c6ed7e77f7d1e6b5c47a4..6e5216380da83acf8507ea6423bb105fb82a28a7 100644 (file)
@@ -25,22 +25,47 @@ CommonExceptionHandler (
   IN EFI_SYSTEM_CONTEXT  SystemContext\r
   )\r
 {\r
-  if (ExceptionType == VC_EXCEPTION) {\r
-    EFI_STATUS  Status;\r
-    //\r
-    // #VC needs to be handled immediately upon enabling exception handling\r
-    // and therefore can't use the RegisterCpuInterruptHandler() interface\r
-    // (which isn't supported under Sec and Pei anyway).\r
-    //\r
-    // Handle the #VC:\r
-    //   On EFI_SUCCESS - Exception has been handled, return\r
-    //   On other       - ExceptionType contains (possibly new) exception\r
-    //                    value\r
-    //\r
-    Status = VmgExitHandleVc (&ExceptionType, SystemContext);\r
-    if (!EFI_ERROR (Status)) {\r
-      return;\r
-    }\r
+  EFI_STATUS  Status;\r
+\r
+  switch (ExceptionType) {\r
+    case VC_EXCEPTION:\r
+      //\r
+      // #VC needs to be handled immediately upon enabling exception handling\r
+      // and therefore can't use the RegisterCpuInterruptHandler() interface\r
+      // (which isn't supported under Sec and Pei anyway).\r
+      //\r
+      // Handle the #VC:\r
+      //   On EFI_SUCCESS - Exception has been handled, return\r
+      //   On other       - ExceptionType contains (possibly new) exception\r
+      //                    value\r
+      //\r
+      Status = VmgExitHandleVc (&ExceptionType, SystemContext);\r
+      if (!EFI_ERROR (Status)) {\r
+        return;\r
+      }\r
+\r
+      break;\r
+\r
+    case VE_EXCEPTION:\r
+      //\r
+      // #VE needs to be handled immediately upon enabling exception handling\r
+      // and therefore can't use the RegisterCpuInterruptHandler() interface\r
+      // (which isn't supported under Sec and Pei anyway).\r
+      //\r
+      // Handle the #VE:\r
+      //   On EFI_SUCCESS - Exception has been handled, return\r
+      //   On other       - ExceptionType contains (possibly new) exception\r
+      //                    value\r
+      //\r
+      Status = VmTdExitHandleVe (&ExceptionType, SystemContext);\r
+      if (!EFI_ERROR (Status)) {\r
+        return;\r
+      }\r
+\r
+      break;\r
+\r
+    default:\r
+      break;\r
   }\r
 \r
   //\r