|
TianoCore EDK2 master
|
#include <Library/BaseLib.h>#include <Library/DebugLib.h>#include "CcExitTd.h"#include <Library/CcExitLib.h>#include <Library/BaseMemoryLib.h>#include <IndustryStandard/Tdx.h>#include <IndustryStandard/InstructionParsing.h>#include "CcInstruction.h"Go to the source code of this file.
Data Structures | |
| union | MSR_DATA |
| union | REX |
| union | MODRM |
| struct | CPUID_DATA |
| struct | MMIO_EXIT_PARSED_INSTRUCTION |
Macros | |
| #define | TDX_MMIO_READ 0 |
| #define | TDX_MMIO_WRITE 1 |
| #define | TDX_DECODER_BUG_ON(x) |
Copyright (c) 2021, Intel Corporation. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent
Definition in file CcExitVeHandler.c.
| #define TDX_DECODER_BUG_ON | ( | x | ) |
Definition at line 238 of file CcExitVeHandler.c.
| #define TDX_MMIO_READ 0 |
Definition at line 18 of file CcExitVeHandler.c.
| #define TDX_MMIO_WRITE 1 |
Definition at line 19 of file CcExitVeHandler.c.
| EFI_STATUS EFIAPI CcExitHandleVe | ( | IN OUT EFI_EXCEPTION_TYPE * | ExceptionType, |
| IN OUT EFI_SYSTEM_CONTEXT | SystemContext | ||
| ) |
Handle a #VE exception.
Performs the necessary processing to handle a #VE exception.
| [in,out] | ExceptionType | Pointer to an EFI_EXCEPTION_TYPE to be set as value to use on error. |
| [in,out] | SystemContext | Pointer to EFI_SYSTEM_CONTEXT |
| EFI_SUCCESS | Exception handled |
| EFI_UNSUPPORTED | #VE not supported, (new) exception value to propagate provided |
| EFI_PROTOCOL_ERROR | #VE handling failed, (new) exception value to propagate provided |
Definition at line 684 of file CcExitVeHandler.c.
| STATIC UINT64 EFIAPI CpuIdExit | ( | IN EFI_SYSTEM_CONTEXT_X64 * | Regs, |
| IN TDCALL_VEINFO_RETURN_DATA * | Veinfo | ||
| ) |
Handle an CPUID event.
Use the TDVMCALL instruction to handle cpuid #ve
| [in,out] | Regs | x64 processor context |
| [in] | Veinfo | VE Info |
| 0 | Event handled successfully |
Definition at line 66 of file CcExitVeHandler.c.
| STATIC UINT64 EFIAPI IoExit | ( | IN OUT EFI_SYSTEM_CONTEXT_X64 * | Regs, |
| IN TDCALL_VEINFO_RETURN_DATA * | Veinfo | ||
| ) |
Handle an IO event.
Use the TDVMCALL instruction to handle either an IO read or an IO write.
| [in,out] | Regs | x64 processor context |
| [in] | Veinfo | VE Info |
| 0 | Event handled successfully |
Definition at line 100 of file CcExitVeHandler.c.
| STATIC UINT64 EFIAPI MmioExit | ( | IN OUT EFI_SYSTEM_CONTEXT_X64 * | Regs, |
| IN TDCALL_VEINFO_RETURN_DATA * | Veinfo | ||
| ) |
Handle an MMIO event.
Use the TDVMCALL instruction to handle either an mmio read or an mmio write.
| [in,out] | Regs | x64 processor context |
| [in] | Veinfo | VE Info |
| 0 | Event handled successfully |
Definition at line 590 of file CcExitVeHandler.c.
| STATIC EFI_STATUS ParseMmioExitInstructions | ( | IN OUT EFI_SYSTEM_CONTEXT_X64 * | Regs, |
| IN OUT CC_INSTRUCTION_DATA * | InstructionData, | ||
| OUT MMIO_EXIT_PARSED_INSTRUCTION * | ParsedInstruction | ||
| ) |
Parse the MMIO instructions.
| Regs | Pointer to the EFI_SYSTEM_CONTEXT_X64 which includes the instructions |
| InstructionData | Pointer to the CC_INSTRUCTION_DATA |
| ParsedInstruction | Pointer to the parsed instruction data |
| EFI_SUCCESS | Successfully parsed the instructions |
| Others | Other error as indicated |
Definition at line 314 of file CcExitVeHandler.c.
| STATIC UINT64 ReadMsrExit | ( | IN OUT EFI_SYSTEM_CONTEXT_X64 * | Regs, |
| IN TDCALL_VEINFO_RETURN_DATA * | Veinfo | ||
| ) |
Handle an READ MSR event.
Use the TDVMCALL instruction to handle msr read
| [in,out] | Regs | x64 processor context |
| [in] | Veinfo | VE Info |
| 0 | Event handled successfully |
Definition at line 174 of file CcExitVeHandler.c.
Definition at line 223 of file CcExitVeHandler.c.
| STATIC EFI_STATUS TdxMmioReadWrite | ( | IN UINT32 | MmioSize, |
| IN UINT32 | ReadOrWrite, | ||
| IN UINT64 | GuestPA, | ||
| IN UINT64 * | Val | ||
| ) |
Tdx MMIO access via TdVmcall.
| MmioSize | Size of the MMIO access |
| ReadOrWrite | Read or write operation |
| GuestPA | Guest physical address |
| Val | Pointer to the value which is read or written |
| EFI_SUCCESS | Successfully access the mmio |
| Others | Other errors as indicated |
Definition at line 258 of file CcExitVeHandler.c.
| STATIC UINT64 WriteMsrExit | ( | IN OUT EFI_SYSTEM_CONTEXT_X64 * | Regs, |
| IN TDCALL_VEINFO_RETURN_DATA * | Veinfo | ||
| ) |
Handle an WRITE MSR event.
Use the TDVMCALL instruction to handle msr write
| [in,out] | Regs | x64 processor context |
| [in] | Veinfo | VE Info |
| 0 | Event handled successfully |
Definition at line 204 of file CcExitVeHandler.c.