From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from nwk-aaemail-lapp03.apple.com (nwk-aaemail-lapp03.apple.com [17.151.62.68]) by mx.groups.io with SMTP id smtpd.web12.6249.1570770240522878674 for ; Thu, 10 Oct 2019 22:04:01 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@apple.com header.s=20180706 header.b=JoivTI3s; spf=pass (domain: apple.com, ip: 17.151.62.68, mailfrom: afish@apple.com) Received: from pps.filterd (nwk-aaemail-lapp03.apple.com [127.0.0.1]) by nwk-aaemail-lapp03.apple.com (8.16.0.27/8.16.0.27) with SMTP id x9B526eL027878; Thu, 10 Oct 2019 22:03:58 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=apple.com; h=sender : from : message-id : content-type : mime-version : subject : date : in-reply-to : cc : to : references; s=20180706; bh=nvj065p/DDsGaX6eF0hOcKHmHzHuggsfFAQJmnCRg4E=; b=JoivTI3s+XBHel/iMtWo+hSKhPnLK/ukebF+/rS6EFPxUiQjZ7OiOBgHpnSKgh4M2Umz ZlS4zfjSLBY9Xfht2FwQFaYoJm1UX7dl9XXScygzROaGK02+B7n56SPec49f/IPCpbaI i9y9McXXDnAq/i59E+dxhsxzj7SMM0lAikGpS/y3vLulSWdo46SxSqBKxfgBPG+nNaSV ZIQR2jjpp2ELa9Kl+/qgO94LXAFRX/vrSVNMoDeMRbJg7lzDc/N6CkCVZ0L0Z0vJvhu8 af9GviwHqwDGj9bMtv8dFQKY5AJDaIGM34we/Jg8jw1uvINMR097G1eETxx0Mb1JpFM0 tA== Received: from ma1-mtap-s02.corp.apple.com (ma1-mtap-s02.corp.apple.com [17.40.76.6]) by nwk-aaemail-lapp03.apple.com with ESMTP id 2vfbdmrvv9-4 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NO); Thu, 10 Oct 2019 22:03:58 -0700 Received: from nwk-mmpp-sz09.apple.com (nwk-mmpp-sz09.apple.com [17.128.115.80]) by ma1-mtap-s02.corp.apple.com (Oracle Communications Messaging Server 8.0.2.4.20190507 64bit (built May 7 2019)) with ESMTPS id <0PZ7009CI22LD810@ma1-mtap-s02.corp.apple.com>; Thu, 10 Oct 2019 22:03:57 -0700 (PDT) Received: from process_milters-daemon.nwk-mmpp-sz09.apple.com by nwk-mmpp-sz09.apple.com (Oracle Communications Messaging Server 8.0.2.4.20190507 64bit (built May 7 2019)) id <0PZ700M00207LK00@nwk-mmpp-sz09.apple.com>; Thu, 10 Oct 2019 22:03:57 -0700 (PDT) X-Va-A: X-Va-T-CD: 281f8fa03638b888ab0035439e9fe9bb X-Va-E-CD: c4384febc0b38a4c3ffc24bb55458dfb X-Va-R-CD: 39d1446bb985fb6c3d28e9c8d969a470 X-Va-CD: 0 X-Va-ID: 18f624f7-82ea-41a7-bf5a-ccbbb49b8c96 X-V-A: X-V-T-CD: 281f8fa03638b888ab0035439e9fe9bb X-V-E-CD: c4384febc0b38a4c3ffc24bb55458dfb X-V-R-CD: 39d1446bb985fb6c3d28e9c8d969a470 X-V-CD: 0 X-V-ID: cd723869-9c80-43e8-9dbc-72847af6a698 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2019-10-11_02:,, signatures=0 Received: from [17.235.19.27] (unknown [17.235.19.27]) by nwk-mmpp-sz09.apple.com (Oracle Communications Messaging Server 8.0.2.4.20190507 64bit (built May 7 2019)) with ESMTPSA id <0PZ70098Z1VWDU50@nwk-mmpp-sz09.apple.com>; Thu, 10 Oct 2019 21:59:58 -0700 (PDT) Sender: afish@apple.com From: "Andrew Fish" Message-id: MIME-version: 1.0 (Mac OS X Mail 13.0 \(3594.4.17\)) Subject: Re: [edk2-devel] OVMF is crashing for me in master Date: Thu, 10 Oct 2019 21:59:56 -0700 In-reply-to: <4A89E2EF3DFEDB4C8BFDE51014F606A14E515A05@SHSMSX104.ccr.corp.intel.com> Cc: "devel@edk2.groups.io" , Pete Batard To: "Gao, Liming" References: <4A89E2EF3DFEDB4C8BFDE51014F606A14E515A05@SHSMSX104.ccr.corp.intel.com> X-Mailer: Apple Mail (2.3594.4.17) X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2019-10-11_02:,, signatures=0 Content-type: multipart/alternative; boundary="Apple-Mail=_147DF150-4E0F-405D-A75D-7E56A75F8279" --Apple-Mail=_147DF150-4E0F-405D-A75D-7E56A75F8279 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 Liming, Thanks for looking into this! Can someone also answer my question about the expected behavior of taking = an exception in OVMF? Is the CpuDeadloop() expected?=20 Thanks, Andrew Fish > On Oct 10, 2019, at 6:19 PM, Gao, Liming wrote: >=20 > Andrew: > I verify the change (2de1f611be06ded3a59726a4052a9039be7d459b MdeModul= ePkg/BdsDxe: Also call PlatformBootManagerWaitCallback on 0) in Emulator. > It works, because PCD value is set to 10 in Emulator. > > Before this change, if TimeOut PCD is zero, BdsEntry doesn=E2=80=99t c= all PlatformBootManagerWaitCallback(). > After this change, if TimeOut PCD is zero, BdsEntry still call Platfo= rmBootManagerWaitCallback(). So, it trigs this issue. I agree your fix. > > Pete: > Will you contribute the patch to fix this hang issue in OVMF? > > Thanks > Liming > From: devel@edk2.groups.io [mailto:devel@edk2.groups.io] On Behalf Of An= drew Fish via Groups.Io > Sent: Friday, October 11, 2019 5:12 AM > To: devel@edk2.groups.io; Pete Batard > Subject: [edk2-devel] OVMF is crashing for me in master > > This is my flavor of OVMF: build -p OvmfPkg/OvmfPkgX64.dsc -a X64 -t XC= ODE5 > > It looks like I took an exception? Is it expected that an unhandled exce= ption just hang in a dead loop? I would have expected some serial output a= bout the failure?=20 > > Looks like a divide by zero exception. The exception context has PC and = FP so I can manually walk the stack. Yikes I see PlatformBootManagerWaitCal= lback() will fault if PcdPlatformBootTimeOut is zero?=20 > /Volumes/Case/UDK2018(master)>git grep PcdPlatformBootTimeOut -- *.dsc > ArmVirtPkg/ArmVirtQemu.dsc:194: gEfiMdePkgTokenSpaceGuid.PcdPlatformBoo= tTimeOut|3 > ArmVirtPkg/ArmVirtQemuKernel.dsc:191: gEfiMdePkgTokenSpaceGuid.PcdPlatf= ormBootTimeOut|3 > ArmVirtPkg/ArmVirtXen.dsc:122: gEfiMdePkgTokenSpaceGuid.PcdPlatformBoot= TimeOut|3 > EmulatorPkg/EmulatorPkg.dsc:236: gEfiMdePkgTokenSpaceGuid.PcdPlatformBo= otTimeOut|L"Timeout"|gEfiGlobalVariableGuid|0x0|10 > OvmfPkg/OvmfPkgIa32.dsc:541: gEfiMdePkgTokenSpaceGuid.PcdPlatformBootTi= meOut|0 > OvmfPkg/OvmfPkgIa32X64.dsc:553: gEfiMdePkgTokenSpaceGuid.PcdPlatformBoo= tTimeOut|0 > OvmfPkg/OvmfPkgX64.dsc:552: gEfiMdePkgTokenSpaceGuid.PcdPlatformBootTim= eOut|0 > OvmfPkg/OvmfXen.dsc:470: gEfiMdePkgTokenSpaceGuid.PcdPlatformBootTimeOu= t|0 > UefiPayloadPkg/UefiPayloadPkgIa32.dsc:344: gEfiMdePkgTokenSpaceGuid.Pcd= PlatformBootTimeOut|3 > UefiPayloadPkg/UefiPayloadPkgIa32X64.dsc:345: gEfiMdePkgTokenSpaceGuid.= PcdPlatformBootTimeOut|3 >=20 >=20 > OK PcdPlatformBootTimeOut is zero on Ovmf, so how did this ever work? >=20 >=20 > Ahhh gotom....=20 > /Volumes/Case/UDK2018(master)>git blame -L344,344 /Volumes/Case/UDK2018= /MdeModulePkg/Universal/BdsDxe/BdsEntry.c=20 > 2de1f611be0 (Pete Batard 2019-09-25 23:50:05 +0800 344) PlatformBootMa= nagerWaitCallback (0); >=20 >=20 > This call causes a divide by zero if PcdPlatformBootTimeOut =3D=3D 0.=20 > > This fixes my crash: > diff --git a/OvmfPkg/Library/PlatformBootManagerLib/BdsPlatform.c b/Ovmf= Pkg/Library/PlatformBootManagerLib/BdsPlatform.c > index 70df6b841a..d6ae43e900 100644 > --- a/OvmfPkg/Library/PlatformBootManagerLib/BdsPlatform.c > +++ b/OvmfPkg/Library/PlatformBootManagerLib/BdsPlatform.c > @@ -1634,6 +1634,11 @@ PlatformBootManagerWaitCallback ( > UINT16 Timeout; > > Timeout =3D PcdGet16 (PcdPlatformBootTimeOut); > + if (Timeout =3D=3D 0) { > + Timeout =3D 100; > + } else { > + Timeout =3D (Timeout - TimeoutRemain) * 100 / Timeout; > + } > > Black.Raw =3D 0x00000000; > White.Raw =3D 0x00FFFFFF; > @@ -1643,7 +1648,7 @@ PlatformBootManagerWaitCallback ( > Black.Pixel, > L"Start boot option", > White.Pixel, > - (Timeout - TimeoutRemain) * 100 / Timeout, > + Timeout, > 0 > ); > } >=20 >=20 > > lldb debugger output: > > (lldb) bt > * thread #1, stop reason =3D signal SIGTRAP > * frame #0: 0x0000000007b58a70 CpuDxe.dll:CpuDeadLoop() + 13 at /Volum= es/Case/UDK2018/MdePkg/Library/BaseLib/CpuDeadLoop.c:31 > frame #1: 0x0000000007b61222 CpuDxe.dll:CommonExceptionHandlerWorker= () + 674 at /Volumes/Case/UDK2018/UefiCpuPkg/Library/CpuExceptionHandlerLib= /PeiDxeSmmCpuException.c:115 > frame #2: 0x0000000007b61624 CpuDxe.dll:CommonExceptionHandler() + 3= 6 at /Volumes/Case/UDK2018/UefiCpuPkg/Library/CpuExceptionHandlerLib/DxeExc= eption.c:40 > frame #3: 0x0000000007b5ff26 CpuDxe.dll:HasErrorCode() + 230 > (lldb) fr sel 1 > frame #1: 0x0000000007b61222 CpuDxe.dll:CommonExceptionHandlerWorker() += 674 at /Volumes/Case/UDK2018/UefiCpuPkg/Library/CpuExceptionHandlerLib/Pei= DxeSmmCpuException.c:115 > 91 (ExternalInterruptHandler[ExceptionType]) (ExceptionTy= pe, SystemContext); > 92 } else if (ExceptionType < CPU_EXCEPTION_NUM) { > 93 // > 94 // Get Spinlock to display CPU information > 95 // > 96 while (!AcquireSpinLockOrFail (&ExceptionHandlerData->= DisplayMessageSpinLock)) { > 97 CpuPause (); > 98 } > 99 // > 100 // Initialize the serial port before dumping. > 101 // > 102 SerialPortInitialize (); > 103 // > 104 // Display ExceptionType, CPU information and Image inf= ormation > 105 // > 106 DumpImageAndCpuContent (ExceptionType, SystemContext); > 107 // > 108 // Release Spinlock of output message > 109 // > 110 ReleaseSpinLock (&ExceptionHandlerData->DisplayMessageS= pinLock); > 111 // > 112 // Enter a dead loop if needn't to execute old IDT hand= ler further > 113 // > 114 if (ReservedVectors[ExceptionType].Attribute !=3D EFI_V= ECTOR_HANDOFF_HOOK_BEFORE) { > -> 115 CpuDeadLoop (); > 116 } > 117 } > 118 } > 119 > (lldb) p ExceptionType > (EFI_EXCEPTION_TYPE) $0 =3D 0 > (lldb) p SystemContext.SystemContextX64->Rip > (UINT64) $1 =3D 0x0000000007a9cc38 > (lldb) p SystemContext.SystemContextX64->Rbp > (UINT64) $2 =3D 0x0000000007e8fc20 > (lldb) efi_backtrace --pc 0x0000000007a9cc38 --frame 0x0000000007e8fc20 = --symbols > frame 0: 0x07a9cc38 BdsDxe:PlatformBootManagerWaitCallback + 35 at /V= olumes/Case/UDK2018/OvmfPkg/Library/PlatformBootManagerLib/BdsPlatform.c:16= 46:37 > frame 1: 0x07a9e744 BdsDxe:BdsWait + 269 at /Volumes/Case/UDK2018/Mde= ModulePkg/Universal/BdsDxe/BdsEntry.c:344:3 > frame 2: 0x07a9dff9 BdsDxe:BdsEntry + 2620 at /Volumes/Case/UDK2018/M= deModulePkg/Universal/BdsDxe/BdsEntry.c:1002:5 > frame 3: 0x07eb367d DxeCore:DxeMain + 2680 at /Volumes/Case/UDK2018/M= deModulePkg/Core/Dxe/DxeMain/DxeMain.c:544:3 > frame 4: 0x07e943cb DxeCore:_ModuleEntryPoint + 20 at /Volumes/Case/U= DK2018/MdePkg/Library/DxeCoreEntryPoint/DxeCoreEntryPoint.c:48:3 > frame 5: 0x07edc947 DxeIpl.dll`AsmEnableCache > frame 6: 0x07ee1e4e DxeIpl:HandOffToDxeCore + 509 at /Volumes/Case/UD= K2018/MdeModulePkg/Core/DxeIplPeim/X64/DxeLoadFunc.c:113:3 > frame 7: 0x07ee0604 DxeIpl:DxeLoadCore + 1354 at /Volumes/Case/UDK201= 8/MdeModulePkg/Core/DxeIplPeim/DxeLoad.c:449:3 > frame 8: 0x07eeff2f PeiCore.dll`PeiCore.cold.3 + 847 > frame 9: 0x07ee9d04 PeiCore:PeiCore + 163 at /Volumes/Case/UDK2018/Md= eModulePkg/Core/Pei/PeiMain/PeiMain.c:502:3 > frame 10: 0x0082c387 0x0082c387 > frame 11: 0x00825dd7 0x00825dd7 > frame 12: 0x0082ad27 0x0082ad27 > frame 13: 0x0082b3a8 0x0082b3a8 > frame 14: 0x0082bf23 0x0082bf23 > frame 15: 0x00825e24 0x00825e24 > frame 16: 0x00823af2 0x00823af2 > frame 17: 0xfffd1db8 SecMain:SecStartupPhase2 + 67 at /Volumes/Case/UD= K2018/OvmfPkg/Sec/SecMain.c:858:3 > frame 18: 0xfffd1d67 SecMain:SecCoreStartupWithStack + 420 at /Volumes= /Case/UDK2018/OvmfPkg/Sec/SecMain.c:821:3 > frame 19: 0xfffd1e14 SecMain:ProcessLibraryConstructorList + 0 at /Vol= umes/Case/UDK2018/Build/OvmfX64/DEBUG_XCODE5/X64/OvmfPkg/Sec/SecMain/DEBUG/= AutoGen.c:201 > > (lldb) l /Volumes/Case/UDK2018/OvmfPkg/Library/PlatformBootManagerLib/Bd= sPlatform.c:1646 > 1646 (Timeout - TimeoutRemain) * 100 / Timeout, > 1647 0 > 1648 ); > 1649 } > 1650 > 1651 /** > 1652 The function is called when no boot option could be launch= ed, > 1653 including platform recovery options and options pointing t= o applications > 1654 built into firmware volumes. > 1655 > (lldb) l /Volumes/Case/UDK2018/MdeModulePkg/Universal/BdsDxe/BdsEntry.c:= 344 > 344 PlatformBootManagerWaitCallback (0); > 345 DEBUG ((EFI_D_INFO, "[Bds]Exit the waiting!\n")); > 346 } > 347 > 348 /** > 349 Attempt to boot each boot option in the BootOptions array= . > 350 > 351 @param BootOptions Input boot option array. > 352 @param BootOptionCount Input boot option count. > 353 @param BootManagerMenu Input boot manager menu. > 354 > > > Thanks, > > Andrew Fish > >=20 --Apple-Mail=_147DF150-4E0F-405D-A75D-7E56A75F8279 Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=utf-8 Liming,
Thanks for looking into this!

Can someone also answer my = question about the expected behavior of taking an exception in OVMF?  = Is the CpuDeadloop() expected? 

Thanks,

Andrew Fish

On Oct 10, 2019, at 6:19= PM, Gao, Liming <lim= ing.gao@intel.com> wrote:

Andrew:
  I verify the chang= e (2de1f611be06ded3a59726a4052a9039be7d459b MdeModulePkg/BdsDxe: Also call = PlatformBootManagerWaitCallback on 0) in Emulator.
  It works, because PCD value is set to 10 in Emulator.
=  
  Bef= ore this change, if TimeOut PCD is zero, BdsEntry doesn=E2=80=99t call Plat= formBootManagerWaitCallback().
  A= fter this change,  if TimeOut PCD is zero, BdsEntry still call Platfor= mBootManagerWaitCallback(). So, it trigs this issue. I agree your fix.
 
Pete:
  Will you contribute the patch to fix this ha= ng issue in OVMF?
 
Thanks
Liming=
From: devel@edk2.groups.io [mailto:devel@edk2.gr= oups.io] On Behalf Of Andrew= Fish via Groups.Io
Sent: Friday, October 11, 2019 5:12 AM
To: devel@edk2.groups.io= ; Pete Batard <pete@akeo.= ie>
Subject: [edk2-devel] OVMF is crashing for me in master
 
This is my flavor of OVMF:  build -p OvmfPkg/OvmfP= kgX64.dsc -a X64 -t XCODE5
 
It looks like= I took an exception? Is it expected that an unhandled exception just hang = in a dead loop? I would have expected some serial  output about the fa= ilure? 
 
Looks like a divide b= y zero exception. The exception context has PC and FP so I can manually wal= k the stack. Yikes I see PlatformBootManagerWaitCallback() will fault = if PcdPlatformBootTimeOut is zero? 
/Volumes/Case/UDK2018(master)>git grep PcdPlatformBo= otTimeOut -- *.dsc
=
ArmVirtPkg/ArmVirtQemu.dsc:194:  gEfi= MdePkgTokenSpaceGuid.PcdPlatform= BootTimeOut|3
ArmVirtPkg/ArmVirtQemuKernel.dsc= :191:&n= bsp; gEfiMdePkgTokenSpaceGuid.Pc= dPlatformBootTimeOut|3
ArmVirtPkg/ArmVirtXen.d= sc:122:=   gEfiMdePkgTokenSpaceGuid.= PcdPlatformBootTimeOut|3
EmulatorPkg/EmulatorP= kg.dsc:236:=   gEfiMdePkgTokenSpaceGuid.PcdPlatformBootTimeOut|L"Timeout"|gEfiGlobalVariableGuid|0x0= |10
OvmfPkg/OvmfPkgIa32.dsc:541:  gEfiMdePkgTokenSpaceGu= id.PcdPlatformBootTimeOut= |0
OvmfPkg/OvmfPkgIa32X64.dsc:553:  gEfiMdePkgTokenSpa= ceGuid.PcdPlatformBootTimeOut|0
OvmfPkg/OvmfPkgX64.dsc:552:  gEfiMdePkgTokenSp= aceGuid.PcdPlatformBootTimeOut|0
OvmfPkg/OvmfXen.dsc:470:  gEfiMdePkgTokenSpa= ceGuid.PcdPlatformBootTimeOut|0
UefiPayloadPkg/UefiPayloadPkgIa32.dsc= :344:  gE= fiMdePkgTokenSpaceGuid.PcdPlatfo= rmBootTimeOut|3
UefiPayloadPkg/UefiPayloadPk= gIa32X64.dsc:345:  gEfiMdePkgTokenSpaceGuid.PcdPlatformBootTimeOut|3


<= div style=3D"margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: "= Times New Roman", serif;" class=3D"">OK PcdPlatformBootTimeOut is= zero on Ovmf, so how did this ever work?
=

<= br class=3D"">
Ahhh gotom.... 
/Volumes/Case/UDK2018(master)>git blame -L344,3= 44  /Volumes/Case/UDK2018/MdeModulePkg/Universal/BdsDxe/BdsEntry.c&nbs= p;
2de1f611be0 (Pete Batard 2019-09-25 23:50:05 +0800 = 344)   PlatformBootManagerWaitCallback (0);

This call causes a divi= de by zero if PcdPlatformBootTimeOut =3D=3D 0. 
=  
This fixes my crash:
diff --git a/OvmfPkg/Library/PlatformBootManagerLib/BdsPlatfo= rm.c b/OvmfPkg/Library/PlatformBootManagerLib/BdsPlatform.c
index 70df6b841a..d6ae43e900 100644<= span style=3D"font-size: 8.5pt; font-family: Menlo, serif;" class=3D"">
--- a/OvmfPkg/Library/PlatformBootManagerLi= b/BdsPlatform.c
+++ b/OvmfPkg= /Library/PlatformBootManagerLib/BdsPlatform.c=
@@ -1634,6 +1634,11 @@ PlatformBootManagerWaitCallback (
   UINT16             =                 Timeout;
 
   = Timeout =3D PcdGet16 (PcdPlatformBootTimeOut);=
+  if (Timeout =3D=3D  0) {
+    Timeout =3D 100;
+  } else {
+    Timeout =3D (Timeout - TimeoutRemain) * = 100 / Timeout;
+  }
 
  = Black.Raw =3D 0x00000000;
   White.Raw =3D = 0x00FFFFFF;
@@ -1643,7 +1648= ,7 @@ PlatformBootMan= agerWaitCallback (
=
     Black.Pixel,
     L"Start boot option",
     White.Pixel,
<= /div>
-    (Timeout - TimeoutRemain) * 100 / Timeout,
+    Timeout,
     0
=
    = );
 }


 
