OvmfPkg: Sec: Fix SOURCE_DEBUG_ENABLE ASSERT()

The update to the LocalApicLib instances to make sure the Local APIC is
initialized before use (SVN r18595 / git commit 6d72ff7d9d) generates an
ASSERT() when SOURCE_DEBUG_ENABLE is enabled for OVMF.

The fix is to initialize the Local APIC Timer and mask it before
initializing the DebugAgent.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Michael Kinney <michael.d.kinney@intel.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Regression-tested-by: Laszlo Ersek <lersek@redhat.com>
[lersek@redhat.com: rewrap code comment, rewrap commit msg, add precise
 commit ref]

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Laszlo Ersek <lersek@redhat.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18622 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
Michael Kinney 2015-10-16 16:48:24 +00:00 committed by lersek
parent 5efb28784f
commit f3e34b9d8c
2 changed files with 12 additions and 2 deletions

View File

@ -1,7 +1,7 @@
/** @file
Main SEC phase code. Transitions to PEI.
Copyright (c) 2008 - 2013, Intel Corporation. All rights reserved.<BR>
Copyright (c) 2008 - 2015, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
@ -28,6 +28,7 @@
#include <Library/PeCoffGetEntryPointLib.h>
#include <Library/PeCoffExtraActionLib.h>
#include <Library/ExtractGuidedSectionLib.h>
#include <Library/LocalApicLib.h>
#include <Ppi/TemporaryRamSupport.h>
@ -767,6 +768,14 @@ SecCoreStartupWithStack (
//
IoWrite8 (0x21, 0xff);
IoWrite8 (0xA1, 0xff);
//
// Initialize Local APIC Timer hardware and disable Local APIC Timer
// interrupts before initializing the Debug Agent and the debug timer is
// enabled.
//
InitializeApicTimer (0, MAX_UINT32, TRUE, 5);
DisableApicTimerInterrupt ();
//
// Initialize Debug Agent to support source level debug in SEC/PEI phases before memory ready.

View File

@ -1,7 +1,7 @@
## @file
# SEC Driver
#
# Copyright (c) 2008 - 2013, Intel Corporation. All rights reserved.<BR>
# Copyright (c) 2008 - 2015, Intel Corporation. All rights reserved.<BR>
#
# This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD License
@ -55,6 +55,7 @@
PeCoffGetEntryPointLib
PeCoffExtraActionLib
ExtractGuidedSectionLib
LocalApicLib
[Ppis]
gEfiTemporaryRamSupportPpiGuid # PPI ALWAYS_PRODUCED