test

package
v2.6.1 Latest Latest
Warning

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

Go to latest
Published: Nov 30, 2021 License: BSD-3-Clause Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	//IntelFITSpecificationTitle the title of Intel FIT BIOS Specification
	IntelFITSpecificationTitle = "Firmware Interface Table BIOS Specification"
	//IntelFITSpecificationDocumentID the document ID of Intel FIT BIOS Specification
	IntelFITSpecificationDocumentID = "599500 Revision 1.2"

	//IntelTXTBGSBIOSSpecificationTitle the title of Intel TXT&BG Server BIOS Specification
	IntelTXTBGSBIOSSpecificationTitle = "Intel Trusted Execution Technology and Boot Guard Server BIOS Specification"
	//IntelTXTBGSBIOSSpecificationDocumentID the document ID of Intel TXT&BG Server BIOS Specification
	IntelTXTBGSBIOSSpecificationDocumentID = "558294 Revision 2.0"

	//IntelTXTSpecificationTitle the title of Intel TXT Specification
	IntelTXTSpecificationTitle = "Intel Trusted Execution Technology (Intel TXT)"
	//IntelTXTSpecificationDocumentID the document ID of Intel TXT Specification
	IntelTXTSpecificationDocumentID = "315168-016"

	//ServerGrantleyPlatformSpecificationTitle is the title of the ACM_Errors.xls
	ServerGrantleyPlatformSpecificationTitle = "TXT error description file for Server Grantley Platform"
	//ServerGrantleyPlatformDocumentID is an empty string
	ServerGrantleyPlatformDocumentID = ""

	//CBtGTXTPlatformSpecificationTitle is the title of the ACM_Errors.xls
	CBtGTXTPlatformSpecificationTitle = "TXT error description file for Converged BtG / TXT  platform"
	//CBtGTXTPlatformDocumentID is an empty string
	CBtGTXTPlatformDocumentID = ""

	//ACPISpecificationTitle is the title of the ACPI spec
	ACPISpecificationTitle = "Advanced Configuration and PowerInterface (ACPI) Specification 6.3"
	//ACPISpecificationDocumentID s an empty string
	ACPISpecificationDocumentID = ""
)
View Source
const FITSize int64 = 16 * 1024 * 1024

FITSize 16MiB

View Source
const FITVector = 0xFFFFFFC0

FITVector is the FIT Vector address

View Source
const FourGiB = 0x100000000

FourGiB 4Gigabyte

View Source
const ResetVector = 0xFFFFFFF0

ResetVector is the reset vector address

View Source
const ValidFitRange = 0xFF000000

ValidFitRange is the size of a correct FIT

Variables

View Source
var (

	// TestsACPI exports the Slice with ACPI tests
	TestsACPI = [...]*Test{
		&testRSDPChecksum,
		&testMCFGPresent,
		&testDMARPresent,
		&testDMARValid,
		&testMADTPresent,
		&testMADTValid,
		&testRSDTPresent,
		&testRSDTValid,
		&testXSDTPresent,
		&testXSDTValid,
		&testRSDTorXSDTValid,
	}
)

nolint

View Source
var (

	// TestsCPU exports slice with CPU related tests
	TestsCPU = [...]*Test{
		&testcheckforintelcpu,
		&testwaybridgeorlater,
		&testcpusupportstxt,
		&testtxtregisterspaceaccessible,
		&testsupportssmx,
		&testsupportvmx,
		&testia32featurectrl,
		&testtxtnotdisabled,
		&testibbmeasured,
		&testibbistrusted,
		&testtxtregisterslocked,
		&testia32debuginterfacelockeddisabled,
	}
)

nolint

View Source
var (

	// TestsFIT exports the Slice with FIT tests
	TestsFIT = [...]*Test{
		&testfitvectorisset,
		&testhasfit,
		&testhasmcupdate,
		&testhasbiosacm,
		&testhasibb,
		&testhaslcpTest,
		&testibbcoversresetvector,
		&testibbcoversfitvector,
		&testibbcoversfit,
		&testnoibboverlap,
		&testnobiosacmoverlap,
		&testnobiosacmisbelow4g,
		&testpolicyallowstxt,
		&testbiosacmvalid,
		&testbiosacmsizecorrect,
		&testbiosacmaligmentcorrect,
		&testbiosacmmatcheschipset,
		&testbiosacmmatchescpu,
		&testacmsfornpw,
		&testsinitacmupporttpm,
	}
)
View Source
var TestsLegacy = []*Test{

	&testcheckforintelcpu,
	&testwaybridgeorlater,
	&testcpusupportstxt,
	&testtxtregisterspaceaccessible,
	&testsupportssmx,
	&testsupportvmx,
	&testia32featurectrl,
	&testtxtnotdisabled,
	&testtxtregisterslocked,
	&testia32debuginterfacelockeddisabled,
	&testibbmeasured,

	&testtxtmemoryrangevalid,
	&testmemoryisreserved,
	&testtxtmemoryisdpr,
	&testtxtdprislocked,
	&testsinitintxt,
	&testsinitmatcheschipset,
	&testsinitmatchescpu,
	&testbiosdataregionpresent,
	&testbiosdataregionvalid,
	&testhasmtrr,
	&testhassmrr,
	&testvalidsmrr,
	&testactivesmrr,

	&testfitvectorisset,
	&testhasfit,
	&testhasbiosacm,
	&testhasibb,
	&testhaslcpTest,
	&testibbcoversresetvector,
	&testibbcoversfitvector,
	&testibbcoversfit,
	&testnoibboverlap,
	&testnobiosacmoverlap,
	&testnobiosacmisbelow4g,
	&testpolicyallowstxt,
	&testbiosacmvalid,
	&testbiosacmsizecorrect,
	&testbiosacmaligmentcorrect,
	&testbiosacmmatcheschipset,
	&testbiosacmmatchescpu,

	&testtpmconnection,
	&testtpmispresent,
	&testpsindexconfig,
	&testauxindexconfig,
	&testpsindexissvalid,
	&testpcr00valid,
}

TestsLegacy - Summarizes all test for TXT (not CBnT) platforms

View Source
var (

	// TestsMemory exposes the slice for memory related txt tests
	TestsMemory = [...]*Test{
		&testtxtmemoryrangevalid,
		&testtxtpublicisreserved,
		&testtxtprivateisreserved,
		&testmemoryisreserved,
		&testtpmdecodereserved,
		&testtxtmemoryisdpr,
		&testtxtdprislocked,
		&testhostbridgeDPRcorrect,
		&testhostbridgeDPRislocked,
		&testsinitintxt,
		&testsinitmatcheschipset,
		&testsinitmatchescpu,
		&testnosiniterrors,
		&testbiosdataregionpresent,
		&testbiosdataregionvalid,
		&testhasmtrr,
		&testhassmrr,
		&testvalidsmrr,
		&testactivesmrr,
		&testactiveiommu,
		&testservermodetext,
	}
)
View Source
var TestsTBoot = []*Test{
	&testactiveiommu,
	&testnosiniterrors,
	&testibbistrusted,
	&testhostbridgeDPRcorrect,
	&testhostbridgeDPRislocked,
}

TestsTBoot - Summarizes all test for the tboot hypervisor

View Source
var (

	// TestsTPM exposes the slice of pointers to tests regarding tpm functionality for txt
	TestsTPM = [...]*Test{
		&testtpmconnection,
		&testtpmispresent,
		&testtpmnvramislocked,
		&testpsindexconfig,
		&testauxindexconfig,
		&testauxindexhashdata,
		&testpoindexconfig,
		&testpsindexissvalid,
		&testpoindexissvalid,
		&testpcr00valid,
		&testpsnpwmodenotactive,
		&testtxtmodvalid,
	}
)
View Source
var TestsTXTReady = []*Test{

	&testcheckforintelcpu,
	&testwaybridgeorlater,
	&testcpusupportstxt,
	&testtxtregisterspaceaccessible,
	&testsupportssmx,
	&testsupportvmx,
	&testia32featurectrl,
	&testtxtnotdisabled,
	&testtxtregisterslocked,
	&testia32debuginterfacelockeddisabled,

	&testtxtmemoryrangevalid,
	&testmemoryisreserved,
	&testtxtmemoryisdpr,
	&testtxtdprislocked,
	&testhostbridgeDPRcorrect,
	&testhostbridgeDPRislocked,
	&testsinitintxt,
	&testsinitmatcheschipset,
	&testsinitmatchescpu,
	&testbiosdataregionpresent,
	&testbiosdataregionvalid,
	&testhasmtrr,
	&testhassmrr,
	&testvalidsmrr,
	&testactivesmrr,

	&testtpmconnection,
	&testtpmnvramislocked,
	&testauxindexconfig,
}

TestsTXTReady - Summarizes all test for TXT Ready platforms

View Source
var TestsUEFI = []*Test{

	&testRSDPChecksum,
	&testMCFGPresent,
	&testDMARPresent,
	&testDMARValid,
	&testMADTPresent,
	&testMADTValid,
	&testRSDTPresent,
	&testRSDTValid,
	&testXSDTPresent,
	&testXSDTValid,
	&testRSDTorXSDTValid,
}

TestsUEFI - Summarizes all test for TXT UEFI boot

Functions

func AUXIndexConfig

func AUXIndexConfig(txtAPI hwapi.LowLevelHardwareInterfaces, config *tools.Configuration) (bool, error, error)

AUXIndexConfig tests if the AUX Index has the correct configuration

func AUXTPM2IndexCheckHash

func AUXTPM2IndexCheckHash(txtAPI hwapi.LowLevelHardwareInterfaces, config *tools.Configuration) (bool, error, error)

AUXTPM2IndexCheckHash checks the PolicyHash of AUX index

func ActiveIOMMU

func ActiveIOMMU(txtAPI hwapi.LowLevelHardwareInterfaces, config *tools.Configuration) (bool, error, error)

ActiveIOMMU checks if IOMMU is active

func ActiveSMRR

func ActiveSMRR(txtAPI hwapi.LowLevelHardwareInterfaces, config *tools.Configuration) (bool, error, error)

ActiveSMRR checks if SMMR is set active

func BIOSACMAlignmentCorrect

func BIOSACMAlignmentCorrect(txtAPI hwapi.LowLevelHardwareInterfaces, _ *tools.Configuration) (bool, error, error)

BIOSACMAlignmentCorrect checks if BIOS ACM alignment is correct

func BIOSACMIsBelow4G

func BIOSACMIsBelow4G(txtAPI hwapi.LowLevelHardwareInterfaces, config *tools.Configuration) (bool, error, error)

BIOSACMIsBelow4G checks if BIOS ACM is below 4Gb (has a valid address)

func BIOSACMMatchesCPU

func BIOSACMMatchesCPU(txtAPI hwapi.LowLevelHardwareInterfaces, config *tools.Configuration) (bool, error, error)

BIOSACMMatchesCPU checks if BIOS ACM matches CPU

func BIOSACMMatchesChipset

func BIOSACMMatchesChipset(txtAPI hwapi.LowLevelHardwareInterfaces, config *tools.Configuration) (bool, error, error)

BIOSACMMatchesChipset checks if BIOS ACM matches chipset

func BIOSACMSizeCorrect

func BIOSACMSizeCorrect(txtAPI hwapi.LowLevelHardwareInterfaces, _ *tools.Configuration) (bool, error, error)

BIOSACMSizeCorrect checks if BIOS ACM size is correct

func BIOSACMValid

func BIOSACMValid(txtAPI hwapi.LowLevelHardwareInterfaces, _ *tools.Configuration) (bool, error, error)

BIOSACMValid checks if BIOS ACM is valid

func BIOSDATAREGIONPresent

func BIOSDATAREGIONPresent(txtAPI hwapi.LowLevelHardwareInterfaces, config *tools.Configuration) (bool, error, error)

BIOSDATAREGIONPresent checks is the BIOSDATA Region is present in TXT Register Space

func BIOSDATAREGIONValid

func BIOSDATAREGIONValid(txtAPI hwapi.LowLevelHardwareInterfaces, config *tools.Configuration) (bool, error, error)

BIOSDATAREGIONValid checks if the BIOSDATA Region in TXT Register Space is valid

func CPUSupportsTXT

func CPUSupportsTXT(txtAPI hwapi.LowLevelHardwareInterfaces, config *tools.Configuration) (bool, error, error)

CPUSupportsTXT Check if the CPU supports TXT

func CheckDMARPresence

func CheckDMARPresence(txtAPI hwapi.LowLevelHardwareInterfaces, config *tools.Configuration) (bool, error, error)

CheckDMARPresence tests if the MADT ACPI table exists

func CheckDMARValid

func CheckDMARValid(txtAPI hwapi.LowLevelHardwareInterfaces, config *tools.Configuration) (bool, error, error)

CheckDMARValid tests if the DMAR ACPI table is valid

func CheckForIntelCPU

func CheckForIntelCPU(txtAPI hwapi.LowLevelHardwareInterfaces, config *tools.Configuration) (bool, error, error)

CheckForIntelCPU Check we're running on a Intel CPU

func CheckMADTPresence

func CheckMADTPresence(txtAPI hwapi.LowLevelHardwareInterfaces, config *tools.Configuration) (bool, error, error)

CheckMADTPresence tests if the MADT ACPI table exists

func CheckMADTValid

func CheckMADTValid(txtAPI hwapi.LowLevelHardwareInterfaces, config *tools.Configuration) (bool, error, error)

CheckMADTValid tests if the MADT ACPI table is valid

func CheckMCFGPresence

func CheckMCFGPresence(txtAPI hwapi.LowLevelHardwareInterfaces, config *tools.Configuration) (bool, error, error)

CheckMCFGPresence tests if the MCFG ACPI table exists

func CheckRSDPValid

func CheckRSDPValid(txtAPI hwapi.LowLevelHardwareInterfaces, config *tools.Configuration) (bool, error, error)

CheckRSDPValid tests if the RSDP ACPI table is vaid

func CheckRSDTPresent

func CheckRSDTPresent(txtAPI hwapi.LowLevelHardwareInterfaces, config *tools.Configuration) (bool, error, error)

CheckRSDTPresent tests if the RSDT ACPI table is present

func CheckRSDTValid

func CheckRSDTValid(txtAPI hwapi.LowLevelHardwareInterfaces, config *tools.Configuration) (bool, error, error)

CheckRSDTValid tests if the RSDT ACPI table is valid

func CheckRSDTorXSDTValid

func CheckRSDTorXSDTValid(txtAPI hwapi.LowLevelHardwareInterfaces, config *tools.Configuration) (bool, error, error)

CheckRSDTorXSDTValid tests if the RSDT or XSDT ACPI table is valid

func CheckXSDTPresent

func CheckXSDTPresent(txtAPI hwapi.LowLevelHardwareInterfaces, config *tools.Configuration) (bool, error, error)

CheckXSDTPresent tests if the XSDT ACPI table is present

func CheckXSDTValid

func CheckXSDTValid(txtAPI hwapi.LowLevelHardwareInterfaces, config *tools.Configuration) (bool, error, error)

CheckXSDTValid tests if the XSDT ACPI table is valid

func FITVectorIsSet

func FITVectorIsSet(txtAPI hwapi.LowLevelHardwareInterfaces, config *tools.Configuration) (bool, error, error)

FITVectorIsSet checks if the FIT Vector is set

func HasBIOSACM

func HasBIOSACM(txtAPI hwapi.LowLevelHardwareInterfaces, config *tools.Configuration) (bool, error, error)

HasBIOSACM checks if FIT table has BIOSACM entry

func HasBIOSPolicy

func HasBIOSPolicy(txtAPI hwapi.LowLevelHardwareInterfaces, config *tools.Configuration) (bool, error, error)

HasBIOSPolicy checks if FIT table has ONE BIOS Policy Data Record Entry

func HasFIT

HasFIT checks if the FIT is present

func HasIBB

HasIBB checks if FIT table has BIOS Startup Module entry

func HasMTRR

func HasMTRR(txtAPI hwapi.LowLevelHardwareInterfaces, config *tools.Configuration) (bool, error, error)

HasMTRR checks if MTRR is supported by CPU

func HasMicroCode

func HasMicroCode(txtAPI hwapi.LowLevelHardwareInterfaces, config *tools.Configuration) (bool, error, error)

HasMicroCode checks if FIT table indicates a Microcode update for the CPU

func HasSMRR

func HasSMRR(txtAPI hwapi.LowLevelHardwareInterfaces, config *tools.Configuration) (bool, error, error)

HasSMRR checks if SMRR is supported

func HostbridgeDPRCorrect

func HostbridgeDPRCorrect(txtAPI hwapi.LowLevelHardwareInterfaces, config *tools.Configuration) (bool, error, error)

HostbridgeDPRCorrect checks if TXT DPR equals PCI Hostbridge DPR

func HostbridgeDPRisLocked

func HostbridgeDPRisLocked(txtAPI hwapi.LowLevelHardwareInterfaces, config *tools.Configuration) (bool, error, error)

HostbridgeDPRisLocked checks if the Hostbridge DPR is marked as locked

func HostbridgeIsSupported

func HostbridgeIsSupported(txtAPI hwapi.LowLevelHardwareInterfaces, config *tools.Configuration) (bool, error, error)

HostbridgeIsSupported checks if the suite supports the hostbridge

func IA32DebugInterfaceLockedDisabled

func IA32DebugInterfaceLockedDisabled(txtAPI hwapi.LowLevelHardwareInterfaces, config *tools.Configuration) (bool, error, error)

IA32DebugInterfaceLockedDisabled checks if IA32 debug interface is locked

func IBBCoversFIT

func IBBCoversFIT(txtAPI hwapi.LowLevelHardwareInterfaces, config *tools.Configuration) (bool, error, error)

IBBCoversFIT checks if BIOS Startup Module Entry covers FIT table

func IBBCoversFITVector

func IBBCoversFITVector(txtAPI hwapi.LowLevelHardwareInterfaces, config *tools.Configuration) (bool, error, error)

IBBCoversFITVector checks if BIOS Startup Module Entry covers FIT vector

func IBBCoversResetVector

func IBBCoversResetVector(txtAPI hwapi.LowLevelHardwareInterfaces, config *tools.Configuration) (bool, error, error)

IBBCoversResetVector checks if BIOS Startup Module Entry covers Reset Vector

func IBBIsTrusted

func IBBIsTrusted(txtAPI hwapi.LowLevelHardwareInterfaces, config *tools.Configuration) (bool, error, error)

IBBIsTrusted Check that the IBB was deemed trusted Only set in Signed Policy mode

func IBBMeasured

func IBBMeasured(txtAPI hwapi.LowLevelHardwareInterfaces, config *tools.Configuration) (bool, error, error)

IBBMeasured Verify that the IBB has been measured

func Ia32FeatureCtrl

func Ia32FeatureCtrl(txtAPI hwapi.LowLevelHardwareInterfaces, config *tools.Configuration) (bool, error, error)

Ia32FeatureCtrl Check IA_32FEATURE_CONTROL

func NPWModeIsNotSetInPS

func NPWModeIsNotSetInPS(txtAPI hwapi.LowLevelHardwareInterfaces, config *tools.Configuration) (bool, error, error)

NPWModeIsNotSetInPS checks if NPW is activated or not

func NoBIOSACMErrors

func NoBIOSACMErrors(txtAPI hwapi.LowLevelHardwareInterfaces, config *tools.Configuration) (bool, error, error)

NoBIOSACMErrors Check that the BIOS ACM has no startup error

func NoBIOSACMOverlap

func NoBIOSACMOverlap(txtAPI hwapi.LowLevelHardwareInterfaces, config *tools.Configuration) (bool, error, error)

NoBIOSACMOverlap checks if BIOS ACM Entries Overlap

func NoIBBOverlap

func NoIBBOverlap(txtAPI hwapi.LowLevelHardwareInterfaces, config *tools.Configuration) (bool, error, error)

NoIBBOverlap checks if BIOS Startup Module Entries overlap

func NoSINITErrors

func NoSINITErrors(txtAPI hwapi.LowLevelHardwareInterfaces, config *tools.Configuration) (bool, error, error)

NoSINITErrors checks if the SINITACM was executed without any errors

func PCR0IsSet

func PCR0IsSet(txtAPI hwapi.LowLevelHardwareInterfaces, config *tools.Configuration) (bool, error, error)

PCR0IsSet Reads PCR-00 and checks whether if it's not the EmptyDigest

func POIndexConfig

func POIndexConfig(txtAPI hwapi.LowLevelHardwareInterfaces, config *tools.Configuration) (bool, error, error)

POIndexConfig checks the PO index configuration

func POIndexHasValidLCP

func POIndexHasValidLCP(txtAPI hwapi.LowLevelHardwareInterfaces, config *tools.Configuration) (bool, error, error)

POIndexHasValidLCP checks if PO Index holds a valid LCP

func PSIndexConfig

func PSIndexConfig(txtAPI hwapi.LowLevelHardwareInterfaces, config *tools.Configuration) (bool, error, error)

PSIndexConfig tests if PS Index has correct configuration

func PSIndexHasValidLCP

func PSIndexHasValidLCP(txtAPI hwapi.LowLevelHardwareInterfaces, config *tools.Configuration) (bool, error, error)

PSIndexHasValidLCP checks if PS Index has a valid LCP

func PolicyAllowsTXT

func PolicyAllowsTXT(txtAPI hwapi.LowLevelHardwareInterfaces, config *tools.Configuration) (bool, error, error)

PolicyAllowsTXT checks if Record matches TXT requirements.

func ReleaseFusedFSBI

func ReleaseFusedFSBI(txtAPI hwapi.LowLevelHardwareInterfaces, config *tools.Configuration) (bool, error, error)

ReleaseFusedFSBI checks if the FSBI is release fused

func RunTestsSilent

func RunTestsSilent(TxtAPI hwapi.LowLevelHardwareInterfaces, config *tools.Configuration, Tests []*Test) (bool, string, error)

RunTestsSilent Runs the specified tests and returns false on the first error encountered

func SINITACMcomplyTPMSpec

func SINITACMcomplyTPMSpec(txtAPI hwapi.LowLevelHardwareInterfaces, config *tools.Configuration) (bool, error, error)

SINITACMcomplyTPMSpec tests if the SINIT ACM complys with used TPM

func SINITInTXT

func SINITInTXT(txtAPI hwapi.LowLevelHardwareInterfaces, config *tools.Configuration) (bool, error, error)

SINITInTXT checks the TXT region on containing a valid SINIT ACM.

func SINITMatchesCPU

func SINITMatchesCPU(txtAPI hwapi.LowLevelHardwareInterfaces, config *tools.Configuration) (bool, error, error)

SINITMatchesCPU checks if the SINITACM matches the CPU

func SINITMatchesChipset

func SINITMatchesChipset(txtAPI hwapi.LowLevelHardwareInterfaces, config *tools.Configuration) (bool, error, error)

SINITMatchesChipset checks if the SINIT ACM matches the chipset.

func SINITandBIOSACMnoNPW

func SINITandBIOSACMnoNPW(txtAPI hwapi.LowLevelHardwareInterfaces, config *tools.Configuration) (bool, error, error)

SINITandBIOSACMnoNPW checks that in BIOS integrated ACMs (SINIT, BIOS) are production worthy

func SMXIsEnabled

func SMXIsEnabled(txtAPI hwapi.LowLevelHardwareInterfaces, config *tools.Configuration) (bool, error, error)

SMXIsEnabled not implemented

func ServerModeTXT

func ServerModeTXT(txtAPI hwapi.LowLevelHardwareInterfaces, config *tools.Configuration) (bool, error, error)

ServerModeTXT checks if TXT runs in Servermode

func SupportVMX

func SupportVMX(txtAPI hwapi.LowLevelHardwareInterfaces, config *tools.Configuration) (bool, error, error)

SupportVMX Check if CPU supports VMX

func SupportsSMX

func SupportsSMX(txtAPI hwapi.LowLevelHardwareInterfaces, config *tools.Configuration) (bool, error, error)

SupportsSMX Check if CPU supports SMX

func TPMConnect

func TPMConnect(txtAPI hwapi.LowLevelHardwareInterfaces, config *tools.Configuration) (bool, error, error)

TPMConnect Connects to a TPM device (virtual or real)

func TPMIsPresent

func TPMIsPresent(txtAPI hwapi.LowLevelHardwareInterfaces, config *tools.Configuration) (bool, error, error)

TPMIsPresent validates if one of the two previous tests succeeded

func TPMNVRAMIsLocked

func TPMNVRAMIsLocked(txtAPI hwapi.LowLevelHardwareInterfaces, config *tools.Configuration) (bool, error, error)

TPMNVRAMIsLocked Checks if NVRAM indexes are write protected

func TXTDPRisLock

func TXTDPRisLock(txtAPI hwapi.LowLevelHardwareInterfaces, config *tools.Configuration) (bool, error, error)

TXTDPRisLock checks the TXTRegister in memory about the status of DPR if it's locked.

func TXTHeapSpaceValid

func TXTHeapSpaceValid(txtAPI hwapi.LowLevelHardwareInterfaces, config *tools.Configuration) (bool, error, error)

TXTHeapSpaceValid checks if the registers indicates the correct sizes

func TXTMemoryIsDPR

func TXTMemoryIsDPR(txtAPI hwapi.LowLevelHardwareInterfaces, config *tools.Configuration) (bool, error, error)

TXTMemoryIsDPR checks if the TXT DPR protects TXT memory.

func TXTModeValid

func TXTModeValid(txtAPI hwapi.LowLevelHardwareInterfaces, config *tools.Configuration) (bool, error, error)

TXTModeValid checks if TXT is in valid mode

func TXTNotDisabled

func TXTNotDisabled(txtAPI hwapi.LowLevelHardwareInterfaces, config *tools.Configuration) (bool, error, error)

TXTNotDisabled Check TXT_DISABLED bit in TXT_ACM_STATUS

func TXTPrivateReservedInE820

func TXTPrivateReservedInE820(txtAPI hwapi.LowLevelHardwareInterfaces, config *tools.Configuration) (bool, error, error)

TXTPrivateReservedInE820 checks if TXTPrivate area is marked reserved in e820 map

func TXTPublicReservedInE820

func TXTPublicReservedInE820(txtAPI hwapi.LowLevelHardwareInterfaces, config *tools.Configuration) (bool, error, error)

TXTPublicReservedInE820 checks if TXTPublic area is marked reserved in e820 map

func TXTRegisterSpaceAccessible

func TXTRegisterSpaceAccessible(txtAPI hwapi.LowLevelHardwareInterfaces, config *tools.Configuration) (bool, error, error)

TXTRegisterSpaceAccessible Check if the TXT register space is accessible

func TXTRegistersLocked

func TXTRegistersLocked(txtAPI hwapi.LowLevelHardwareInterfaces, config *tools.Configuration) (bool, error, error)

TXTRegistersLocked Verify that the TXT register space is locked

func TXTReservedInE820

func TXTReservedInE820(txtAPI hwapi.LowLevelHardwareInterfaces, config *tools.Configuration) (bool, error, error)

TXTReservedInE820 checks if the HEAP/MSEG/SINIT TXT regions are marked reserved in e820 map.

func TXTTPMDecodeSpaceIn820

func TXTTPMDecodeSpaceIn820(txtAPI hwapi.LowLevelHardwareInterfaces, config *tools.Configuration) (bool, error, error)

TXTTPMDecodeSpaceIn820 checks if TPMDecode area is marked as reserved in e820 map

func ValidSMRR

func ValidSMRR(txtAPI hwapi.LowLevelHardwareInterfaces, config *tools.Configuration) (bool, error, error)

ValidSMRR checks if SMRR is valid

func WeybridgeOrLater

func WeybridgeOrLater(txtAPI hwapi.LowLevelHardwareInterfaces, config *tools.Configuration) (bool, error, error)

WeybridgeOrLater Check we're running on Weybridge

Types

type ACPIHeader

type ACPIHeader struct {
	Signature       [4]uint8
	Length          uint32
	Revision        uint8
	Checksum        uint8
	OEMID           [6]uint8
	OEMTableID      [8]uint8
	OEMRevision     uint32
	CreatorID       uint32
	CreatorRevision uint32
}

ACPIHeader represent the table header as defined in ACPI Spec 6.2 "5.2.6 System Description Table Header"

type ACPIMADT

type ACPIMADT struct {
	ACPIHeader
	LapicAddress uint32
	Flags        uint32
}

ACPIMADT represent the table header as defined in ACPI Spec 6.2 "Multiple APIC Description Table (MADT) Format"

type ACPIMADTDecoded

type ACPIMADTDecoded struct {
	LapicAddress   uint32
	Flags          uint32
	DecodedEntries []interface{}
}

ACPIMADTDecoded holds the decoded variable size MADT fields

func CheckMADTValidAndDecode

func CheckMADTValidAndDecode(txtAPI hwapi.LowLevelHardwareInterfaces, config *tools.Configuration) (ACPIMADTDecoded, bool, error, error)

CheckMADTValidAndDecode tests if the MADT ACPI table is valid

type ACPIMADTEntryHeader

type ACPIMADTEntryHeader struct {
	Type   uint8
	Length uint8
}

ACPIMADTEntryHeader represent the table header for one MADT entry

type ACPIMADTIOAPIC

type ACPIMADTIOAPIC struct {
	IOAPICID                  uint8
	Reserved                  uint8
	Address                   uint32
	GlobalSystemInterruptBase uint32
}

ACPIMADTIOAPIC type 1

type ACPIMADTInterruptSourceOverride

type ACPIMADTInterruptSourceOverride struct {
	BusSource             uint8
	IRQSource             uint8
	GlobalSystemInterrupt uint32
	Flags                 uint16
}

ACPIMADTInterruptSourceOverride type 2

type ACPIMADTLocalAPICAddressOverwrite

type ACPIMADTLocalAPICAddressOverwrite struct {
	Reserved uint16
	Address  uint64
}

ACPIMADTLocalAPICAddressOverwrite type 5

type ACPIMADTLocalNonMaskableInterrupts

type ACPIMADTLocalNonMaskableInterrupts struct {
	APICID uint8
	Flags  uint16
	LINT   uint8
}

ACPIMADTLocalNonMaskableInterrupts type 4

type ACPIMADTLocalSAPIC

type ACPIMADTLocalSAPIC struct {
	ACPIProcessorID   uint8
	LocalSAPICID      uint8
	LocalSAPICEID     uint8
	Reserved          [3]uint8
	Flags             uint32
	ACPIProcessorUUID uint32
}

ACPIMADTLocalSAPIC type 7

type ACPIMADTLocalx2APIC

type ACPIMADTLocalx2APIC struct {
	Reserved          uint16
	X2ApicID          uint32
	Flags             uint32
	ACPIProcessorUUID uint32
}

ACPIMADTLocalx2APIC type 9

type ACPIMADTLocalx2APICNMI

type ACPIMADTLocalx2APICNMI struct {
	Flags             uint16
	ACPIProcessorUUID uint32
	Localx2APICLint   uint8
	Reserved          [3]uint8
}

ACPIMADTLocalx2APICNMI type 10

type ACPIMADTNMISource

type ACPIMADTNMISource struct {
	Flags                 uint16
	GlobalSystemInterrupt uint32
}

ACPIMADTNMISource type 3

type ACPIMADTProcessorLocalAPIC

type ACPIMADTProcessorLocalAPIC struct {
	APICProcessorID uint8
	APICID          uint8
	Flags           uint32
}

ACPIMADTProcessorLocalAPIC type 0

type ACPIMADTSAPIC

type ACPIMADTSAPIC struct {
	IOAPICID                  uint8
	Reserved                  uint8
	GlobalSystemInterruptBase uint32
	IOSAPICAddress            uint64
}

ACPIMADTSAPIC type 6

type ACPIRsdp

type ACPIRsdp struct {
	Signature        [8]uint8
	Checksum         uint8
	OEMID            [6]uint8
	Revision         uint8
	RSDTPtr          uint32
	RSDPLen          uint32
	XSDTPtr          uint64
	ExtendedChecksum uint8
	Reserved         [3]uint8
}

ACPIRsdp as defined in ACPI Spec 6.2 "5.2.5.3 Root System Description Pointer (RSDP) Structure"

type Result

type Result int

Result exposes the type for test results

const (
	// ResultNotRun indicates that a test was skipped
	ResultNotRun Result = iota

	// ResultDependencyFailed indicates that the previous dependency test failed
	ResultDependencyFailed

	// ResultInternalError indicates that a library function failed at some point in the test
	ResultInternalError

	// ResultFail indicates that the test failed
	ResultFail

	// ResultPass indicates that the test succeeded.
	ResultPass
)

func (Result) String

func (t Result) String() string

type Status

type Status int

Status exposes the type for test status

const (
	// Implemented indicates that a test is implemented completly
	Implemented Status = iota

	// NotImplemented indicates that test is NOT implemented
	NotImplemented

	// PartlyImplemented indicates that a test implements a certain aspect
	PartlyImplemented
)

func (Status) String

func (t Status) String() string

type TXTSpec

type TXTSpec int

TXTSpec exposes the type to differentiate between TXT specs

const (
	// TXT indicates
	TXT TXTSpec = iota

	// CBnT indicates
	CBnT

	// Common indicates
	Common
)

func (TXTSpec) String

func (t TXTSpec) String() string

type Test

type Test struct {
	Name     string
	Required bool

	Result Result

	ErrorText     string
	ErrorTextSpec string
	Status        Status
	Spec          TXTSpec
	// The chapter inside the spec used for this test
	SpecificationChapter string
	// The specification used in this test
	SpecificiationTitle     string
	SpecificationDocumentID string
	// contains filtered or unexported fields
}

Test exposes the structure in which information about TXT tests are held

func (*Test) Run

func (t *Test) Run(TxtAPI hwapi.LowLevelHardwareInterfaces, config *tools.Configuration) bool

Run implements the genereal test function and exposes it.

Jump to

Keyboard shortcuts

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