lldb debugger o= utput:
 
(lldb) bt
=
* thread #1, stop r= eason =3D signal SIGTRAP
  * frame #0: 0x0000000= 007b58a70 CpuDxe.dll:CpuDeadLoop() + 13 at /Volumes/Case/UDK2018/MdePkg/Lib= rary/BaseLib/CpuDeadLoop.c:31
    frame #1: = 0x0000000007b61222 CpuDxe.dll:CommonExceptionHandlerWorker() + 674 at /Volu= mes/Case/UDK2018/UefiCpuPkg/Library/CpuExceptionHandlerLib/PeiDxeSmmCpuExce= ption.c:115
    frame #2: 0x0000000007b61624= CpuDxe.dll:CommonExceptionHandler() + 36 at /Volumes/Case/UDK2018/UefiCpuP= kg/Library/CpuExceptionHandlerLib/DxeException.c:40
&n= bsp;   frame #3: 0x0000000007b5ff26 CpuDxe.dll:HasErrorCode() + 230
(lldb) fr sel 1
=
frame #1: 0x0= 000000007b61222 CpuDxe.dll:CommonExceptionHandlerWorker() + 674 at /Volumes= /Case/UDK2018/UefiCpuPkg/Library/CpuExceptionHandlerLib/PeiDxeSmmCpuExcepti= on.c:115
   91    &nbs= p;        (ExternalInterruptHandler[ExceptionType]) (ExceptionType, = SystemContext);
   92   &nbs= p;       } = else <= /span>if (ExceptionType < CPU_EXCEPTION_NUM) {
   93             //=
   94    &nbs= p;        <= span style=3D"font-size: 8.5pt; font-family: Menlo, serif; color: rgb(219, = 39, 218);" class=3D"">// Get Spinlock to display CPU information
   95 &nb= sp;     &nbs= p;     //
   96    =      =     while&nb= sp;(!AcquireSpinLockOrFail (&ExceptionHandlerData->DisplayMes= sageSpinLock)) {
   97   &nb= sp;           CpuPause ();
 &nbs= p; 98             }
   99             //=
   100    &nb= sp;    &= nbsp; // Initialize the serial port before dumping.<= /o:p>
   101 <= span class=3D"apple-tab-span">          //
   102 =           SerialPort= Initialize ();
   103   &nbs= p;   &nb= sp;   //
   104 &nb= sp;         <= /span>// Display ExceptionType, CPU information and = Image information
<= div style=3D"margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: "= Times New Roman", serif;" class=3D"">   105   &= nbsp;   =     //
   106 &nb= sp;         DumpImageAndCpuContent (ExceptionType, SystemContex= t);
   107     &nb= sp;    <= span class=3D"Apple-converted-space"> //
   108    = ;   &nbs= p;   // Release Spinlock of output message<= /span>
&= nbsp;  109           //
   110           ReleaseSpinLo= ck (&ExceptionHandlerData->DisplayMessageSpinLock);<= /o:p>
   111 <= span class=3D"apple-tab-span">          //
   112 =           // E= nter a dead loop if needn't to execute old IDT handler further
   113           //
   114&= nbsp;          i= f (ReservedVectors[= ExceptionType].Attribute !=3D EFI_VECTOR_HANDOFF_HOOK_BEFORE) {
-> 115            CpuDeadLoop ();
=
   = 116           }
   = 117         }
   118       = }
   119      <= /span>
(lldb) p ExceptionType
<= /div>
(EFI_EXCEPTION_TYPE) $0 =3D 0
(lldb) <= span style=3D"font-size: 8.5pt; font-family: Menlo, serif;" class=3D"">p Sy= stemContext.SystemContextX64->Rip
(UINT64) $1 =3D 0= x0000000007a9cc38
<= div style=3D"margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: "= Times New Roman", serif;" class=3D"">(lldb) p SystemContext.SystemC= ontextX64->Rbp
<= div style=3D"margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: "= Times New Roman", serif;" class=3D"">(UINT64) $2 =3D 0x0000000007e8fc20
(lldb) efi_backtrace --pc 0x0000000007a9cc38 --fr= ame 0x0000000007e8fc20 --symbols
  frame  0:= 0x07a9cc38 BdsDxe:PlatformBootManagerWaitCallback + 35 at /Volumes/Case/UD= K2018/OvmfPkg/Library/PlatformBootManagerLib/BdsPlatform.c:1646:37
  frame  1: 0x07a9e744 BdsDxe:BdsWait + 269 at /Volu= mes/Case/UDK2018/MdeModulePkg/Universal/BdsDxe/BdsEntry.c:344:3
  frame  2: 0x07a9dff9 BdsDxe:BdsEntry + 2620 at /Vo= lumes/Case/UDK2018/MdeModulePkg/Universal/BdsDxe/BdsEntry.c:1002:5
  frame  3: 0x07eb367d DxeCore:DxeMain + 2680 at /Vo= lumes/Case/UDK2018/MdeModulePkg/Core/Dxe/DxeMain/DxeMain.c:544:3
  frame  4: 0x07e943cb DxeCore:_ModuleEntryPoint + 2= 0 at /Volumes/Case/UDK2018/MdePkg/Library/DxeCoreEntryPoint/DxeCoreEntryPoi= nt.c:48:3
  frame  5: 0x07edc947 DxeIpl.dll`= AsmEnableCache
  frame  6: 0x07ee1e4e DxeIpl= :HandOffToDxeCore + 509 at /Volumes/Case/UDK2018/MdeModulePkg/Core/DxeIplPe= im/X64/DxeLoadFunc.c:113:3
  frame  7: 0x07e= e0604 DxeIpl:DxeLoadCore + 1354 at /Volumes/Case/UDK2018/MdeModulePkg/Core/= DxeIplPeim/DxeLoad.c:449:3
  frame  8: 0x07e= eff2f PeiCore.dll`PeiCore.cold.3 + 847
  frame&= nbsp; 9: 0x07ee9d04 PeiCore:PeiCore + 163 at /Volumes/Case/UDK2018/MdeModul= ePkg/Core/Pei/PeiMain/PeiMain.c:502:3
  frame = 10: 0x0082c387 0x0082c387
  frame 11: 0x00825dd7 = 0x00825dd7
  frame 12: 0x0082ad27 0x0082ad27
  frame 13: 0x0082b3a8 0x0082b3a8
  frame 14: 0x0082bf23 0x0082bf23<= /div>
  f= rame 15: 0x00825e24 0x00825e24
  frame 16: 0x0082= 3af2 0x00823af2
  frame 17: 0xfffd1db8 SecMain:Se= cStartupPhase2 + 67 at /Volumes/Case/UDK2018/OvmfPkg/Sec/SecMain.c:858:3
  frame 18: 0xfffd1d67 SecMain:SecCoreStartupWithSt= ack + 420 at /Volumes/Case/UDK2018/OvmfPkg/Sec/SecMain.c:821:3
  frame 19: 0xfffd1e14 SecMain:ProcessLibraryConstructorList = + 0 at /Volumes/Case/UDK2018/Build/OvmfX64/DEBUG_XCODE5/X64/OvmfPkg/Sec/Sec= Main/DEBUG/AutoGen.c:201
 =
