2014-08-19 01:03:53 +02:00
|
|
|
## @file
|
|
|
|
# Reset Vector
|
|
|
|
#
|
|
|
|
# Copyright (c) 2006 - 2014, Intel Corporation. All rights reserved.<BR>
|
|
|
|
#
|
2019-04-04 01:06:33 +02:00
|
|
|
# SPDX-License-Identifier: BSD-2-Clause-Patent
|
2014-08-19 01:03:53 +02:00
|
|
|
#
|
|
|
|
##
|
|
|
|
|
|
|
|
[Defines]
|
|
|
|
INF_VERSION = 0x00010005
|
|
|
|
BASE_NAME = ResetVector
|
|
|
|
FILE_GUID = 1BA0062E-C779-4582-8566-336AE8F78F09
|
|
|
|
MODULE_TYPE = SEC
|
|
|
|
VERSION_STRING = 1.1
|
|
|
|
|
|
|
|
#
|
|
|
|
# The following information is for reference only and not required by the build tools.
|
|
|
|
#
|
|
|
|
# VALID_ARCHITECTURES = IA32 X64
|
|
|
|
#
|
|
|
|
|
|
|
|
[Sources]
|
|
|
|
ResetVector.nasmb
|
|
|
|
|
|
|
|
[Packages]
|
2016-11-04 14:32:39 +01:00
|
|
|
OvmfPkg/OvmfPkg.dec
|
2014-08-19 01:03:53 +02:00
|
|
|
MdePkg/MdePkg.dec
|
OvmfPkg: Create a GHCB page for use during Sec phase
BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=2198
A GHCB page is needed during the Sec phase, so this new page must be
created. Since the #VC exception handler routines assume that a per-CPU
variable area is immediately after the GHCB, this per-CPU variable area
must also be created. Since the GHCB must be marked as an un-encrypted,
or shared, page, an additional pagetable page is required to break down
the 2MB region where the GHCB page lives into 4K pagetable entries.
Create a new entry in the OVMF memory layout for the new page table
page and for the SEC GHCB and per-CPU variable pages. After breaking down
the 2MB page, update the GHCB page table entry to remove the encryption
mask.
The GHCB page will be used by the SEC #VC exception handler. The #VC
exception handler will fill in the necessary fields of the GHCB and exit
to the hypervisor using the VMGEXIT instruction. The hypervisor then
accesses the GHCB in order to perform the requested function.
Four new fixed PCDs are needed to support the SEC GHCB page:
- PcdOvmfSecGhcbBase UINT32 value that is the base address of the
GHCB used during the SEC phase.
- PcdOvmfSecGhcbSize UINT32 value that is the size, in bytes, of the
GHCB area used during the SEC phase.
- PcdOvmfSecGhcbPageTableBase UINT32 value that is address of a page
table page used to break down the 2MB page into
512 4K pages.
- PcdOvmfSecGhcbPageTableSize UINT32 value that is the size, in bytes,
of the page table page.
Cc: Jordan Justen <jordan.l.justen@intel.com>
Cc: Laszlo Ersek <lersek@redhat.com>
Cc: Ard Biesheuvel <ard.biesheuvel@arm.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Signed-off-by: Tom Lendacky <thomas.lendacky@amd.com>
Regression-tested-by: Laszlo Ersek <lersek@redhat.com>
2020-08-12 22:21:40 +02:00
|
|
|
MdeModulePkg/MdeModulePkg.dec
|
2014-08-19 01:03:53 +02:00
|
|
|
UefiCpuPkg/UefiCpuPkg.dec
|
|
|
|
|
|
|
|
[BuildOptions]
|
|
|
|
*_*_IA32_NASMB_FLAGS = -I$(WORKSPACE)/UefiCpuPkg/ResetVector/Vtf0/
|
|
|
|
*_*_X64_NASMB_FLAGS = -I$(WORKSPACE)/UefiCpuPkg/ResetVector/Vtf0/
|
2016-11-04 14:32:39 +01:00
|
|
|
|
|
|
|
[Pcd]
|
2020-08-12 22:21:41 +02:00
|
|
|
gUefiCpuPkgTokenSpaceGuid.PcdSevEsWorkAreaBase
|
OvmfPkg: Create a GHCB page for use during Sec phase
BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=2198
A GHCB page is needed during the Sec phase, so this new page must be
created. Since the #VC exception handler routines assume that a per-CPU
variable area is immediately after the GHCB, this per-CPU variable area
must also be created. Since the GHCB must be marked as an un-encrypted,
or shared, page, an additional pagetable page is required to break down
the 2MB region where the GHCB page lives into 4K pagetable entries.
Create a new entry in the OVMF memory layout for the new page table
page and for the SEC GHCB and per-CPU variable pages. After breaking down
the 2MB page, update the GHCB page table entry to remove the encryption
mask.
The GHCB page will be used by the SEC #VC exception handler. The #VC
exception handler will fill in the necessary fields of the GHCB and exit
to the hypervisor using the VMGEXIT instruction. The hypervisor then
accesses the GHCB in order to perform the requested function.
Four new fixed PCDs are needed to support the SEC GHCB page:
- PcdOvmfSecGhcbBase UINT32 value that is the base address of the
GHCB used during the SEC phase.
- PcdOvmfSecGhcbSize UINT32 value that is the size, in bytes, of the
GHCB area used during the SEC phase.
- PcdOvmfSecGhcbPageTableBase UINT32 value that is address of a page
table page used to break down the 2MB page into
512 4K pages.
- PcdOvmfSecGhcbPageTableSize UINT32 value that is the size, in bytes,
of the page table page.
Cc: Jordan Justen <jordan.l.justen@intel.com>
Cc: Laszlo Ersek <lersek@redhat.com>
Cc: Ard Biesheuvel <ard.biesheuvel@arm.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Signed-off-by: Tom Lendacky <thomas.lendacky@amd.com>
Regression-tested-by: Laszlo Ersek <lersek@redhat.com>
2020-08-12 22:21:40 +02:00
|
|
|
gUefiOvmfPkgTokenSpaceGuid.PcdOvmfSecGhcbBase
|
|
|
|
gUefiOvmfPkgTokenSpaceGuid.PcdOvmfSecGhcbSize
|
|
|
|
gUefiOvmfPkgTokenSpaceGuid.PcdOvmfSecGhcbPageTableBase
|
|
|
|
gUefiOvmfPkgTokenSpaceGuid.PcdOvmfSecGhcbPageTableSize
|
2016-11-04 14:32:39 +01:00
|
|
|
gUefiOvmfPkgTokenSpaceGuid.PcdOvmfSecPageTablesBase
|
|
|
|
gUefiOvmfPkgTokenSpaceGuid.PcdOvmfSecPageTablesSize
|
2020-08-12 22:21:41 +02:00
|
|
|
gUefiOvmfPkgTokenSpaceGuid.PcdOvmfSecPeiTempRamBase
|
|
|
|
gUefiOvmfPkgTokenSpaceGuid.PcdOvmfSecPeiTempRamSize
|
2021-08-17 15:46:50 +02:00
|
|
|
gUefiOvmfPkgTokenSpaceGuid.PcdOvmfWorkAreaBase
|
2021-09-28 04:47:29 +02:00
|
|
|
gUefiOvmfPkgTokenSpaceGuid.PcdOvmfWorkAreaSize
|
|
|
|
gUefiOvmfPkgTokenSpaceGuid.PcdOvmfSecGhcbBackupBase
|
|
|
|
gUefiOvmfPkgTokenSpaceGuid.PcdOvmfSecGhcbBackupSize
|
|
|
|
gUefiOvmfPkgTokenSpaceGuid.PcdCfvBase
|
|
|
|
gUefiOvmfPkgTokenSpaceGuid.PcdCfvRawDataOffset
|
|
|
|
gUefiOvmfPkgTokenSpaceGuid.PcdCfvRawDataSize
|
|
|
|
gUefiOvmfPkgTokenSpaceGuid.PcdBfvBase
|
|
|
|
gUefiOvmfPkgTokenSpaceGuid.PcdBfvRawDataOffset
|
|
|
|
gUefiOvmfPkgTokenSpaceGuid.PcdBfvRawDataSize
|
2020-11-30 21:28:17 +01:00
|
|
|
|
|
|
|
[FixedPcd]
|
|
|
|
gUefiOvmfPkgTokenSpaceGuid.PcdSevLaunchSecretBase
|
|
|
|
gUefiOvmfPkgTokenSpaceGuid.PcdSevLaunchSecretSize
|
2021-01-16 23:42:44 +01:00
|
|
|
gUefiOvmfPkgTokenSpaceGuid.PcdQemuHashTableBase
|
|
|
|
gUefiOvmfPkgTokenSpaceGuid.PcdQemuHashTableSize
|