TianoCore EDK2 master
Loading...
Searching...
No Matches
CcInstruction.h File Reference
#include <Base.h>
#include <Uefi.h>
#include <Register/Amd/Ghcb.h>
#include <IndustryStandard/InstructionParsing.h>
#include <Protocol/DebugSupport.h>

Go to the source code of this file.

Data Structures

struct  CC_INSTRUCTION_MODRM_EXT
 
struct  CC_INSTRUCTION_SIB_EXT
 
struct  CC_INSTRUCTION_OPCODE_EXT
 
struct  CC_INSTRUCTION_DATA
 

Enumerations

enum  CC_INSTRUCTION_MODE { LongMode64Bit = 0 , LongModeCompat32Bit , LongModeCompat16Bit }
 
enum  CC_INSTRUCTION_SIZE { Size8Bits = 0 , Size16Bits , Size32Bits , Size64Bits }
 
enum  CC_INSTRUCTION_SEGMENT {
  SegmentEs = 0 , SegmentCs , SegmentSs , SegmentDs ,
  SegmentFs , SegmentGs
}
 
enum  CC_INSTRUCTION_REP { RepNone = 0 , RepZ , RepNZ }
 

Functions

EFI_STATUS CcInitInstructionData (IN OUT CC_INSTRUCTION_DATA *InstructionData, IN GHCB *Ghcb, IN EFI_SYSTEM_CONTEXT_X64 *Regs)
 
UINT64 * CcGetRegisterPointer (IN EFI_SYSTEM_CONTEXT_X64 *Regs, IN UINT8 Register)
 
VOID CcDecodeModRm (IN EFI_SYSTEM_CONTEXT_X64 *Regs, IN OUT CC_INSTRUCTION_DATA *InstructionData)
 
UINT64 CcInstructionLength (IN CC_INSTRUCTION_DATA *InstructionData)
 

Detailed Description

Confidential Computing X64 Instruction

Copyright (C) 2020, Advanced Micro Devices, Inc. All rights reserved.
Copyright (c) 2022, Intel Corporation. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent

Definition in file CcInstruction.h.

Enumeration Type Documentation

◆ CC_INSTRUCTION_MODE

enum CC_INSTRUCTION_MODE

Definition at line 22 of file CcInstruction.h.

◆ CC_INSTRUCTION_REP

enum CC_INSTRUCTION_REP

Definition at line 53 of file CcInstruction.h.

◆ CC_INSTRUCTION_SEGMENT

enum CC_INSTRUCTION_SEGMENT

Definition at line 41 of file CcInstruction.h.

◆ CC_INSTRUCTION_SIZE

enum CC_INSTRUCTION_SIZE

Definition at line 31 of file CcInstruction.h.

Function Documentation

◆ CcDecodeModRm()

VOID CcDecodeModRm ( IN EFI_SYSTEM_CONTEXT_X64 Regs,
IN OUT CC_INSTRUCTION_DATA InstructionData 
)

Decode a ModRM byte.

Examine the instruction parsing context to decode a ModRM byte and the SIB byte, if present.

Parameters
[in]Regsx64 processor context
[in,out]InstructionDataInstruction parsing context

Definition at line 245 of file CcInstruction.c.

◆ CcGetRegisterPointer()

UINT64 * CcGetRegisterPointer ( IN EFI_SYSTEM_CONTEXT_X64 Regs,
IN UINT8  Register 
)

Return a pointer to the contents of the specified register.

Based upon the input register, return a pointer to the registers contents in the x86 processor context.

Parameters
[in]Regsx64 processor context
[in]RegisterRegister to obtain pointer for
Returns
Pointer to the contents of the requested register

Definition at line 31 of file CcInstruction.c.

◆ CcInitInstructionData()

EFI_STATUS CcInitInstructionData ( IN OUT CC_INSTRUCTION_DATA InstructionData,
IN GHCB *  Ghcb,
IN EFI_SYSTEM_CONTEXT_X64 Regs 
)

Initialize the instruction parsing context.

Initialize the instruction parsing context, which includes decoding the instruction prefixes.

Parameters
[in,out]InstructionDataInstruction parsing context
[in]GhcbPointer to the Guest-Hypervisor Communication Block
[in]Regsx64 processor context
Return values
EFI_SUCCESSSuccessfully initialize InstructionData
OthersOther error as indicated

Definition at line 442 of file CcInstruction.c.

◆ CcInstructionLength()

UINT64 CcInstructionLength ( IN CC_INSTRUCTION_DATA InstructionData)

Determine instruction length

Return the total length of the parsed instruction.

Parameters
[in]InstructionDataInstruction parsing context
Returns
Length of parsed instruction

Definition at line 420 of file CcInstruction.c.