(lldb)&nbs= p;l /Volumes/Case/UDK2018/OvmfPkg/Library/PlatformBootManagerLib= /BdsPlatform.c:1646
   1646         (Timeout - TimeoutRemain) * 100 / Timeout,
   1647  &n= bsp;    =   0
<= div style=3D"margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: "= Times New Roman", serif;" class=3D"">   1648    &= nbsp;    );
   1649<= span class=3D"apple-tab-span">     }
   = 1650    
   1651  &n= bsp;  /**
   1652 &nb= sp;   &n= bsp; The function is called when no boot option could be launched,
   1653  &n= bsp;    = including platform recovery options and options pointing to applications
   1654 &n= bsp;   &= nbsp; built into firmware volumes.
=
   1655    
(lldb) l /Volumes/Case/UDK2018/MdeMod= ulePkg/Universal/BdsDxe/BdsEntry.c:344
   = 344         PlatformBootManagerWaitCallback (0);
   345 &nb= sp;       DEBUG ((EFI_D_INFO, "[Bds]Exit the waiting!\n"));
   346       }
= &nb= sp;  347     &= nbsp;
   348    =    /**
   349&= nbsp;        Attempt to b= oot each boot option in the BootOptions array.=
 &= nbsp; 350      = ;
   351    &nb= sp;    @= param BootOptions       Input boot option array.
   352         @param BootOptionCo= unt   Input boot option count.
   353      &n= bsp;  @param BootManagerMenu   Input boot manager m= enu.
   354      
 
 
Thanks,
 
Andrew Fish
<= /div>
 

--Apple-Mail=_147DF150-4E0F-405D-A75D-7E56A75F8279--