gctx

package
v0.0.0-...-560a60b Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 8, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

- Guest Context (GCTX). - VM Save Area (VMSA). - Reverse Map Table (RMP). - Guest Physical Address (GPA).

Index

Constants

View Source
const (
	VMSA_GPA  = 0xFFFFFFFFF000
	LD_SIZE   = sha512.Size384
	PAGE_SIZE = 4096
)

Variables

This section is empty.

Functions

This section is empty.

Types

type GCTX

type GCTX struct {
	// contains filtered or unexported fields
}

GCTX represents a SNP Guest Context. VMSA page is recorded in the RMP table with GPA (u64)(-1). However, the address is page-aligned, and also all the bits above 51 are cleared.

func New

func New(seed []byte) *GCTX

func (*GCTX) LD

func (g *GCTX) LD() []byte

LD returns the launch digest of the guest.

func (*GCTX) UpdateCpuidPage

func (g *GCTX) UpdateCpuidPage(gpa uint64) error

UpdateSecretsPage extends the current launch digest with the hash of a page containing only zeros. Pagetype is set to 0x06.

func (*GCTX) UpdateNormalPages

func (g *GCTX) UpdateNormalPages(startGpa uint64, data []byte) error

UpdateNormalPages extends the current launch digest with the hash of data. The hash is generated page by page. Pagetype is set to 0x01.

func (*GCTX) UpdateSecretsPage

func (g *GCTX) UpdateSecretsPage(gpa uint64) error

UpdateSecretsPage extends the current launch digest with the hash of a page containing only zeros. Pagetype is set to 0x05.

func (*GCTX) UpdateVmsaPage

func (g *GCTX) UpdateVmsaPage(data []byte) error

func (*GCTX) UpdateZeroPages

func (g *GCTX) UpdateZeroPages(gpa uint64, lengthBytes int) error

UpdateZeroPages extends the current launch digest with the hash of a page containing only zeros. Pagetype is set to 0x03.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL