mirror of
https://github.com/tianocore/edk2
synced 2026-08-27 00:23:19 -04:00
ArmVirtPkg: Clear TPIDR_EL0 before early HOB lookups
TPIDR_EL0 is used to hold the PrePi HOB list pointer, but its reset value is unknown. Some early boot paths can call GetHobList() before PrePiMain() creates and installs the HOB list. Clear TPIDR_EL0 at the SEC entry point so those early lookups see NULL rather than an invalid pointer. Signed-off-by: Sami Mujawar <sami.mujawar@arm.com>
This commit is contained in:
parent
2b842a2081
commit
084ce2b04b
1 changed files with 7 additions and 1 deletions
|
|
@ -1,5 +1,5 @@
|
|||
//
|
||||
// Copyright (c) 2011-2013, ARM Limited. All rights reserved.
|
||||
// Copyright (c) 2011-2026, ARM Limited. All rights reserved.
|
||||
// Copyright (c) 2015-2016, Linaro Limited. All rights reserved.
|
||||
//
|
||||
// SPDX-License-Identifier: BSD-2-Clause-Patent
|
||||
|
|
@ -20,6 +20,12 @@ ASM_FUNC(_ModuleEntryPoint)
|
|||
0:mov x28, x0 // preserve DTB pointer
|
||||
mov x27, x1 // preserve base of image pointer
|
||||
|
||||
// The TPIDR_EL0 register is used to store the HobList pointer.
|
||||
// The register value is unknown at reset, so clear the register
|
||||
// to prevent early callers of GetHobList(), i.e. before the HOB list
|
||||
// has been setup in PrePiMain() from getting an invalid value.
|
||||
msr tpidr_el0, xzr
|
||||
|
||||
// Enable Floating Point. This needs to be done before entering C code, which
|
||||
// may use FP/SIMD registers.
|
||||
bl ArmEnableVFP
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue