├── .github
└── workflows
│ └── build_testcases.yml
├── BOM.txt
├── CITATION.cff
├── CODE_OF_CONDUCT.md
├── CONTRIBUTING.md
├── HBFA
├── UefiHostFuzzTestCasePkg
│ ├── Seed
│ │ ├── Ata
│ │ │ └── Raw
│ │ │ │ └── IdentifyData.bin
│ │ ├── BMP
│ │ │ └── Raw
│ │ │ │ ├── 1.bmp
│ │ │ │ ├── 16.bmp
│ │ │ │ ├── 16_1.bmp
│ │ │ │ ├── 24.bmp
│ │ │ │ ├── 32.bmp
│ │ │ │ ├── 4.bmp
│ │ │ │ ├── 4_1.bmp
│ │ │ │ ├── 8.bmp
│ │ │ │ ├── 8_1.bmp
│ │ │ │ └── sample.bmp
│ │ ├── Blk
│ │ │ ├── VirtioBlkFuzzSeed0.9.5.bin
│ │ │ ├── VirtioBlkFuzzSeed1.0.0.bin
│ │ │ └── VirtioBlkFuzzSeed1.0.0_fix.bin
│ │ ├── Capsule
│ │ │ ├── MICROCODECAPSULE1.Cap
│ │ │ ├── QUARKFIRMWAREUPDATECAPSULEFMPPKCS7.Cap
│ │ │ └── QUARKREC.Cap
│ │ ├── Cfv
│ │ │ ├── cfv01.bin
│ │ │ └── securebootcfv01.bin
│ │ ├── Gpt
│ │ │ └── Raw
│ │ │ │ ├── Gpt.bin
│ │ │ │ ├── Gpt_16384.bin
│ │ │ │ └── Gpt_error.bin
│ │ ├── Include
│ │ │ └── Uefi.py
│ │ ├── Instruction
│ │ │ ├── instruction000.bin
│ │ │ ├── instruction001.bin
│ │ │ ├── instruction002.bin
│ │ │ ├── instruction003.bin
│ │ │ ├── instruction004.bin
│ │ │ ├── instruction005.bin
│ │ │ ├── instruction006.bin
│ │ │ ├── instruction007.bin
│ │ │ ├── instruction008.bin
│ │ │ ├── instruction009.bin
│ │ │ ├── instruction010.bin
│ │ │ ├── instruction011.bin
│ │ │ ├── instruction012.bin
│ │ │ ├── instruction013.bin
│ │ │ ├── instruction014.bin
│ │ │ ├── instruction015.bin
│ │ │ ├── instruction016.bin
│ │ │ ├── instruction017.bin
│ │ │ ├── instruction018.bin
│ │ │ ├── instruction019.bin
│ │ │ ├── instruction020.bin
│ │ │ ├── instruction021.bin
│ │ │ ├── instruction022.bin
│ │ │ ├── instruction023.bin
│ │ │ ├── instruction024.bin
│ │ │ ├── instruction025.bin
│ │ │ └── instruction026.bin
│ │ ├── Mutator
│ │ │ └── MutatorSimple.py
│ │ ├── SignatureList
│ │ │ └── SignatureList.raw
│ │ ├── TPM
│ │ │ ├── Raw
│ │ │ │ └── Tpm2Res.bin
│ │ │ └── Script
│ │ │ │ └── SeedGenTpm2Response.py
│ │ ├── TdxHob
│ │ │ └── hob.bin
│ │ ├── UDF
│ │ │ ├── Raw
│ │ │ │ ├── FileName
│ │ │ │ │ ├── 0
│ │ │ │ │ ├── 1
│ │ │ │ │ ├── 2
│ │ │ │ │ ├── 22
│ │ │ │ │ ├── __a
│ │ │ │ │ ├── a
│ │ │ │ │ ├── b
│ │ │ │ │ ├── b_a
│ │ │ │ │ ├── b_c
│ │ │ │ │ ├── blink
│ │ │ │ │ ├── blink_a
│ │ │ │ │ ├── blink_alink
│ │ │ │ │ └── blink_c_
│ │ │ │ ├── FileSystem
│ │ │ │ │ ├── test_123.bin
│ │ │ │ │ ├── test_a.bin
│ │ │ │ │ ├── test_a_0.bin
│ │ │ │ │ ├── test_a_e1.bin
│ │ │ │ │ ├── test_a_mm.bin
│ │ │ │ │ ├── test_a_mm_f.bin
│ │ │ │ │ ├── test_a_mm_ff.bin
│ │ │ │ │ ├── test_all.bin
│ │ │ │ │ ├── test_ca.bin
│ │ │ │ │ ├── test_udf.bin
│ │ │ │ │ ├── test_udf_fid.bin
│ │ │ │ │ ├── test_udf_m.bin
│ │ │ │ │ ├── test_udf_m1.bin
│ │ │ │ │ ├── test_udf_m3.bin
│ │ │ │ │ ├── test_udf_m4.bin
│ │ │ │ │ ├── test_udf_m5_16.bin
│ │ │ │ │ ├── test_udf_m5_17.bin
│ │ │ │ │ └── test_udf_m5_double.bin
│ │ │ │ ├── Partition
│ │ │ │ │ ├── Udf_1.bin
│ │ │ │ │ ├── Udf_2.bin
│ │ │ │ │ ├── Udf_3.bin
│ │ │ │ │ ├── Udf_linux.bin
│ │ │ │ │ ├── test000001.seed
│ │ │ │ │ ├── test000002.seed
│ │ │ │ │ ├── test000003.seed
│ │ │ │ │ ├── test000004.seed
│ │ │ │ │ ├── test000005.seed
│ │ │ │ │ ├── test000006.seed
│ │ │ │ │ ├── test000007.seed
│ │ │ │ │ ├── test000008.seed
│ │ │ │ │ ├── test000009.seed
│ │ │ │ │ ├── test000010.seed
│ │ │ │ │ ├── test000011.seed
│ │ │ │ │ ├── test000012.seed
│ │ │ │ │ ├── test000013.seed
│ │ │ │ │ ├── test000014.seed
│ │ │ │ │ ├── test000015.seed
│ │ │ │ │ ├── test000016.seed
│ │ │ │ │ ├── test000017.seed
│ │ │ │ │ ├── test000018.seed
│ │ │ │ │ ├── test000019.seed
│ │ │ │ │ ├── test000020.seed
│ │ │ │ │ ├── test000021.seed
│ │ │ │ │ ├── test000022.seed
│ │ │ │ │ ├── test000023.seed
│ │ │ │ │ └── test000024.seed
│ │ │ │ └── readme.txt
│ │ │ └── Script
│ │ │ │ ├── SeedGenUdf.py
│ │ │ │ ├── Udf.py
│ │ │ │ └── __init__.py
│ │ ├── USB
│ │ │ └── Raw
│ │ │ │ └── Usb.bin
│ │ ├── VariableSmm
│ │ │ └── Raw
│ │ │ │ └── VarSmm.bin
│ │ └── readme.txt
│ ├── TestCase
│ │ ├── DeviceSecurityPkg
│ │ │ └── TestSignatureList
│ │ │ │ ├── TestSignatureList.c
│ │ │ │ └── TestSignatureList.inf
│ │ ├── FatPkg
│ │ │ └── FatPei
│ │ │ │ ├── InstrumentHookLibTestPeiGpt
│ │ │ │ ├── CreateErrorInjectionProfile.py
│ │ │ │ ├── InstrumentHookLibTestPeiGpt.c
│ │ │ │ └── InstrumentHookLibTestPeiGpt.inf
│ │ │ │ ├── Override
│ │ │ │ ├── FatLiteLib.c
│ │ │ │ └── FatPei.inf
│ │ │ │ ├── TestPeiGpt.c
│ │ │ │ └── TestPeiGpt.inf
│ │ ├── MdeModulePkg
│ │ │ ├── Bus
│ │ │ │ ├── Ata
│ │ │ │ │ └── AhciPei
│ │ │ │ │ │ ├── Override
│ │ │ │ │ │ ├── AhciMode.c
│ │ │ │ │ │ ├── AhciPei.h
│ │ │ │ │ │ ├── AhciPei.inf
│ │ │ │ │ │ ├── AhciPeiBlockIo.c
│ │ │ │ │ │ ├── AhciPeiBlockIo.h
│ │ │ │ │ │ ├── AhciPeiPassThru.c
│ │ │ │ │ │ ├── AhciPeiPassThru.h
│ │ │ │ │ │ ├── AhciPeiStorageSecurity.c
│ │ │ │ │ │ ├── AhciPeiStorageSecurity.h
│ │ │ │ │ │ ├── DevicePath.c
│ │ │ │ │ │ ├── DmaMem.c
│ │ │ │ │ │ └── IoMmu.h
│ │ │ │ │ │ ├── TestIdentifyAtaDevice.c
│ │ │ │ │ │ └── TestIdentifyAtaDevice.inf
│ │ │ │ └── Usb
│ │ │ │ │ ├── UsbBusDxe
│ │ │ │ │ ├── TestUsb.c
│ │ │ │ │ └── TestUsb.inf
│ │ │ │ │ └── UsbBusPei
│ │ │ │ │ ├── TestPeiUsb.c
│ │ │ │ │ └── TestPeiUsb.inf
│ │ │ ├── Library
│ │ │ │ └── BaseBmpSupportLib
│ │ │ │ │ ├── TestBmpSupportLib.c
│ │ │ │ │ └── TestBmpSupportLib.inf
│ │ │ └── Universal
│ │ │ │ ├── CapsulePei
│ │ │ │ └── Common
│ │ │ │ │ ├── TestCapsulePei.c
│ │ │ │ │ └── TestCapsulePei.inf
│ │ │ │ ├── Disk
│ │ │ │ ├── PartitionDxe
│ │ │ │ │ ├── InstrumentHookLibTestPartition
│ │ │ │ │ │ ├── CreateErrorInjectionProfile.py
│ │ │ │ │ │ ├── InstrumentHookLibTestPartition.c
│ │ │ │ │ │ └── InstrumentHookLibTestPartition.inf
│ │ │ │ │ ├── TestPartition.c
│ │ │ │ │ └── TestPartition.inf
│ │ │ │ └── UdfDxe
│ │ │ │ │ ├── InstrumentHookLibTestUdf
│ │ │ │ │ ├── CreateErrorInjectionProfile.py
│ │ │ │ │ ├── InstrumentHookLibTestUdf.c
│ │ │ │ │ └── InstrumentHookLibTestUdf.inf
│ │ │ │ │ ├── TestFileName.c
│ │ │ │ │ ├── TestFileName.inf
│ │ │ │ │ ├── TestUdf.c
│ │ │ │ │ └── TestUdf.inf
│ │ │ │ └── Variable
│ │ │ │ └── RuntimeDxe
│ │ │ │ ├── TestVariableSmm.c
│ │ │ │ └── TestVariableSmm.inf
│ │ ├── OvmfPkg
│ │ │ ├── EmuVariableFvbRuntimeDxe
│ │ │ │ ├── Fvb.h
│ │ │ │ ├── TestValidateTdxCfv.c
│ │ │ │ └── TestValidateTdxCfv.inf
│ │ │ ├── Virtio10BlkDxe
│ │ │ │ ├── TestVirtio10Blk.c
│ │ │ │ └── TestVirtio10Blk.inf
│ │ │ ├── VirtioBlkDxe
│ │ │ │ ├── TestVirtioBlk.c
│ │ │ │ └── TestVirtioBlk.inf
│ │ │ ├── VirtioBlkReadWrite
│ │ │ │ ├── TestVirtioBlkReadWrite.c
│ │ │ │ └── TestVirtioBlkReadWrite.inf
│ │ │ └── VirtioPciDeviceDxe
│ │ │ │ ├── TestVirtioPciDevice.c
│ │ │ │ └── TestVirtioPciDevice.inf
│ │ └── SecurityPkg
│ │ │ └── Library
│ │ │ ├── DxeTpm2MeasureBootLib
│ │ │ ├── TestTcg2MeasureGptTable.c
│ │ │ ├── TestTcg2MeasureGptTable.inf
│ │ │ ├── TestTcg2MeasurePeImage.c
│ │ │ └── TestTcg2MeasurePeImage.inf
│ │ │ ├── FmpAuthenticationLibPkcs7
│ │ │ ├── CryptoLibStubPkcs7.inf
│ │ │ ├── CryptoStubPkcs7.c
│ │ │ ├── SamplePkcs7.c
│ │ │ ├── TestFmpAuthenticationLibPkcs7.c
│ │ │ └── TestFmpAuthenticationLibPkcs7.inf
│ │ │ ├── FmpAuthenticationLibRsa2048Sha256
│ │ │ ├── CryptoLibStubRsa2048Sha256.inf
│ │ │ ├── CryptoStubRsa2048Sha256.c
│ │ │ ├── SampleRsa2048Sha256.c
│ │ │ ├── TestFmpAuthenticationLibRsa2048Sha256.c
│ │ │ └── TestFmpAuthenticationLibRsa2048Sha256.inf
│ │ │ └── Tpm2CommandLib
│ │ │ ├── TestTpm2CommandLib.c
│ │ │ └── TestTpm2CommandLib.inf
│ ├── TestStub
│ │ ├── DiskStubLib
│ │ │ ├── DiskStubLib.c
│ │ │ └── DiskStubLib.inf
│ │ ├── Include
│ │ │ └── Library
│ │ │ │ ├── DiskStubLib.h
│ │ │ │ ├── SmmMemLibStubLib.h
│ │ │ │ ├── Tcg2StubLib.h
│ │ │ │ ├── Tpm2DeviceStubLib.h
│ │ │ │ ├── Usb2HcPpiStubLib.h
│ │ │ │ ├── Usb2HcStubLib.h
│ │ │ │ ├── UsbIoPpiStubLib.h
│ │ │ │ ├── VirtioBlkStubLib.h
│ │ │ │ └── VirtioPciDeviceStubLib.h
│ │ ├── Tcg2StubLib
│ │ │ ├── Tcg2StubLib.c
│ │ │ └── Tcg2StubLib.inf
│ │ ├── Tpm2DeviceLibStub
│ │ │ ├── Tpm2DeviceLibStub.c
│ │ │ └── Tpm2DeviceLibStub.inf
│ │ ├── Usb2HcPpiStubLib
│ │ │ ├── Usb2HcPpiStubLib.c
│ │ │ └── Usb2HcPpiStubLib.inf
│ │ ├── Usb2HcStubLib
│ │ │ ├── Usb2HcStubLib.c
│ │ │ └── Usb2HcStubLib.inf
│ │ ├── UsbIoPpiStubLib
│ │ │ ├── UsbIoPpiStubLib.c
│ │ │ └── UsbIoPpiStubLib.inf
│ │ ├── VirtioBlkStubLib
│ │ │ ├── VirtioBlkStubLib.c
│ │ │ └── VirtioBlkStubLib.inf
│ │ ├── VirtioPciDevice10StubLib
│ │ │ ├── VirtioPciDevice10StubLib.c
│ │ │ └── VirtioPciDevice10StubLib.inf
│ │ └── VirtioPciDeviceStubLib
│ │ │ ├── VirtioPciDeviceStubLib.c
│ │ │ └── VirtioPciDeviceStubLib.inf
│ ├── UefiHostFuzzTestCasePkg.dec
│ ├── UefiHostFuzzTestCasePkg.dsc
│ └── UefiHostFuzzTestDeviceSecurityPkg.dsc
├── UefiHostFuzzTestPkg
│ ├── Conf
│ │ ├── LLVMLink.py
│ │ ├── build_rule.customized
│ │ └── tools_def.customized
│ ├── Include
│ │ └── Library
│ │ │ └── ToolChainHarnessLib.h
│ ├── Library
│ │ └── ToolChainHarnessLib
│ │ │ ├── ToolChainHarnessLib.c
│ │ │ └── ToolChainHarnessLib.inf
│ ├── ReadME-AFLTurbo.txt
│ ├── ReadMe-AFL.txt
│ ├── ReadMe-ErrorInjection.txt
│ ├── ReadMe-KLEE.txt
│ ├── ReadMe-LibFuzzer.txt
│ ├── UefiHostFuzzTestBuildOption.dsc
│ └── UefiHostFuzzTestPkg.dec
├── UefiHostTestPkg
│ ├── Include
│ │ └── Library
│ │ │ └── OsServiceLib.h
│ ├── Library
│ │ ├── BaseCacheMaintenanceLibHost
│ │ │ ├── BaseCacheMaintenanceLibHost.inf
│ │ │ └── Cache.c
│ │ ├── BaseCpuLibHost
│ │ │ ├── BaseCpuLibHost.c
│ │ │ └── BaseCpuLibHost.inf
│ │ ├── BaseLibHost
│ │ │ ├── ARShiftU64.c
│ │ │ ├── BaseLibHost.inf
│ │ │ ├── BaseLibHostNoAsm.inf
│ │ │ ├── BitField.c
│ │ │ ├── Cache.c
│ │ │ ├── CheckSum.c
│ │ │ ├── Cpu.c
│ │ │ ├── CpuBreakpointGcc.c
│ │ │ ├── CpuBreakpointMsvc.c
│ │ │ ├── CpuDeadLoop.c
│ │ │ ├── DivS64x64Remainder.c
│ │ │ ├── DivU64x32.c
│ │ │ ├── DivU64x32Remainder.c
│ │ │ ├── DivU64x64Remainder.c
│ │ │ ├── DummyRdRand.c
│ │ │ ├── DummyReadTsc.c
│ │ │ ├── GetPowerOfTwo32.c
│ │ │ ├── GetPowerOfTwo64.c
│ │ │ ├── HighBitSet32.c
│ │ │ ├── HighBitSet64.c
│ │ │ ├── Ia32
│ │ │ │ ├── RdRand.nasm
│ │ │ │ └── ReadTsc.nasm
│ │ │ ├── LRotU32.c
│ │ │ ├── LRotU64.c
│ │ │ ├── LShiftU64.c
│ │ │ ├── Lfence.c
│ │ │ ├── LinkedList.c
│ │ │ ├── LongJump.c
│ │ │ ├── LowBitSet32.c
│ │ │ ├── LowBitSet64.c
│ │ │ ├── Math64.c
│ │ │ ├── ModU64x32.c
│ │ │ ├── MultS64x64.c
│ │ │ ├── MultU64x32.c
│ │ │ ├── MultU64x64.c
│ │ │ ├── RRotU32.c
│ │ │ ├── RRotU64.c
│ │ │ ├── RShiftU64.c
│ │ │ ├── SafeString.c
│ │ │ ├── SetJump.c
│ │ │ ├── String.c
│ │ │ ├── SwapBytes16.c
│ │ │ ├── SwapBytes32.c
│ │ │ ├── SwapBytes64.c
│ │ │ ├── SwitchStackNull.c
│ │ │ ├── Unaligned.c
│ │ │ ├── X64
│ │ │ │ ├── RdRand.nasm
│ │ │ │ └── ReadTsc.nasm
│ │ │ ├── X86Cr.c
│ │ │ ├── X86DisablePaging64Null.c
│ │ │ ├── X86Dr.c
│ │ │ ├── X86GdtrNull.c
│ │ │ ├── X86IdtrNull.c
│ │ │ ├── X86MemoryFenceGcc.c
│ │ │ ├── X86MemoryFenceMsvc.c
│ │ │ ├── X86PatchInstruction.c
│ │ │ ├── X86RdRand.c
│ │ │ └── X86SegmentNull.c
│ │ ├── BaseLibNullCpuid
│ │ │ ├── BaseLibNullCpuid.c
│ │ │ └── BaseLibNullCpuid.inf
│ │ ├── BaseLibNullMsr
│ │ │ ├── BaseLibNullMsr.c
│ │ │ └── BaseLibNullMsr.inf
│ │ ├── BaseMemoryLibHost
│ │ │ ├── BaseMemoryLibHost.c
│ │ │ └── BaseMemoryLibHost.inf
│ │ ├── BasePcdLibHost
│ │ │ ├── BasePcdLibHost.c
│ │ │ └── BasePcdLibHost.inf
│ │ ├── BaseTimerLibHost
│ │ │ ├── BaseTimerLibHost.c
│ │ │ └── BaseTimerLibHost.inf
│ │ ├── DebugLibHost
│ │ │ ├── DebugLibHost.c
│ │ │ └── DebugLibHost.inf
│ │ ├── DxeServicesTableLibHost
│ │ │ ├── DxeServicesTableLibHost.c
│ │ │ ├── DxeServicesTableLibHost.inf
│ │ │ ├── Gcd.c
│ │ │ └── Gcd.h
│ │ ├── HobLibHost
│ │ │ ├── HobLibHost.c
│ │ │ └── HobLibHost.inf
│ │ ├── MemoryAllocationLibHost
│ │ │ ├── MemoryAllocationLibHost.c
│ │ │ └── MemoryAllocationLibHost.inf
│ │ ├── OsServiceLibHost
│ │ │ ├── OsServiceLibGcc.c
│ │ │ ├── OsServiceLibHost.inf
│ │ │ ├── OsServiceLibMsvc.c
│ │ │ └── WinNTInclude.h
│ │ ├── PeiServicesTablePointerLibHost
│ │ │ ├── CpuIo.c
│ │ │ ├── PciCfg2.c
│ │ │ ├── PeiMain.h
│ │ │ ├── PeiServicesTablePointerLibHost.c
│ │ │ ├── PeiServicesTablePointerLibHost.inf
│ │ │ └── Ppi.c
│ │ ├── PeimEntryPointHost
│ │ │ ├── PeimEntryPointHost.c
│ │ │ └── PeimEntryPointHost.inf
│ │ ├── SmmMemLibHost
│ │ │ ├── SmmMemLibHost.c
│ │ │ └── SmmMemLibHost.inf
│ │ ├── SmmServicesTableLibHost
│ │ │ ├── Handle.c
│ │ │ ├── InstallConfigurationTable.c
│ │ │ ├── Locate.c
│ │ │ ├── Notify.c
│ │ │ ├── PiSmmCore.c
│ │ │ ├── PiSmmCore.h
│ │ │ ├── SmmServicesTableLibHost.c
│ │ │ └── SmmServicesTableLibHost.inf
│ │ ├── UefiBootServicesTableLibHost
│ │ │ ├── DriverSupport.c
│ │ │ ├── DxeMain.h
│ │ │ ├── Event.h
│ │ │ ├── Handle.c
│ │ │ ├── Handle.h
│ │ │ ├── Library.c
│ │ │ ├── Locate.c
│ │ │ ├── Notify.c
│ │ │ ├── Tpl.c
│ │ │ ├── UefiBootServicesTableLibHost.c
│ │ │ └── UefiBootServicesTableLibHost.inf
│ │ ├── UefiDevicePathLibHost
│ │ │ ├── DevicePathUtilities.c
│ │ │ ├── UefiDevicePathLib.c
│ │ │ ├── UefiDevicePathLib.h
│ │ │ └── UefiDevicePathLibHost.inf
│ │ ├── UefiDriverEntryPointHost
│ │ │ ├── UefiDriverEntryPointHost.c
│ │ │ └── UefiDriverEntryPointHost.inf
│ │ ├── UefiLibHost
│ │ │ ├── UefiDriverModel.c
│ │ │ ├── UefiLib.c
│ │ │ ├── UefiLibHost.inf
│ │ │ └── UefiLibInternal.h
│ │ ├── UefiRuntimeServicesTableLibHost
│ │ │ ├── AuthVarCertDB.c
│ │ │ ├── AuthVarCertDB.h
│ │ │ ├── AuthVariable.c
│ │ │ ├── AuthVariable.h
│ │ │ ├── OsVariable.c
│ │ │ ├── OsVariable.h
│ │ │ ├── Time.c
│ │ │ ├── UefiRuntimeServicesTableLibHost.c
│ │ │ ├── UefiRuntimeServicesTableLibHost.inf
│ │ │ ├── Variable.c
│ │ │ ├── Variable.h
│ │ │ └── VariableCommon.h
│ │ └── VarCheckLibNull
│ │ │ ├── VarCheckLibNull.c
│ │ │ └── VarCheckLibNull.inf
│ ├── UefiHostTestBuildOption.dsc
│ ├── UefiHostTestPkg.dec
│ └── UefiHostTestPkg.dsc
├── UefiHostTestTools
│ ├── HBFAEnvSetup.py
│ ├── Report
│ │ ├── GenCodeCoverage.py
│ │ ├── GenGdbHtmlReport.py
│ │ ├── GenGdbInfo.py
│ │ ├── GenLLVMReport.py
│ │ ├── GenSanitizerHtmlReport.py
│ │ ├── GenSanitizerInfo.py
│ │ ├── GenSummaryInfo.py
│ │ ├── GenSummaryReport.py
│ │ ├── GetSeedsList.py
│ │ ├── IndexSummaryTemplate.html
│ │ ├── IndexTemplate.html
│ │ ├── ReportMain.py
│ │ └── __init__.py
│ ├── RunAFL.py
│ ├── RunAFLTurbo.py
│ ├── RunKLEE.py
│ ├── RunLibFuzzer.py
│ ├── Script
│ │ ├── RunAllSeeds.py
│ │ └── TransferKtestToSeed.py
│ ├── __init__.py
│ └── __pycache__
│ │ ├── RunAFL.cpython-311.pyc
│ │ ├── RunAFLTurbo.cpython-311.pyc
│ │ ├── RunKLEE.cpython-311.pyc
│ │ ├── RunLibFuzzer.cpython-311.pyc
│ │ └── __init__.cpython-311.pyc
├── UefiInstrumentTestCasePkg
│ ├── ReadMe-BME.txt
│ ├── TestCase
│ │ ├── InstrumentHookLibTracingPci
│ │ │ ├── InstrumentHookLibTracingPci.c
│ │ │ └── InstrumentHookLibTracingPci.inf
│ │ └── Usb2HcHook
│ │ │ ├── Usb2HcHook.c
│ │ │ └── Usb2HcHook.inf
│ ├── UefiInstrumentTestCasePkg.dec
│ └── UefiInstrumentTestCasePkg.dsc
├── UefiInstrumentTestPkg
│ ├── Include
│ │ └── Library
│ │ │ ├── IniParsingLib.h
│ │ │ └── InstrumentHookLib.h
│ ├── Library
│ │ ├── IniParsingLib
│ │ │ ├── IniParsingLib.c
│ │ │ ├── IniParsingLib.inf
│ │ │ └── IniParsingLib.uni
│ │ ├── InstrumentHookLibNull
│ │ │ ├── InstrumentHookLibNull.c
│ │ │ └── InstrumentHookLibNull.inf
│ │ ├── InstrumentLib
│ │ │ ├── Ia32
│ │ │ │ ├── CygProfileEnterExit.nasm
│ │ │ │ ├── CygProfileEnterExitStub.c
│ │ │ │ ├── FuncParam.c
│ │ │ │ ├── FuncParamGcc.c
│ │ │ │ ├── FuncParamMsvc.c
│ │ │ │ ├── PEnterExit.nasm
│ │ │ │ └── PEnterExitStub.c
│ │ │ ├── InstrumentLib.inf
│ │ │ └── X64
│ │ │ │ ├── CygProfileEnterExit.nasm
│ │ │ │ ├── CygProfileEnterExitStub.c
│ │ │ │ ├── FuncParam.c
│ │ │ │ ├── FuncParamGcc.c
│ │ │ │ ├── FuncParamMsvc.c
│ │ │ │ ├── PEnterExit.nasm
│ │ │ │ └── PEnterExitStub.c
│ │ └── SimpleSynchronizationLib
│ │ │ ├── BaseSynchronizationLibInternals.h
│ │ │ ├── Ia32
│ │ │ ├── GccInline.c
│ │ │ ├── InterlockedCompareExchange32.asm
│ │ │ ├── InterlockedCompareExchange32.c
│ │ │ ├── InterlockedCompareExchange64.asm
│ │ │ ├── InterlockedCompareExchange64.c
│ │ │ ├── InterlockedDecrement.asm
│ │ │ ├── InterlockedDecrement.c
│ │ │ ├── InterlockedIncrement.asm
│ │ │ └── InterlockedIncrement.c
│ │ │ ├── SimpleSynchronizationLib.inf
│ │ │ ├── Synchronization.c
│ │ │ ├── SynchronizationGcc.c
│ │ │ ├── SynchronizationMsc.c
│ │ │ └── X64
│ │ │ ├── GccInline.c
│ │ │ ├── InterlockedCompareExchange32.asm
│ │ │ ├── InterlockedCompareExchange32.c
│ │ │ ├── InterlockedCompareExchange64.asm
│ │ │ ├── InterlockedCompareExchange64.c
│ │ │ ├── InterlockedDecrement.asm
│ │ │ ├── InterlockedDecrement.c
│ │ │ ├── InterlockedIncrement.asm
│ │ │ └── InterlockedIncrement.c
│ ├── UefiInstrumentTestPkg.dec
│ └── UefiInstrumentTestPkg.dsc
├── __init__.py
└── tests
│ ├── TestRunAFL.py
│ ├── TestRunAFLTurbo.py
│ ├── TestRunKLEE.py
│ ├── TestRunLibFuzzer.py
│ └── __init__.py
├── LICENSE.md
├── README.md
├── SECURITY.md
├── docs
├── .gitignore
├── book.toml
├── images
│ ├── Step3_Select_Boot_Manager.png
│ ├── Step4_Select_EFI_Shell.png
│ ├── Step5_EFI_Shell_Press_Escape.png
│ ├── Ubuntu_boot_select_firmware_settings.png
│ ├── hbfa_covreport.png
│ ├── hbfa_covreport2.png
│ ├── hbfa_crash_AAA.png
│ ├── hbfa_crashes.png
│ ├── hbfa_hangs.png
│ ├── hbfa_helloworld_AAAAs.png
│ ├── hbfa_helloworld_debug_Acrash1.png
│ ├── hbfa_helloworld_debug_Acrash2.png
│ ├── hbfa_helloworld_debug_Acrash3.png
│ ├── hbfa_helloworld_extended.png
│ ├── hbfa_helloworld_list.png
│ ├── hbfa_helloworld_list2.png
│ ├── hbfa_helloworld_reprocrash.png
│ ├── hbfa_shell_helloworld.png
│ ├── hbfa_shell_ls.png
│ ├── hbfa_shell_map.png
│ ├── hbfa_source_UefiHostTestPkg.dsc.png
│ ├── hbfa_source_helloworld.c.png
│ ├── hbfa_source_testhelloworld.c.png
│ └── hbfa_summary.png
└── src
│ ├── README.md
│ ├── SUMMARY.md
│ ├── archive
│ └── originalHBFA
│ │ ├── Doc
│ │ ├── User Guide - How-to-Add-New-Case.pdf
│ │ └── User Guide - How-to-Run-Test-Case.pdf
│ │ └── README.md
│ ├── fuzzing
│ ├── README.md
│ ├── building.md
│ ├── fuzzingwithAFL.md
│ ├── fuzzingwithLibFuzzer.md
│ └── generatingCoverageReports.md
│ ├── harness
│ ├── README.md
│ ├── includedfuzzharnesses.md
│ └── wheretoharness.md
│ ├── setup
│ ├── README.md
│ └── linux.md
│ └── tutorials
│ ├── README.md
│ └── writingafuzzingharness.md
├── edk2-bugfixes
├── 0001-CapsuleCoalesce-validate-array-access-to-be-in-valid.patch
├── 0001-Fix-Bug-in-UdfDxe-MangleFilename.patch
├── 0001-Fix-TranslateBmpToGopBlt.patch
├── 0001-UsbBusPei-Error-out-when-configuration-exceeds-maxim.patch
└── 0002-Fix-bug-in-UdfDxe-MangleFilename.patch
├── oss-fuzz
├── TestBmpSupportLib.options
└── build.sh
└── requirements.txt
/BOM.txt:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/intel/HBFA-FL/a803974fd721e973781e4ec144b894843f7ef567/BOM.txt
--------------------------------------------------------------------------------
/CITATION.cff:
--------------------------------------------------------------------------------
1 | cff-version: 1.2.0
2 | message: "If you use this software, please cite it as below."
3 | authors:
4 | - family-names: "Tipton"
5 | given-names: "Earl Lynn"
6 | orcid: "https://orcid.org/0000-0003-0763-173X"
7 | - family-names: "Delgado"
8 | given-names: "Brian"
9 | - family-names: "Bjorge"
10 | given-names: "Erik C."
11 | - family-names: "Gomez-Iglesias"
12 | given-names: "Antonio"
13 | title: "Host Based Firmware Analyzer - Fuzzing Lite (HBFA-FL)"
14 | version: 0.11
15 | doi: ""
16 | date-released: 2024-02-19
17 | url: "https://github.com/intel/HBFA-FL"
18 |
--------------------------------------------------------------------------------
/HBFA/UefiHostFuzzTestCasePkg/Seed/Ata/Raw/IdentifyData.bin:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/intel/HBFA-FL/a803974fd721e973781e4ec144b894843f7ef567/HBFA/UefiHostFuzzTestCasePkg/Seed/Ata/Raw/IdentifyData.bin
--------------------------------------------------------------------------------
/HBFA/UefiHostFuzzTestCasePkg/Seed/BMP/Raw/1.bmp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/intel/HBFA-FL/a803974fd721e973781e4ec144b894843f7ef567/HBFA/UefiHostFuzzTestCasePkg/Seed/BMP/Raw/1.bmp
--------------------------------------------------------------------------------
/HBFA/UefiHostFuzzTestCasePkg/Seed/BMP/Raw/16.bmp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/intel/HBFA-FL/a803974fd721e973781e4ec144b894843f7ef567/HBFA/UefiHostFuzzTestCasePkg/Seed/BMP/Raw/16.bmp
--------------------------------------------------------------------------------
/HBFA/UefiHostFuzzTestCasePkg/Seed/BMP/Raw/16_1.bmp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/intel/HBFA-FL/a803974fd721e973781e4ec144b894843f7ef567/HBFA/UefiHostFuzzTestCasePkg/Seed/BMP/Raw/16_1.bmp
--------------------------------------------------------------------------------
/HBFA/UefiHostFuzzTestCasePkg/Seed/BMP/Raw/24.bmp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/intel/HBFA-FL/a803974fd721e973781e4ec144b894843f7ef567/HBFA/UefiHostFuzzTestCasePkg/Seed/BMP/Raw/24.bmp
--------------------------------------------------------------------------------
/HBFA/UefiHostFuzzTestCasePkg/Seed/BMP/Raw/32.bmp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/intel/HBFA-FL/a803974fd721e973781e4ec144b894843f7ef567/HBFA/UefiHostFuzzTestCasePkg/Seed/BMP/Raw/32.bmp
--------------------------------------------------------------------------------
/HBFA/UefiHostFuzzTestCasePkg/Seed/BMP/Raw/4.bmp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/intel/HBFA-FL/a803974fd721e973781e4ec144b894843f7ef567/HBFA/UefiHostFuzzTestCasePkg/Seed/BMP/Raw/4.bmp
--------------------------------------------------------------------------------
/HBFA/UefiHostFuzzTestCasePkg/Seed/BMP/Raw/4_1.bmp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/intel/HBFA-FL/a803974fd721e973781e4ec144b894843f7ef567/HBFA/UefiHostFuzzTestCasePkg/Seed/BMP/Raw/4_1.bmp
--------------------------------------------------------------------------------
/HBFA/UefiHostFuzzTestCasePkg/Seed/BMP/Raw/8.bmp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/intel/HBFA-FL/a803974fd721e973781e4ec144b894843f7ef567/HBFA/UefiHostFuzzTestCasePkg/Seed/BMP/Raw/8.bmp
--------------------------------------------------------------------------------
/HBFA/UefiHostFuzzTestCasePkg/Seed/BMP/Raw/8_1.bmp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/intel/HBFA-FL/a803974fd721e973781e4ec144b894843f7ef567/HBFA/UefiHostFuzzTestCasePkg/Seed/BMP/Raw/8_1.bmp
--------------------------------------------------------------------------------
/HBFA/UefiHostFuzzTestCasePkg/Seed/BMP/Raw/sample.bmp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/intel/HBFA-FL/a803974fd721e973781e4ec144b894843f7ef567/HBFA/UefiHostFuzzTestCasePkg/Seed/BMP/Raw/sample.bmp
--------------------------------------------------------------------------------
/HBFA/UefiHostFuzzTestCasePkg/Seed/Blk/VirtioBlkFuzzSeed0.9.5.bin:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/intel/HBFA-FL/a803974fd721e973781e4ec144b894843f7ef567/HBFA/UefiHostFuzzTestCasePkg/Seed/Blk/VirtioBlkFuzzSeed0.9.5.bin
--------------------------------------------------------------------------------
/HBFA/UefiHostFuzzTestCasePkg/Seed/Blk/VirtioBlkFuzzSeed1.0.0.bin:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/intel/HBFA-FL/a803974fd721e973781e4ec144b894843f7ef567/HBFA/UefiHostFuzzTestCasePkg/Seed/Blk/VirtioBlkFuzzSeed1.0.0.bin
--------------------------------------------------------------------------------
/HBFA/UefiHostFuzzTestCasePkg/Seed/Blk/VirtioBlkFuzzSeed1.0.0_fix.bin:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/intel/HBFA-FL/a803974fd721e973781e4ec144b894843f7ef567/HBFA/UefiHostFuzzTestCasePkg/Seed/Blk/VirtioBlkFuzzSeed1.0.0_fix.bin
--------------------------------------------------------------------------------
/HBFA/UefiHostFuzzTestCasePkg/Seed/Capsule/MICROCODECAPSULE1.Cap:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/intel/HBFA-FL/a803974fd721e973781e4ec144b894843f7ef567/HBFA/UefiHostFuzzTestCasePkg/Seed/Capsule/MICROCODECAPSULE1.Cap
--------------------------------------------------------------------------------
/HBFA/UefiHostFuzzTestCasePkg/Seed/Capsule/QUARKFIRMWAREUPDATECAPSULEFMPPKCS7.Cap:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/intel/HBFA-FL/a803974fd721e973781e4ec144b894843f7ef567/HBFA/UefiHostFuzzTestCasePkg/Seed/Capsule/QUARKFIRMWAREUPDATECAPSULEFMPPKCS7.Cap
--------------------------------------------------------------------------------
/HBFA/UefiHostFuzzTestCasePkg/Seed/Capsule/QUARKREC.Cap:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/intel/HBFA-FL/a803974fd721e973781e4ec144b894843f7ef567/HBFA/UefiHostFuzzTestCasePkg/Seed/Capsule/QUARKREC.Cap
--------------------------------------------------------------------------------
/HBFA/UefiHostFuzzTestCasePkg/Seed/Cfv/cfv01.bin:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/intel/HBFA-FL/a803974fd721e973781e4ec144b894843f7ef567/HBFA/UefiHostFuzzTestCasePkg/Seed/Cfv/cfv01.bin
--------------------------------------------------------------------------------
/HBFA/UefiHostFuzzTestCasePkg/Seed/Cfv/securebootcfv01.bin:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/intel/HBFA-FL/a803974fd721e973781e4ec144b894843f7ef567/HBFA/UefiHostFuzzTestCasePkg/Seed/Cfv/securebootcfv01.bin
--------------------------------------------------------------------------------
/HBFA/UefiHostFuzzTestCasePkg/Seed/Gpt/Raw/Gpt.bin:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/intel/HBFA-FL/a803974fd721e973781e4ec144b894843f7ef567/HBFA/UefiHostFuzzTestCasePkg/Seed/Gpt/Raw/Gpt.bin
--------------------------------------------------------------------------------
/HBFA/UefiHostFuzzTestCasePkg/Seed/Gpt/Raw/Gpt_16384.bin:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/intel/HBFA-FL/a803974fd721e973781e4ec144b894843f7ef567/HBFA/UefiHostFuzzTestCasePkg/Seed/Gpt/Raw/Gpt_16384.bin
--------------------------------------------------------------------------------
/HBFA/UefiHostFuzzTestCasePkg/Seed/Gpt/Raw/Gpt_error.bin:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/intel/HBFA-FL/a803974fd721e973781e4ec144b894843f7ef567/HBFA/UefiHostFuzzTestCasePkg/Seed/Gpt/Raw/Gpt_error.bin
--------------------------------------------------------------------------------
/HBFA/UefiHostFuzzTestCasePkg/Seed/Include/Uefi.py:
--------------------------------------------------------------------------------
1 | # @file
2 | #
3 | # Copyright (c) 2018, Intel Corporation. All rights reserved.
4 | # SPDX-License-Identifier: BSD-2-Clause-Patent
5 | #
6 |
7 | import ctypes
8 |
9 |
10 | class EFI_GUID(ctypes.Structure):
11 | _fields_ = [
12 | ('Guid1', ctypes.c_uint32),
13 | ('Guid2', ctypes.c_uint16),
14 | ('Guid3', ctypes.c_uint16),
15 | ('Guid4', ctypes.ARRAY(ctypes.c_uint8, 8)),
16 | ]
17 |
18 |
19 | class EFI_TIME(ctypes.Structure):
20 | _fields_ = [
21 | ('Year', ctypes.c_uint16),
22 | ('Month', ctypes.c_uint8),
23 | ('Day', ctypes.c_uint8),
24 | ('Hour', ctypes.c_uint8),
25 | ('Minute', ctypes.c_uint8),
26 | ('Second', ctypes.c_uint8),
27 | ('Pad1', ctypes.c_uint8),
28 | ('Nanosecond', ctypes.c_uint32),
29 | ('TimeZone', ctypes.c_int16),
30 | ('Daylight', ctypes.c_uint8),
31 | ('Pad2', ctypes.c_uint8),
32 | ]
33 |
34 |
35 | EFI_VARIABLE_NON_VOLATILE = 0x00000001
36 | EFI_VARIABLE_BOOTSERVICE_ACCESS = 0x00000002
37 | EFI_VARIABLE_RUNTIME_ACCESS = 0x00000004
38 | EFI_VARIABLE_HARDWARE_ERROR_RECORD = 0x00000008
39 | EFI_VARIABLE_TIME_BASED_AUTHENTICATED_WRITE_ACCESS = 0x00000020
40 | EFI_VARIABLE_APPEND_WRITE = 0x00000040
41 | EFI_VARIABLE_AUTHENTICATED_WRITE_ACCESS = 0x00000010
42 |
--------------------------------------------------------------------------------
/HBFA/UefiHostFuzzTestCasePkg/Seed/Instruction/instruction000.bin:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/intel/HBFA-FL/a803974fd721e973781e4ec144b894843f7ef567/HBFA/UefiHostFuzzTestCasePkg/Seed/Instruction/instruction000.bin
--------------------------------------------------------------------------------
/HBFA/UefiHostFuzzTestCasePkg/Seed/Instruction/instruction001.bin:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/intel/HBFA-FL/a803974fd721e973781e4ec144b894843f7ef567/HBFA/UefiHostFuzzTestCasePkg/Seed/Instruction/instruction001.bin
--------------------------------------------------------------------------------
/HBFA/UefiHostFuzzTestCasePkg/Seed/Instruction/instruction002.bin:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/intel/HBFA-FL/a803974fd721e973781e4ec144b894843f7ef567/HBFA/UefiHostFuzzTestCasePkg/Seed/Instruction/instruction002.bin
--------------------------------------------------------------------------------
/HBFA/UefiHostFuzzTestCasePkg/Seed/Instruction/instruction003.bin:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/intel/HBFA-FL/a803974fd721e973781e4ec144b894843f7ef567/HBFA/UefiHostFuzzTestCasePkg/Seed/Instruction/instruction003.bin
--------------------------------------------------------------------------------
/HBFA/UefiHostFuzzTestCasePkg/Seed/Instruction/instruction004.bin:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/intel/HBFA-FL/a803974fd721e973781e4ec144b894843f7ef567/HBFA/UefiHostFuzzTestCasePkg/Seed/Instruction/instruction004.bin
--------------------------------------------------------------------------------
/HBFA/UefiHostFuzzTestCasePkg/Seed/Instruction/instruction005.bin:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/intel/HBFA-FL/a803974fd721e973781e4ec144b894843f7ef567/HBFA/UefiHostFuzzTestCasePkg/Seed/Instruction/instruction005.bin
--------------------------------------------------------------------------------
/HBFA/UefiHostFuzzTestCasePkg/Seed/Instruction/instruction006.bin:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/intel/HBFA-FL/a803974fd721e973781e4ec144b894843f7ef567/HBFA/UefiHostFuzzTestCasePkg/Seed/Instruction/instruction006.bin
--------------------------------------------------------------------------------
/HBFA/UefiHostFuzzTestCasePkg/Seed/Instruction/instruction007.bin:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/intel/HBFA-FL/a803974fd721e973781e4ec144b894843f7ef567/HBFA/UefiHostFuzzTestCasePkg/Seed/Instruction/instruction007.bin
--------------------------------------------------------------------------------
/HBFA/UefiHostFuzzTestCasePkg/Seed/Instruction/instruction008.bin:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/intel/HBFA-FL/a803974fd721e973781e4ec144b894843f7ef567/HBFA/UefiHostFuzzTestCasePkg/Seed/Instruction/instruction008.bin
--------------------------------------------------------------------------------
/HBFA/UefiHostFuzzTestCasePkg/Seed/Instruction/instruction009.bin:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/intel/HBFA-FL/a803974fd721e973781e4ec144b894843f7ef567/HBFA/UefiHostFuzzTestCasePkg/Seed/Instruction/instruction009.bin
--------------------------------------------------------------------------------
/HBFA/UefiHostFuzzTestCasePkg/Seed/Instruction/instruction010.bin:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/intel/HBFA-FL/a803974fd721e973781e4ec144b894843f7ef567/HBFA/UefiHostFuzzTestCasePkg/Seed/Instruction/instruction010.bin
--------------------------------------------------------------------------------
/HBFA/UefiHostFuzzTestCasePkg/Seed/Instruction/instruction011.bin:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/intel/HBFA-FL/a803974fd721e973781e4ec144b894843f7ef567/HBFA/UefiHostFuzzTestCasePkg/Seed/Instruction/instruction011.bin
--------------------------------------------------------------------------------
/HBFA/UefiHostFuzzTestCasePkg/Seed/Instruction/instruction012.bin:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/intel/HBFA-FL/a803974fd721e973781e4ec144b894843f7ef567/HBFA/UefiHostFuzzTestCasePkg/Seed/Instruction/instruction012.bin
--------------------------------------------------------------------------------
/HBFA/UefiHostFuzzTestCasePkg/Seed/Instruction/instruction013.bin:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/intel/HBFA-FL/a803974fd721e973781e4ec144b894843f7ef567/HBFA/UefiHostFuzzTestCasePkg/Seed/Instruction/instruction013.bin
--------------------------------------------------------------------------------
/HBFA/UefiHostFuzzTestCasePkg/Seed/Instruction/instruction014.bin:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/intel/HBFA-FL/a803974fd721e973781e4ec144b894843f7ef567/HBFA/UefiHostFuzzTestCasePkg/Seed/Instruction/instruction014.bin
--------------------------------------------------------------------------------
/HBFA/UefiHostFuzzTestCasePkg/Seed/Instruction/instruction015.bin:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/intel/HBFA-FL/a803974fd721e973781e4ec144b894843f7ef567/HBFA/UefiHostFuzzTestCasePkg/Seed/Instruction/instruction015.bin
--------------------------------------------------------------------------------
/HBFA/UefiHostFuzzTestCasePkg/Seed/Instruction/instruction016.bin:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/intel/HBFA-FL/a803974fd721e973781e4ec144b894843f7ef567/HBFA/UefiHostFuzzTestCasePkg/Seed/Instruction/instruction016.bin
--------------------------------------------------------------------------------
/HBFA/UefiHostFuzzTestCasePkg/Seed/Instruction/instruction017.bin:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/intel/HBFA-FL/a803974fd721e973781e4ec144b894843f7ef567/HBFA/UefiHostFuzzTestCasePkg/Seed/Instruction/instruction017.bin
--------------------------------------------------------------------------------
/HBFA/UefiHostFuzzTestCasePkg/Seed/Instruction/instruction018.bin:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/intel/HBFA-FL/a803974fd721e973781e4ec144b894843f7ef567/HBFA/UefiHostFuzzTestCasePkg/Seed/Instruction/instruction018.bin
--------------------------------------------------------------------------------
/HBFA/UefiHostFuzzTestCasePkg/Seed/Instruction/instruction019.bin:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/intel/HBFA-FL/a803974fd721e973781e4ec144b894843f7ef567/HBFA/UefiHostFuzzTestCasePkg/Seed/Instruction/instruction019.bin
--------------------------------------------------------------------------------
/HBFA/UefiHostFuzzTestCasePkg/Seed/Instruction/instruction020.bin:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/intel/HBFA-FL/a803974fd721e973781e4ec144b894843f7ef567/HBFA/UefiHostFuzzTestCasePkg/Seed/Instruction/instruction020.bin
--------------------------------------------------------------------------------
/HBFA/UefiHostFuzzTestCasePkg/Seed/Instruction/instruction021.bin:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/intel/HBFA-FL/a803974fd721e973781e4ec144b894843f7ef567/HBFA/UefiHostFuzzTestCasePkg/Seed/Instruction/instruction021.bin
--------------------------------------------------------------------------------
/HBFA/UefiHostFuzzTestCasePkg/Seed/Instruction/instruction022.bin:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/intel/HBFA-FL/a803974fd721e973781e4ec144b894843f7ef567/HBFA/UefiHostFuzzTestCasePkg/Seed/Instruction/instruction022.bin
--------------------------------------------------------------------------------
/HBFA/UefiHostFuzzTestCasePkg/Seed/Instruction/instruction023.bin:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/intel/HBFA-FL/a803974fd721e973781e4ec144b894843f7ef567/HBFA/UefiHostFuzzTestCasePkg/Seed/Instruction/instruction023.bin
--------------------------------------------------------------------------------
/HBFA/UefiHostFuzzTestCasePkg/Seed/Instruction/instruction024.bin:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/intel/HBFA-FL/a803974fd721e973781e4ec144b894843f7ef567/HBFA/UefiHostFuzzTestCasePkg/Seed/Instruction/instruction024.bin
--------------------------------------------------------------------------------
/HBFA/UefiHostFuzzTestCasePkg/Seed/Instruction/instruction025.bin:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/intel/HBFA-FL/a803974fd721e973781e4ec144b894843f7ef567/HBFA/UefiHostFuzzTestCasePkg/Seed/Instruction/instruction025.bin
--------------------------------------------------------------------------------
/HBFA/UefiHostFuzzTestCasePkg/Seed/Instruction/instruction026.bin:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/intel/HBFA-FL/a803974fd721e973781e4ec144b894843f7ef567/HBFA/UefiHostFuzzTestCasePkg/Seed/Instruction/instruction026.bin
--------------------------------------------------------------------------------
/HBFA/UefiHostFuzzTestCasePkg/Seed/SignatureList/SignatureList.raw:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/intel/HBFA-FL/a803974fd721e973781e4ec144b894843f7ef567/HBFA/UefiHostFuzzTestCasePkg/Seed/SignatureList/SignatureList.raw
--------------------------------------------------------------------------------
/HBFA/UefiHostFuzzTestCasePkg/Seed/TPM/Raw/Tpm2Res.bin:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/intel/HBFA-FL/a803974fd721e973781e4ec144b894843f7ef567/HBFA/UefiHostFuzzTestCasePkg/Seed/TPM/Raw/Tpm2Res.bin
--------------------------------------------------------------------------------
/HBFA/UefiHostFuzzTestCasePkg/Seed/TdxHob/hob.bin:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/intel/HBFA-FL/a803974fd721e973781e4ec144b894843f7ef567/HBFA/UefiHostFuzzTestCasePkg/Seed/TdxHob/hob.bin
--------------------------------------------------------------------------------
/HBFA/UefiHostFuzzTestCasePkg/Seed/UDF/Raw/FileName/0:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/intel/HBFA-FL/a803974fd721e973781e4ec144b894843f7ef567/HBFA/UefiHostFuzzTestCasePkg/Seed/UDF/Raw/FileName/0
--------------------------------------------------------------------------------
/HBFA/UefiHostFuzzTestCasePkg/Seed/UDF/Raw/FileName/1:
--------------------------------------------------------------------------------
1 | \
--------------------------------------------------------------------------------
/HBFA/UefiHostFuzzTestCasePkg/Seed/UDF/Raw/FileName/2:
--------------------------------------------------------------------------------
1 | .
--------------------------------------------------------------------------------
/HBFA/UefiHostFuzzTestCasePkg/Seed/UDF/Raw/FileName/22:
--------------------------------------------------------------------------------
1 | . .
--------------------------------------------------------------------------------
/HBFA/UefiHostFuzzTestCasePkg/Seed/UDF/Raw/FileName/__a:
--------------------------------------------------------------------------------
1 | . . . a
--------------------------------------------------------------------------------
/HBFA/UefiHostFuzzTestCasePkg/Seed/UDF/Raw/FileName/a:
--------------------------------------------------------------------------------
1 | a
--------------------------------------------------------------------------------
/HBFA/UefiHostFuzzTestCasePkg/Seed/UDF/Raw/FileName/b:
--------------------------------------------------------------------------------
1 | b
--------------------------------------------------------------------------------
/HBFA/UefiHostFuzzTestCasePkg/Seed/UDF/Raw/FileName/b_a:
--------------------------------------------------------------------------------
1 | . \ \ b \ \ a
--------------------------------------------------------------------------------
/HBFA/UefiHostFuzzTestCasePkg/Seed/UDF/Raw/FileName/b_c:
--------------------------------------------------------------------------------
1 | b \ c
--------------------------------------------------------------------------------
/HBFA/UefiHostFuzzTestCasePkg/Seed/UDF/Raw/FileName/blink:
--------------------------------------------------------------------------------
1 | b _ l i n k
--------------------------------------------------------------------------------
/HBFA/UefiHostFuzzTestCasePkg/Seed/UDF/Raw/FileName/blink_a:
--------------------------------------------------------------------------------
1 | b _ l i n k \ a
--------------------------------------------------------------------------------
/HBFA/UefiHostFuzzTestCasePkg/Seed/UDF/Raw/FileName/blink_alink:
--------------------------------------------------------------------------------
1 | b _ l i n k \ a _ l i n k
--------------------------------------------------------------------------------
/HBFA/UefiHostFuzzTestCasePkg/Seed/UDF/Raw/FileName/blink_c_:
--------------------------------------------------------------------------------
1 | b _ l i n k \ c \
--------------------------------------------------------------------------------
/HBFA/UefiHostFuzzTestCasePkg/Seed/UDF/Raw/FileSystem/test_123.bin:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/intel/HBFA-FL/a803974fd721e973781e4ec144b894843f7ef567/HBFA/UefiHostFuzzTestCasePkg/Seed/UDF/Raw/FileSystem/test_123.bin
--------------------------------------------------------------------------------
/HBFA/UefiHostFuzzTestCasePkg/Seed/UDF/Raw/FileSystem/test_a.bin:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/intel/HBFA-FL/a803974fd721e973781e4ec144b894843f7ef567/HBFA/UefiHostFuzzTestCasePkg/Seed/UDF/Raw/FileSystem/test_a.bin
--------------------------------------------------------------------------------
/HBFA/UefiHostFuzzTestCasePkg/Seed/UDF/Raw/FileSystem/test_a_0.bin:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/intel/HBFA-FL/a803974fd721e973781e4ec144b894843f7ef567/HBFA/UefiHostFuzzTestCasePkg/Seed/UDF/Raw/FileSystem/test_a_0.bin
--------------------------------------------------------------------------------
/HBFA/UefiHostFuzzTestCasePkg/Seed/UDF/Raw/FileSystem/test_a_e1.bin:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/intel/HBFA-FL/a803974fd721e973781e4ec144b894843f7ef567/HBFA/UefiHostFuzzTestCasePkg/Seed/UDF/Raw/FileSystem/test_a_e1.bin
--------------------------------------------------------------------------------
/HBFA/UefiHostFuzzTestCasePkg/Seed/UDF/Raw/FileSystem/test_a_mm.bin:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/intel/HBFA-FL/a803974fd721e973781e4ec144b894843f7ef567/HBFA/UefiHostFuzzTestCasePkg/Seed/UDF/Raw/FileSystem/test_a_mm.bin
--------------------------------------------------------------------------------
/HBFA/UefiHostFuzzTestCasePkg/Seed/UDF/Raw/FileSystem/test_a_mm_f.bin:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/intel/HBFA-FL/a803974fd721e973781e4ec144b894843f7ef567/HBFA/UefiHostFuzzTestCasePkg/Seed/UDF/Raw/FileSystem/test_a_mm_f.bin
--------------------------------------------------------------------------------
/HBFA/UefiHostFuzzTestCasePkg/Seed/UDF/Raw/FileSystem/test_a_mm_ff.bin:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/intel/HBFA-FL/a803974fd721e973781e4ec144b894843f7ef567/HBFA/UefiHostFuzzTestCasePkg/Seed/UDF/Raw/FileSystem/test_a_mm_ff.bin
--------------------------------------------------------------------------------
/HBFA/UefiHostFuzzTestCasePkg/Seed/UDF/Raw/FileSystem/test_all.bin:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/intel/HBFA-FL/a803974fd721e973781e4ec144b894843f7ef567/HBFA/UefiHostFuzzTestCasePkg/Seed/UDF/Raw/FileSystem/test_all.bin
--------------------------------------------------------------------------------
/HBFA/UefiHostFuzzTestCasePkg/Seed/UDF/Raw/FileSystem/test_ca.bin:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/intel/HBFA-FL/a803974fd721e973781e4ec144b894843f7ef567/HBFA/UefiHostFuzzTestCasePkg/Seed/UDF/Raw/FileSystem/test_ca.bin
--------------------------------------------------------------------------------
/HBFA/UefiHostFuzzTestCasePkg/Seed/UDF/Raw/FileSystem/test_udf.bin:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/intel/HBFA-FL/a803974fd721e973781e4ec144b894843f7ef567/HBFA/UefiHostFuzzTestCasePkg/Seed/UDF/Raw/FileSystem/test_udf.bin
--------------------------------------------------------------------------------
/HBFA/UefiHostFuzzTestCasePkg/Seed/UDF/Raw/FileSystem/test_udf_fid.bin:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/intel/HBFA-FL/a803974fd721e973781e4ec144b894843f7ef567/HBFA/UefiHostFuzzTestCasePkg/Seed/UDF/Raw/FileSystem/test_udf_fid.bin
--------------------------------------------------------------------------------
/HBFA/UefiHostFuzzTestCasePkg/Seed/UDF/Raw/FileSystem/test_udf_m.bin:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/intel/HBFA-FL/a803974fd721e973781e4ec144b894843f7ef567/HBFA/UefiHostFuzzTestCasePkg/Seed/UDF/Raw/FileSystem/test_udf_m.bin
--------------------------------------------------------------------------------
/HBFA/UefiHostFuzzTestCasePkg/Seed/UDF/Raw/FileSystem/test_udf_m1.bin:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/intel/HBFA-FL/a803974fd721e973781e4ec144b894843f7ef567/HBFA/UefiHostFuzzTestCasePkg/Seed/UDF/Raw/FileSystem/test_udf_m1.bin
--------------------------------------------------------------------------------
/HBFA/UefiHostFuzzTestCasePkg/Seed/UDF/Raw/FileSystem/test_udf_m3.bin:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/intel/HBFA-FL/a803974fd721e973781e4ec144b894843f7ef567/HBFA/UefiHostFuzzTestCasePkg/Seed/UDF/Raw/FileSystem/test_udf_m3.bin
--------------------------------------------------------------------------------
/HBFA/UefiHostFuzzTestCasePkg/Seed/UDF/Raw/FileSystem/test_udf_m4.bin:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/intel/HBFA-FL/a803974fd721e973781e4ec144b894843f7ef567/HBFA/UefiHostFuzzTestCasePkg/Seed/UDF/Raw/FileSystem/test_udf_m4.bin
--------------------------------------------------------------------------------
/HBFA/UefiHostFuzzTestCasePkg/Seed/UDF/Raw/FileSystem/test_udf_m5_16.bin:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/intel/HBFA-FL/a803974fd721e973781e4ec144b894843f7ef567/HBFA/UefiHostFuzzTestCasePkg/Seed/UDF/Raw/FileSystem/test_udf_m5_16.bin
--------------------------------------------------------------------------------
/HBFA/UefiHostFuzzTestCasePkg/Seed/UDF/Raw/FileSystem/test_udf_m5_17.bin:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/intel/HBFA-FL/a803974fd721e973781e4ec144b894843f7ef567/HBFA/UefiHostFuzzTestCasePkg/Seed/UDF/Raw/FileSystem/test_udf_m5_17.bin
--------------------------------------------------------------------------------
/HBFA/UefiHostFuzzTestCasePkg/Seed/UDF/Raw/FileSystem/test_udf_m5_double.bin:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/intel/HBFA-FL/a803974fd721e973781e4ec144b894843f7ef567/HBFA/UefiHostFuzzTestCasePkg/Seed/UDF/Raw/FileSystem/test_udf_m5_double.bin
--------------------------------------------------------------------------------
/HBFA/UefiHostFuzzTestCasePkg/Seed/UDF/Raw/Partition/Udf_linux.bin:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/intel/HBFA-FL/a803974fd721e973781e4ec144b894843f7ef567/HBFA/UefiHostFuzzTestCasePkg/Seed/UDF/Raw/Partition/Udf_linux.bin
--------------------------------------------------------------------------------
/HBFA/UefiHostFuzzTestCasePkg/Seed/UDF/Raw/Partition/test000008.seed:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/intel/HBFA-FL/a803974fd721e973781e4ec144b894843f7ef567/HBFA/UefiHostFuzzTestCasePkg/Seed/UDF/Raw/Partition/test000008.seed
--------------------------------------------------------------------------------
/HBFA/UefiHostFuzzTestCasePkg/Seed/UDF/Raw/Partition/test000011.seed:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/intel/HBFA-FL/a803974fd721e973781e4ec144b894843f7ef567/HBFA/UefiHostFuzzTestCasePkg/Seed/UDF/Raw/Partition/test000011.seed
--------------------------------------------------------------------------------
/HBFA/UefiHostFuzzTestCasePkg/Seed/UDF/Raw/Partition/test000012.seed:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/intel/HBFA-FL/a803974fd721e973781e4ec144b894843f7ef567/HBFA/UefiHostFuzzTestCasePkg/Seed/UDF/Raw/Partition/test000012.seed
--------------------------------------------------------------------------------
/HBFA/UefiHostFuzzTestCasePkg/Seed/UDF/Raw/Partition/test000013.seed:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/intel/HBFA-FL/a803974fd721e973781e4ec144b894843f7ef567/HBFA/UefiHostFuzzTestCasePkg/Seed/UDF/Raw/Partition/test000013.seed
--------------------------------------------------------------------------------
/HBFA/UefiHostFuzzTestCasePkg/Seed/UDF/Raw/Partition/test000014.seed:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/intel/HBFA-FL/a803974fd721e973781e4ec144b894843f7ef567/HBFA/UefiHostFuzzTestCasePkg/Seed/UDF/Raw/Partition/test000014.seed
--------------------------------------------------------------------------------
/HBFA/UefiHostFuzzTestCasePkg/Seed/UDF/Raw/Partition/test000015.seed:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/intel/HBFA-FL/a803974fd721e973781e4ec144b894843f7ef567/HBFA/UefiHostFuzzTestCasePkg/Seed/UDF/Raw/Partition/test000015.seed
--------------------------------------------------------------------------------
/HBFA/UefiHostFuzzTestCasePkg/Seed/UDF/Raw/Partition/test000016.seed:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/intel/HBFA-FL/a803974fd721e973781e4ec144b894843f7ef567/HBFA/UefiHostFuzzTestCasePkg/Seed/UDF/Raw/Partition/test000016.seed
--------------------------------------------------------------------------------
/HBFA/UefiHostFuzzTestCasePkg/Seed/UDF/Raw/Partition/test000017.seed:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/intel/HBFA-FL/a803974fd721e973781e4ec144b894843f7ef567/HBFA/UefiHostFuzzTestCasePkg/Seed/UDF/Raw/Partition/test000017.seed
--------------------------------------------------------------------------------
/HBFA/UefiHostFuzzTestCasePkg/Seed/UDF/Raw/Partition/test000018.seed:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/intel/HBFA-FL/a803974fd721e973781e4ec144b894843f7ef567/HBFA/UefiHostFuzzTestCasePkg/Seed/UDF/Raw/Partition/test000018.seed
--------------------------------------------------------------------------------
/HBFA/UefiHostFuzzTestCasePkg/Seed/UDF/Raw/Partition/test000021.seed:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/intel/HBFA-FL/a803974fd721e973781e4ec144b894843f7ef567/HBFA/UefiHostFuzzTestCasePkg/Seed/UDF/Raw/Partition/test000021.seed
--------------------------------------------------------------------------------
/HBFA/UefiHostFuzzTestCasePkg/Seed/UDF/Raw/Partition/test000022.seed:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/intel/HBFA-FL/a803974fd721e973781e4ec144b894843f7ef567/HBFA/UefiHostFuzzTestCasePkg/Seed/UDF/Raw/Partition/test000022.seed
--------------------------------------------------------------------------------
/HBFA/UefiHostFuzzTestCasePkg/Seed/UDF/Raw/Partition/test000023.seed:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/intel/HBFA-FL/a803974fd721e973781e4ec144b894843f7ef567/HBFA/UefiHostFuzzTestCasePkg/Seed/UDF/Raw/Partition/test000023.seed
--------------------------------------------------------------------------------
/HBFA/UefiHostFuzzTestCasePkg/Seed/UDF/Raw/readme.txt:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/intel/HBFA-FL/a803974fd721e973781e4ec144b894843f7ef567/HBFA/UefiHostFuzzTestCasePkg/Seed/UDF/Raw/readme.txt
--------------------------------------------------------------------------------
/HBFA/UefiHostFuzzTestCasePkg/Seed/UDF/Script/__init__.py:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/intel/HBFA-FL/a803974fd721e973781e4ec144b894843f7ef567/HBFA/UefiHostFuzzTestCasePkg/Seed/UDF/Script/__init__.py
--------------------------------------------------------------------------------
/HBFA/UefiHostFuzzTestCasePkg/Seed/USB/Raw/Usb.bin:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/intel/HBFA-FL/a803974fd721e973781e4ec144b894843f7ef567/HBFA/UefiHostFuzzTestCasePkg/Seed/USB/Raw/Usb.bin
--------------------------------------------------------------------------------
/HBFA/UefiHostFuzzTestCasePkg/Seed/VariableSmm/Raw/VarSmm.bin:
--------------------------------------------------------------------------------
1 | Hello World!
--------------------------------------------------------------------------------
/HBFA/UefiHostFuzzTestCasePkg/TestCase/DeviceSecurityPkg/TestSignatureList/TestSignatureList.c:
--------------------------------------------------------------------------------
1 | /** @file
2 |
3 | Copyright (c) 2022, Intel Corporation. All rights reserved.
4 | SPDX-License-Identifier: BSD-2-Clause-Patent
5 |
6 | **/
7 |
8 | #include
9 | #include
10 | #include
11 | #include
12 |
13 | #include
14 |
15 | #include
16 | #include
17 | #include
18 | #include
19 | #include
20 |
21 | #define TOTAL_SIZE (512 * 1024)
22 | /* 384 kB */
23 | #define MAX_LEN (384 * 1024)
24 |
25 | VOID
26 | FixBuffer (
27 | UINT8 *TestBuffer
28 | )
29 | {
30 | }
31 |
32 | UINTN
33 | EFIAPI
34 | GetMaxBufferSize (
35 | VOID
36 | )
37 | {
38 | return TOTAL_SIZE;
39 | }
40 |
41 | VOID
42 | EFIAPI
43 | RunTestHarness(
44 | IN VOID *TestBuffer,
45 | IN UINTN TestBufferSize
46 | )
47 | {
48 | Traverse_SignatureList(TestBuffer, TestBufferSize);
49 | }
50 |
--------------------------------------------------------------------------------
/HBFA/UefiHostFuzzTestCasePkg/TestCase/DeviceSecurityPkg/TestSignatureList/TestSignatureList.inf:
--------------------------------------------------------------------------------
1 | ## @file
2 | # SPDM library.
3 | #
4 | # Copyright (c) 2020, Intel Corporation. All rights reserved.
5 | #
6 | # SPDX-License-Identifier: BSD-2-Clause-Patent
7 | #
8 | ##
9 |
10 | [Defines]
11 | INF_VERSION = 0x00010005
12 | BASE_NAME = TestSignatureList
13 | FILE_GUID = 77D7770D-158E-4354-B813-B8792A0E982F
14 | MODULE_TYPE = USER_DEFINED
15 | VERSION_STRING = 1.0
16 |
17 | #
18 | # The following information is for reference only and not required by the build tools.
19 | #
20 | # VALID_ARCHITECTURES = IA32 X64 AARCH64
21 | #
22 |
23 | [Sources]
24 | TestSignatureList.c
25 |
26 | [Packages]
27 | MdePkg/MdePkg.dec
28 | MdeModulePkg/MdeModulePkg.dec
29 | DeviceSecurityPkg/DeviceSecurityPkg.dec
30 | CryptoPkg/CryptoPkg.dec
31 | UefiHostTestPkg/UefiHostTestPkg.dec
32 |
33 | [LibraryClasses]
34 | BaseLib
35 | BaseMemoryLib
36 | DebugLib
37 | RngLib
38 | MemoryAllocationLib
39 | ToolChainHarnessLib
40 | TestSignListLib
41 |
42 | [Guids]
43 | gEdkiiDeviceSignatureDatabaseGuid ## CONSUMES
44 | gEfiCertX509Guid ## CONSUMES
45 |
--------------------------------------------------------------------------------
/HBFA/UefiHostFuzzTestCasePkg/TestCase/FatPkg/FatPei/InstrumentHookLibTestPeiGpt/InstrumentHookLibTestPeiGpt.inf:
--------------------------------------------------------------------------------
1 | ## @file
2 | # Component description file for TestUdf module.
3 | #
4 | # Copyright (c) 2018, Intel Corporation. All rights reserved.
5 | # SPDX-License-Identifier: BSD-2-Clause-Patent
6 | #
7 | ##
8 |
9 | [Defines]
10 | INF_VERSION = 0x00010005
11 | BASE_NAME = InstrumentHookLibTestPeiGpt
12 | FILE_GUID = 0D208A61-B4BA-488D-85E9-4C12F533EE67
13 | MODULE_TYPE = BASE
14 | VERSION_STRING = 1.0
15 | LIBRARY_CLASS = InstrumentHookLib
16 |
17 | #
18 | # The following information is for reference only and not required by the build tools.
19 | #
20 | # VALID_ARCHITECTURES = IA32 X64
21 | #
22 |
23 | [Sources]
24 | InstrumentHookLibTestPeiGpt.c
25 |
26 | [Packages]
27 | MdePkg/MdePkg.dec
28 | MdeModulePkg/MdeModulePkg.dec
29 | UefiInstrumentTestPkg/UefiInstrumentTestPkg.dec
30 | UefiHostTestPkg/UefiHostTestPkg.dec
31 |
32 | [LibraryClasses]
33 | BaseLib
34 | BaseMemoryLib
35 | MemoryAllocationLib
36 | DebugLib
37 | IniParsingLib
38 |
39 | [BuildOptions]
40 | MSFT:*_*_*_CC_FLAGS = /Od /GL-
41 | GCC:*_*_*_CC_FLAGS = -O0
42 |
--------------------------------------------------------------------------------
/HBFA/UefiHostFuzzTestCasePkg/TestCase/FatPkg/FatPei/Override/FatLiteLib.c:
--------------------------------------------------------------------------------
1 | /** @file
2 | General purpose supporting routines for FAT recovery PEIM
3 |
4 | Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.
5 |
6 | SPDX-License-Identifier: BSD-2-Clause-Patent
7 |
8 | **/
9 |
10 | #include "FatLitePeim.h"
11 |
12 | EFI_STATUS
13 | FatReadBlock (
14 | IN PEI_FAT_PRIVATE_DATA *PrivateData,
15 | IN UINTN BlockDeviceNo,
16 | IN EFI_PEI_LBA Lba,
17 | IN UINTN BufferSize,
18 | OUT VOID *Buffer
19 | )
20 | {
21 | PEI_FAT_BLOCK_DEVICE *BlockDev;
22 |
23 | if (BlockDeviceNo > PEI_FAT_MAX_BLOCK_DEVICE - 1) {
24 | return EFI_DEVICE_ERROR;
25 | }
26 |
27 | BlockDev = &(PrivateData->BlockDevice[BlockDeviceNo]);
28 |
29 | if (BufferSize > MultU64x32 (BlockDev->LastBlock - Lba + 1, BlockDev->BlockSize)) {
30 | return EFI_DEVICE_ERROR;
31 | }
32 |
33 | if (Buffer == NULL) {
34 | return EFI_INVALID_PARAMETER;
35 | }
36 |
37 | if (BufferSize == 0) {
38 | return EFI_SUCCESS;
39 | }
40 |
41 | if ((BufferSize % BlockDev->BlockSize) != 0) {
42 | return EFI_BAD_BUFFER_SIZE;
43 | }
44 |
45 | if (Lba > BlockDev->LastBlock) {
46 | return EFI_INVALID_PARAMETER;
47 | }
48 |
49 | CopyMem(
50 | Buffer,
51 | (VOID *)(UINTN)(BlockDev->StartingPos + MultU64x32(Lba, BlockDev->BlockSize)),
52 | BufferSize
53 | );
54 |
55 | return EFI_SUCCESS;
56 | }
--------------------------------------------------------------------------------
/HBFA/UefiHostFuzzTestCasePkg/TestCase/FatPkg/FatPei/TestPeiGpt.inf:
--------------------------------------------------------------------------------
1 | ## @file
2 | # Component description file for TestPeiGpt module.
3 | #
4 | # Copyright (c) 2018, Intel Corporation. All rights reserved.
5 | # SPDX-License-Identifier: BSD-2-Clause-Patent
6 | #
7 | ##
8 |
9 | [Defines]
10 | INF_VERSION = 0x00010005
11 | BASE_NAME = TestPeiGpt
12 | FILE_GUID = 70823DB1-63E0-4F4F-9161-ECB21AAEF520
13 | MODULE_TYPE = USER_DEFINED
14 | VERSION_STRING = 1.0
15 |
16 | #
17 | # The following information is for reference only and not required by the build tools.
18 | #
19 | # VALID_ARCHITECTURES = IA32 X64
20 | #
21 |
22 | [Sources]
23 | TestPeiGpt.c
24 | FatPkg/FatPei/FatLiteApi.h
25 | FatPkg/FatPei/FatLitePeim.h
26 | FatPkg/FatPei/FatLiteFmt.h
27 |
28 | [Packages]
29 | MdePkg/MdePkg.dec
30 | MdeModulePkg/MdeModulePkg.dec
31 | UefiHostTestPkg/UefiHostTestPkg.dec
32 |
33 | [LibraryClasses]
34 | BaseLib
35 | BaseMemoryLib
36 | MemoryAllocationLib
37 | DebugLib
38 | ToolChainHarnessLib
39 |
40 | [Guids]
41 | gEfiPartTypeUnusedGuid
42 |
43 |
--------------------------------------------------------------------------------
/HBFA/UefiHostFuzzTestCasePkg/TestCase/MdeModulePkg/Bus/Ata/AhciPei/TestIdentifyAtaDevice.inf:
--------------------------------------------------------------------------------
1 | ## @file
2 | # Component description file for TestIdentifyAtaDevice module.
3 | #
4 | # Copyright (c) 2018, Intel Corporation. All rights reserved.
5 | # SPDX-License-Identifier: BSD-2-Clause-Patent
6 | #
7 | ##
8 |
9 | [Defines]
10 | INF_VERSION = 0x00010005
11 | BASE_NAME = TestIdentifyAtaDevice
12 | FILE_GUID = CFDACAD0-E720-4F6F-A023-448851EEFB93
13 | MODULE_TYPE = USER_DEFINED
14 | VERSION_STRING = 1.0
15 |
16 | #
17 | # The following information is for reference only and not required by the build tools.
18 | #
19 | # VALID_ARCHITECTURES = IA32 X64
20 | #
21 |
22 | [Sources]
23 | TestIdentifyAtaDevice.c
24 | Override/AhciPei.h
25 |
26 | [Packages]
27 | MdePkg/MdePkg.dec
28 | MdeModulePkg/MdeModulePkg.dec
29 | UefiHostFuzzTestCasePkg/UefiHostFuzzTestCasePkg.dec
30 | UefiHostTestPkg/UefiHostTestPkg.dec
31 |
32 | [LibraryClasses]
33 | BaseLib
34 | BaseMemoryLib
35 | MemoryAllocationLib
36 | PeiServicesLib
37 | IoLib
38 | DebugLib
39 | TimerLib
40 | LockBoxLib
41 | ToolChainHarnessLib
42 |
43 | [Ppis]
44 | gEdkiiIoMmuPpiGuid ## CONSUMES
45 |
46 | [BuildOptions]
47 | MSFT:*_*_*_CC_FLAGS = /Od /GL-
48 |
--------------------------------------------------------------------------------
/HBFA/UefiHostFuzzTestCasePkg/TestCase/MdeModulePkg/Bus/Usb/UsbBusDxe/TestUsb.c:
--------------------------------------------------------------------------------
1 | /** @file
2 |
3 | Copyright (c) 2018, Intel Corporation. All rights reserved.
4 | SPDX-License-Identifier: BSD-2-Clause-Patent
5 |
6 | **/
7 |
8 | #include
9 | #include
10 | #include
11 | #include
12 |
13 | #include
14 |
15 | #include
16 | #include
17 | #include
18 | #include
19 | #include
20 |
21 | #include "UsbBus.h"
22 |
23 | #define TOTAL_SIZE (512 * 1024)
24 |
25 | EFI_STATUS
26 | UsbBuildDescTable (
27 | IN USB_DEVICE *UsbDev
28 | );
29 |
30 | VOID
31 | FixBuffer (
32 | UINT8 *TestBuffer
33 | )
34 | {
35 | }
36 |
37 | UINTN
38 | EFIAPI
39 | GetMaxBufferSize (
40 | VOID
41 | )
42 | {
43 | return TOTAL_SIZE;
44 | }
45 |
46 | VOID
47 | EFIAPI
48 | RunTestHarness(
49 | IN VOID *TestBuffer,
50 | IN UINTN TestBufferSize
51 | )
52 | {
53 | USB_DEVICE UsbDev;
54 | USB_BUS Bus;
55 | EFI_USB2_HC_PROTOCOL *Usb2Hc;
56 |
57 | Usb2HcStubInitialize (NULL, 0, TestBuffer, TestBufferSize, NULL, 0, &Usb2Hc);
58 |
59 | UsbDev.Bus = &Bus;
60 | Bus.Usb2Hc = Usb2Hc;
61 |
62 | UsbBuildDescTable (&UsbDev);
63 | UsbFreeDevice (&UsbDev);
64 | }
65 |
--------------------------------------------------------------------------------
/HBFA/UefiHostFuzzTestCasePkg/TestCase/MdeModulePkg/Bus/Usb/UsbBusDxe/TestUsb.inf:
--------------------------------------------------------------------------------
1 | ## @file
2 | # Component description file for TestUsb module.
3 | #
4 | # Copyright (c) 2018, Intel Corporation. All rights reserved.
5 | # SPDX-License-Identifier: BSD-2-Clause-Patent
6 | #
7 | ##
8 |
9 | [Defines]
10 | INF_VERSION = 0x00010005
11 | BASE_NAME = TestUsb
12 | FILE_GUID = CFDACAD0-E720-4F6F-A023-448851EEFB93
13 | MODULE_TYPE = USER_DEFINED
14 | VERSION_STRING = 1.0
15 |
16 | #
17 | # The following information is for reference only and not required by the build tools.
18 | #
19 | # VALID_ARCHITECTURES = IA32 X64
20 | #
21 |
22 | [Sources]
23 | TestUsb.c
24 | MdeModulePkg/Bus/Usb/UsbBusDxe/UsbBus.h
25 |
26 | [Packages]
27 | MdePkg/MdePkg.dec
28 | UefiHostTestPkg/UefiHostTestPkg.dec
29 | UefiHostFuzzTestCasePkg/UefiHostFuzzTestCasePkg.dec
30 |
31 | [LibraryClasses]
32 | BaseLib
33 | BaseMemoryLib
34 | MemoryAllocationLib
35 | DebugLib
36 | UefiBootServicesTableLib
37 | Usb2HcStubLib
38 | ToolChainHarnessLib
39 |
--------------------------------------------------------------------------------
/HBFA/UefiHostFuzzTestCasePkg/TestCase/MdeModulePkg/Bus/Usb/UsbBusPei/TestPeiUsb.inf:
--------------------------------------------------------------------------------
1 | ## @file
2 | # Component description file for TestPeiUsb module.
3 | #
4 | # Copyright (c) 2018, Intel Corporation. All rights reserved.
5 | # SPDX-License-Identifier: BSD-2-Clause-Patent
6 | #
7 | ##
8 |
9 | [Defines]
10 | INF_VERSION = 0x00010005
11 | BASE_NAME = TestPeiUsb
12 | FILE_GUID = E47055D6-D042-4846-83AE-A7AE8AA5D581
13 | MODULE_TYPE = USER_DEFINED
14 | VERSION_STRING = 1.0
15 |
16 | #
17 | # The following information is for reference only and not required by the build tools.
18 | #
19 | # VALID_ARCHITECTURES = IA32 X64
20 | #
21 |
22 | [Sources]
23 | TestPeiUsb.c
24 | MdeModulePkg/Bus/Usb/UsbBusPei/UsbPeim.h
25 |
26 | [Packages]
27 | MdePkg/MdePkg.dec
28 | MdeModulePkg/MdeModulePkg.dec
29 | UefiHostTestPkg/UefiHostTestPkg.dec
30 | UefiHostFuzzTestCasePkg/UefiHostFuzzTestCasePkg.dec
31 |
32 | [LibraryClasses]
33 | BaseLib
34 | BaseMemoryLib
35 | MemoryAllocationLib
36 | DebugLib
37 | TimerLib
38 | UsbIoPpiStubLib
39 | ToolChainHarnessLib
40 |
--------------------------------------------------------------------------------
/HBFA/UefiHostFuzzTestCasePkg/TestCase/MdeModulePkg/Library/BaseBmpSupportLib/TestBmpSupportLib.inf:
--------------------------------------------------------------------------------
1 | ## @file
2 | # Component description file for TestBmpSupportLib module.
3 | #
4 | # Copyright (c) 2018, Intel Corporation. All rights reserved.
5 | # SPDX-License-Identifier: BSD-2-Clause-Patent
6 | #
7 | ##
8 |
9 | [Defines]
10 | INF_VERSION = 0x00010005
11 | BASE_NAME = TestBmpSupportLib
12 | FILE_GUID = E911AB26-4741-4621-93EF-305FEA98A851
13 | MODULE_TYPE = USER_DEFINED
14 | VERSION_STRING = 1.0
15 |
16 | #
17 | # The following information is for reference only and not required by the build tools.
18 | #
19 | # VALID_ARCHITECTURES = IA32 X64
20 | #
21 |
22 | [Sources]
23 | TestBmpSupportLib.c
24 |
25 | [Packages]
26 | MdePkg/MdePkg.dec
27 | MdeModulePkg/MdeModulePkg.dec
28 | UefiHostTestPkg/UefiHostTestPkg.dec
29 |
30 |
31 | [LibraryClasses]
32 | BaseLib
33 | BaseMemoryLib
34 | MemoryAllocationLib
35 | DebugLib
36 | SafeIntLib
37 | BmpSupportLib
38 | ToolChainHarnessLib
39 |
--------------------------------------------------------------------------------
/HBFA/UefiHostFuzzTestCasePkg/TestCase/MdeModulePkg/Universal/CapsulePei/Common/TestCapsulePei.inf:
--------------------------------------------------------------------------------
1 | ## @file
2 | # Component description file for TestDxeCapsulePei module.
3 | #
4 | # Copyright (c) 2018, Intel Corporation. All rights reserved.
5 | # SPDX-License-Identifier: BSD-2-Clause-Patent
6 | #
7 | ##
8 |
9 | [Defines]
10 | INF_VERSION = 0x00010005
11 | BASE_NAME = TestCapsulePei
12 | FILE_GUID = 23C9CE4E-26BB-4850-A3E2-5AEA95963F87
13 | MODULE_TYPE = USER_DEFINED
14 | VERSION_STRING = 1.0
15 |
16 | #
17 | # The following information is for reference only and not required by the build tools.
18 | #
19 | # VALID_ARCHITECTURES = IA32 X64
20 | #
21 |
22 | [Sources]
23 | TestCapsulePei.c
24 | MdeModulePkg/Universal/CapsulePei/Common/CommonHeader.h
25 |
26 | [Packages]
27 | MdePkg/MdePkg.dec
28 | MdeModulePkg/MdeModulePkg.dec
29 | UefiHostTestPkg/UefiHostTestPkg.dec
30 |
31 | [LibraryClasses]
32 | BaseLib
33 | BaseMemoryLib
34 | MemoryAllocationLib
35 | DebugLib
36 | ToolChainHarnessLib
37 |
--------------------------------------------------------------------------------
/HBFA/UefiHostFuzzTestCasePkg/TestCase/MdeModulePkg/Universal/Disk/PartitionDxe/InstrumentHookLibTestPartition/InstrumentHookLibTestPartition.inf:
--------------------------------------------------------------------------------
1 | ## @file
2 | # Component description file for TestUdf module.
3 | #
4 | # Copyright (c) 2018, Intel Corporation. All rights reserved.
5 | # SPDX-License-Identifier: BSD-2-Clause-Patent
6 | #
7 | ##
8 |
9 | [Defines]
10 | INF_VERSION = 0x00010005
11 | BASE_NAME = InstrumentHookLibTestPartition
12 | FILE_GUID = B61898FA-92D7-47D9-8751-6E4F82F55B7F
13 | MODULE_TYPE = BASE
14 | VERSION_STRING = 1.0
15 | LIBRARY_CLASS = InstrumentHookLib
16 |
17 | #
18 | # The following information is for reference only and not required by the build tools.
19 | #
20 | # VALID_ARCHITECTURES = IA32 X64
21 | #
22 |
23 | [Sources]
24 | InstrumentHookLibTestPartition.c
25 |
26 | [Packages]
27 | MdePkg/MdePkg.dec
28 | UefiInstrumentTestPkg/UefiInstrumentTestPkg.dec
29 | UefiHostTestPkg/UefiHostTestPkg.dec
30 |
31 | [LibraryClasses]
32 | BaseLib
33 | BaseMemoryLib
34 | MemoryAllocationLib
35 | DebugLib
36 | IniParsingLib
37 |
38 | [BuildOptions]
39 | MSFT:*_*_*_CC_FLAGS = /Od /GL-
40 | GCC:*_*_*_CC_FLAGS = -O0
41 |
--------------------------------------------------------------------------------
/HBFA/UefiHostFuzzTestCasePkg/TestCase/MdeModulePkg/Universal/Disk/PartitionDxe/TestPartition.inf:
--------------------------------------------------------------------------------
1 | ## @file
2 | # Component description file for TestPartition module.
3 | #
4 | # Copyright (c) 2018, Intel Corporation. All rights reserved.
5 | # SPDX-License-Identifier: BSD-2-Clause-Patent
6 | #
7 | ##
8 |
9 | [Defines]
10 | INF_VERSION = 0x00010005
11 | BASE_NAME = TestPartition
12 | FILE_GUID = 9420FB50-57EC-4609-92B3-A57589037933
13 | MODULE_TYPE = USER_DEFINED
14 | VERSION_STRING = 1.0
15 |
16 | #
17 | # The following information is for reference only and not required by the build tools.
18 | #
19 | # VALID_ARCHITECTURES = IA32 X64
20 | #
21 |
22 | [Sources]
23 | TestPartition.c
24 |
25 | [Packages]
26 | MdePkg/MdePkg.dec
27 | UefiHostTestPkg/UefiHostTestPkg.dec
28 | UefiHostFuzzTestCasePkg/UefiHostFuzzTestCasePkg.dec
29 |
30 | [LibraryClasses]
31 | BaseLib
32 | BaseMemoryLib
33 | MemoryAllocationLib
34 | DebugLib
35 | DiskStubLib
36 | ToolChainHarnessLib
37 |
--------------------------------------------------------------------------------
/HBFA/UefiHostFuzzTestCasePkg/TestCase/MdeModulePkg/Universal/Disk/UdfDxe/InstrumentHookLibTestUdf/InstrumentHookLibTestUdf.inf:
--------------------------------------------------------------------------------
1 | ## @file
2 | # Component description file for TestUdf module.
3 | #
4 | # Copyright (c) 2018, Intel Corporation. All rights reserved.
5 | # SPDX-License-Identifier: BSD-2-Clause-Patent
6 | #
7 | ##
8 |
9 | [Defines]
10 | INF_VERSION = 0x00010005
11 | BASE_NAME = InstrumentHookLibTestUdf
12 | FILE_GUID = F9BE464E-3E19-4BE9-B6F1-D560A0031CAD
13 | MODULE_TYPE = BASE
14 | VERSION_STRING = 1.0
15 | LIBRARY_CLASS = InstrumentHookLib
16 |
17 | #
18 | # The following information is for reference only and not required by the build tools.
19 | #
20 | # VALID_ARCHITECTURES = IA32 X64
21 | #
22 |
23 | [Sources]
24 | InstrumentHookLibTestUdf.c
25 |
26 | [Packages]
27 | MdePkg/MdePkg.dec
28 | UefiInstrumentTestPkg/UefiInstrumentTestPkg.dec
29 | UefiHostTestPkg/UefiHostTestPkg.dec
30 |
31 | [LibraryClasses]
32 | BaseLib
33 | BaseMemoryLib
34 | MemoryAllocationLib
35 | DebugLib
36 | IniParsingLib
37 |
38 | [BuildOptions]
39 | MSFT:*_*_*_CC_FLAGS = /Od /GL-
40 | GCC:*_*_*_CC_FLAGS = -O0
41 |
--------------------------------------------------------------------------------
/HBFA/UefiHostFuzzTestCasePkg/TestCase/MdeModulePkg/Universal/Disk/UdfDxe/TestFileName.c:
--------------------------------------------------------------------------------
1 | /** @file
2 |
3 | Copyright (c) 2018, Intel Corporation. All rights reserved.
4 | SPDX-License-Identifier: BSD-2-Clause-Patent
5 |
6 | **/
7 |
8 | #include
9 | #include
10 | #include
11 | #include
12 |
13 | #include
14 | #include
15 | #include
16 | #include
17 | #include
18 |
19 | #define MAX_FILENAME_LEN 4096
20 |
21 | CHAR16 *
22 | MangleFileName (
23 | IN CHAR16 *FileName
24 | );
25 |
26 | UINTN
27 | EFIAPI
28 | GetMaxBufferSize (
29 | VOID
30 | )
31 | {
32 | return MAX_FILENAME_LEN;
33 | }
34 |
35 | VOID
36 | EFIAPI
37 | RunTestHarness(
38 | IN VOID *TestBuffer,
39 | IN UINTN TestBufferSize
40 | )
41 | {
42 | UINT8 *_TestBuffer = (UINT8*)TestBuffer;
43 | UINTN Index;
44 |
45 | // Only caller in edk2 ensures string is properly NULL-terminated
46 | if ( TestBufferSize > MAX_FILENAME_LEN-sizeof(L'\0') )
47 | Index = MAX_FILENAME_LEN - sizeof(L'\0');
48 | else
49 | Index = TestBufferSize;
50 |
51 | _TestBuffer[Index] = L'\0';
52 |
53 | MangleFileName((CHAR16*)TestBuffer);
54 | }
55 |
--------------------------------------------------------------------------------
/HBFA/UefiHostFuzzTestCasePkg/TestCase/MdeModulePkg/Universal/Disk/UdfDxe/TestFileName.inf:
--------------------------------------------------------------------------------
1 | ## @file
2 | # Component description file for TestUdf module.
3 | #
4 | # Copyright (c) 2018, Intel Corporation. All rights reserved.
5 | # SPDX-License-Identifier: BSD-2-Clause-Patent
6 | #
7 | ##
8 |
9 | [Defines]
10 | INF_VERSION = 0x00010005
11 | BASE_NAME = TestFileName
12 | FILE_GUID = 451C64D2-84B4-4DC1-BBE7-BBA46603C16B
13 | MODULE_TYPE = USER_DEFINED
14 | VERSION_STRING = 1.0
15 |
16 | #
17 | # The following information is for reference only and not required by the build tools.
18 | #
19 | # VALID_ARCHITECTURES = IA32 X64
20 | #
21 |
22 | [Sources]
23 | TestFileName.c
24 |
25 | [Packages]
26 | MdePkg/MdePkg.dec
27 | UefiHostTestPkg/UefiHostTestPkg.dec
28 |
29 | [LibraryClasses]
30 | BaseLib
31 | BaseMemoryLib
32 | MemoryAllocationLib
33 | DebugLib
34 | UefiBootServicesTableLib
35 | ToolChainHarnessLib
36 |
--------------------------------------------------------------------------------
/HBFA/UefiHostFuzzTestCasePkg/TestCase/MdeModulePkg/Universal/Disk/UdfDxe/TestUdf.inf:
--------------------------------------------------------------------------------
1 | ## @file
2 | # Component description file for TestUdf module.
3 | #
4 | # Copyright (c) 2018, Intel Corporation. All rights reserved.
5 | # SPDX-License-Identifier: BSD-2-Clause-Patent
6 | #
7 | ##
8 |
9 | [Defines]
10 | INF_VERSION = 0x00010005
11 | BASE_NAME = TestUdf
12 | FILE_GUID = 045C4491-29E5-4357-A939-897A757FB31F
13 | MODULE_TYPE = USER_DEFINED
14 | VERSION_STRING = 1.0
15 |
16 | #
17 | # The following information is for reference only and not required by the build tools.
18 | #
19 | # VALID_ARCHITECTURES = IA32 X64
20 | #
21 |
22 | [Sources]
23 | TestUdf.c
24 | MdeModulePkg/Universal/Disk/UdfDxe/Udf.h
25 |
26 | [Packages]
27 | MdePkg/MdePkg.dec
28 | UefiHostTestPkg/UefiHostTestPkg.dec
29 | UefiHostFuzzTestCasePkg/UefiHostFuzzTestCasePkg.dec
30 | UefiInstrumentTestPkg/UefiInstrumentTestPkg.dec
31 |
32 | [LibraryClasses]
33 | BaseLib
34 | BaseMemoryLib
35 | MemoryAllocationLib
36 | DebugLib
37 | UefiBootServicesTableLib
38 | DiskStubLib
39 | ToolChainHarnessLib
40 |
41 | [Guids]
42 | gEfiFileInfoGuid
43 | gEfiFileSystemInfoGuid
44 | gEfiFileSystemVolumeLabelInfoIdGuid
45 |
--------------------------------------------------------------------------------
/HBFA/UefiHostFuzzTestCasePkg/TestCase/MdeModulePkg/Universal/Variable/RuntimeDxe/TestVariableSmm.inf:
--------------------------------------------------------------------------------
1 | ## @file
2 | # Component description file for TestVariableSmm module.
3 | #
4 | # Copyright (c) 2018, Intel Corporation. All rights reserved.
5 | # SPDX-License-Identifier: BSD-2-Clause-Patent
6 | #
7 | ##
8 |
9 | [Defines]
10 | INF_VERSION = 0x00010005
11 | BASE_NAME = TestVariableSmm
12 | FILE_GUID = E911AB26-4741-4621-93EF-305FEA98A851
13 | MODULE_TYPE = USER_DEFINED
14 | VERSION_STRING = 1.0
15 |
16 | #
17 | # The following information is for reference only and not required by the build tools.
18 | #
19 | # VALID_ARCHITECTURES = IA32 X64
20 | #
21 |
22 | [Sources]
23 | TestVariableSmm.c
24 | MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.h
25 |
26 | [Packages]
27 | MdePkg/MdePkg.dec
28 | MdeModulePkg/MdeModulePkg.dec
29 | UefiHostTestPkg/UefiHostTestPkg.dec
30 | UefiHostFuzzTestCasePkg/UefiHostFuzzTestCasePkg.dec
31 |
32 | [LibraryClasses]
33 | BaseLib
34 | BaseMemoryLib
35 | MemoryAllocationLib
36 | DebugLib
37 | SmmMemLib
38 | SmmMemLibStubLib
39 | ToolChainHarnessLib
40 |
--------------------------------------------------------------------------------
/HBFA/UefiHostFuzzTestCasePkg/TestCase/OvmfPkg/EmuVariableFvbRuntimeDxe/TestValidateTdxCfv.inf:
--------------------------------------------------------------------------------
1 | ## @file
2 | #
3 | # Copyright (c) 2008 - 2021, Intel Corporation. All rights reserved.
4 | #
5 | # SPDX-License-Identifier: BSD-2-Clause-Patent
6 | #
7 | ##
8 |
9 | [Defines]
10 | INF_VERSION = 0x00010005
11 | BASE_NAME = TestValidateTdxCfv
12 | FILE_GUID = 22dc2b60-fe40-a2ac-b02f-3ab1fad9aad8
13 | MODULE_TYPE = USER_DEFINED
14 | VERSION_STRING = 1.0
15 |
16 | #
17 | # The following information is for reference only and not required by the build tools.
18 | #
19 | # VALID_ARCHITECTURES = IA32 X64 EBC
20 | #
21 |
22 | [Sources]
23 | TestValidateTdxCfv.c
24 |
25 | [Packages]
26 | MdePkg/MdePkg.dec
27 | MdeModulePkg/MdeModulePkg.dec
28 | OvmfPkg/OvmfPkg.dec
29 | OvmfPkg/OvmfPkg.dec
30 | UefiHostTestPkg/UefiHostTestPkg.dec
31 | UefiHostFuzzTestCasePkg/UefiHostFuzzTestCasePkg.dec
32 | [Pcd]
33 | gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwSpareSize|0x40000
34 | [LibraryClasses]
35 | BaseLib
36 | BaseMemoryLib
37 | DebugLib
38 | MemoryAllocationLib
39 | DxeServicesTableLib
40 | HobLib
41 | PcdLib
42 | UefiBootServicesTableLib
43 | UefiDriverEntryPoint
44 | UefiLib
45 | ToolChainHarnessLib
46 | PlatformInitLib
47 |
--------------------------------------------------------------------------------
/HBFA/UefiHostFuzzTestCasePkg/TestCase/OvmfPkg/Virtio10BlkDxe/TestVirtio10Blk.inf:
--------------------------------------------------------------------------------
1 | ## @file
2 | # Component description file for TestUsb module.
3 | #
4 | # Copyright (c) 2018, Intel Corporation. All rights reserved.
5 | # SPDX-License-Identifier: BSD-2-Clause-Patent
6 | #
7 | ##
8 |
9 | [Defines]
10 | INF_VERSION = 0x00010005
11 | BASE_NAME = TestVirtio10Blk
12 | FILE_GUID = 7AF4DF33-6FED-4FCD-A393-C80D76BA9702
13 | MODULE_TYPE = USER_DEFINED
14 | VERSION_STRING = 1.0
15 |
16 | #
17 | # The following information is for reference only and not required by the build tools.
18 | #
19 | # VALID_ARCHITECTURES = IA32 X64
20 | #
21 |
22 | [Sources]
23 | TestVirtio10Blk.c
24 |
25 | [Packages]
26 | MdePkg/MdePkg.dec
27 | OvmfPkg/OvmfPkg.dec
28 | UefiHostTestPkg/UefiHostTestPkg.dec
29 | UefiHostFuzzTestCasePkg/UefiHostFuzzTestCasePkg.dec
30 |
31 | [LibraryClasses]
32 | BaseMemoryLib
33 | DebugLib
34 | MemoryAllocationLib
35 | UefiDriverEntryPoint
36 | UefiLib
37 | VirtioLib
38 | VirtioPciDevice10StubLib
39 | VirtioBlkStubLib
40 | ToolChainHarnessLib
--------------------------------------------------------------------------------
/HBFA/UefiHostFuzzTestCasePkg/TestCase/OvmfPkg/VirtioBlkDxe/TestVirtioBlk.inf:
--------------------------------------------------------------------------------
1 | ## @file
2 | # Component description file for TestUsb module.
3 | #
4 | # Copyright (c) 2018, Intel Corporation. All rights reserved.
5 | # SPDX-License-Identifier: BSD-2-Clause-Patent
6 | #
7 | ##
8 |
9 | [Defines]
10 | INF_VERSION = 0x00010005
11 | BASE_NAME = TestVirtioBlk
12 | FILE_GUID = 7AF4DF33-6FED-4FCD-A393-C80D76BA9702
13 | MODULE_TYPE = USER_DEFINED
14 | VERSION_STRING = 1.0
15 |
16 | #
17 | # The following information is for reference only and not required by the build tools.
18 | #
19 | # VALID_ARCHITECTURES = IA32 X64
20 | #
21 |
22 | [Sources]
23 | TestVirtioBlk.c
24 |
25 | [Packages]
26 | MdePkg/MdePkg.dec
27 | OvmfPkg/OvmfPkg.dec
28 | UefiHostTestPkg/UefiHostTestPkg.dec
29 | UefiHostFuzzTestCasePkg/UefiHostFuzzTestCasePkg.dec
30 |
31 | [LibraryClasses]
32 | BaseMemoryLib
33 | DebugLib
34 | MemoryAllocationLib
35 | UefiDriverEntryPoint
36 | UefiLib
37 | VirtioLib
38 | VirtioPciDevice10StubLib
39 | VirtioBlkStubLib
40 | ToolChainHarnessLib
--------------------------------------------------------------------------------
/HBFA/UefiHostFuzzTestCasePkg/TestCase/OvmfPkg/VirtioBlkReadWrite/TestVirtioBlkReadWrite.inf:
--------------------------------------------------------------------------------
1 | ## @file
2 | # Component description file for TestUsb module.
3 | #
4 | # Copyright (c) 2018, Intel Corporation. All rights reserved.
5 | # SPDX-License-Identifier: BSD-2-Clause-Patent
6 | #
7 | ##
8 |
9 | [Defines]
10 | INF_VERSION = 0x00010005
11 | BASE_NAME = TestVirtioBlkReadWrite
12 | FILE_GUID = 7AF4DF33-6FED-44CD-A393-C80D76BA9701
13 | MODULE_TYPE = USER_DEFINED
14 | VERSION_STRING = 1.0
15 |
16 | #
17 | # The following information is for reference only and not required by the build tools.
18 | #
19 | # VALID_ARCHITECTURES = IA32 X64
20 | #
21 |
22 | [Sources]
23 | TestVirtioBlkReadWrite.c
24 |
25 | [Packages]
26 | MdePkg/MdePkg.dec
27 | OvmfPkg/OvmfPkg.dec
28 | UefiHostTestPkg/UefiHostTestPkg.dec
29 | UefiHostFuzzTestCasePkg/UefiHostFuzzTestCasePkg.dec
30 |
31 | [LibraryClasses]
32 | BaseMemoryLib
33 | DebugLib
34 | MemoryAllocationLib
35 | UefiDriverEntryPoint
36 | UefiLib
37 | VirtioLib
38 | VirtioPciDevice10StubLib
39 | VirtioBlkStubLib
40 | ToolChainHarnessLib
--------------------------------------------------------------------------------
/HBFA/UefiHostFuzzTestCasePkg/TestCase/OvmfPkg/VirtioPciDeviceDxe/TestVirtioPciDevice.inf:
--------------------------------------------------------------------------------
1 | ## @file
2 | # Component description file for TestUsb module.
3 | #
4 | # Copyright (c) 2018, Intel Corporation. All rights reserved.
5 | # SPDX-License-Identifier: BSD-2-Clause-Patent
6 | #
7 | ##
8 |
9 | [Defines]
10 | INF_VERSION = 0x00010005
11 | BASE_NAME = TestVirtioPciDevice
12 | FILE_GUID = 7AF4DF33-6FED-4FCD-A313-C80D76BA9602
13 | MODULE_TYPE = USER_DEFINED
14 | VERSION_STRING = 1.0
15 |
16 | #
17 | # The following information is for reference only and not required by the build tools.
18 | #
19 | # VALID_ARCHITECTURES = IA32 X64
20 | #
21 |
22 | [Sources]
23 | TestVirtioPciDevice.c
24 |
25 | [Packages]
26 | MdePkg/MdePkg.dec
27 | OvmfPkg/OvmfPkg.dec
28 | UefiHostTestPkg/UefiHostTestPkg.dec
29 | UefiHostFuzzTestCasePkg/UefiHostFuzzTestCasePkg.dec
30 |
31 | [LibraryClasses]
32 | BaseMemoryLib
33 | DebugLib
34 | MemoryAllocationLib
35 | UefiBootServicesTableLib
36 | UefiDriverEntryPoint
37 | UefiLib
38 | ToolChainHarnessLib
39 | VirtioPciDevice10StubLib
40 |
--------------------------------------------------------------------------------
/HBFA/UefiHostFuzzTestCasePkg/TestCase/SecurityPkg/Library/DxeTpm2MeasureBootLib/TestTcg2MeasurePeImage.inf:
--------------------------------------------------------------------------------
1 | ## @file
2 | #
3 | # Copyright (c) 2020, Intel Corporation. All rights reserved.
4 | # SPDX-License-Identifier: BSD-2-Clause-Patent
5 | #
6 | ##
7 |
8 | [Defines]
9 | INF_VERSION = 0x00010005
10 | BASE_NAME = TestTcg2MeasurePeImage
11 | FILE_GUID = 778DF4F4-36BD-4ae7-B2F0-10B434B0D164
12 | MODULE_TYPE = USER_DEFINED
13 | VERSION_STRING = 1.0
14 |
15 | #
16 | # The following information is for reference only and not required by the build tools.
17 | #
18 | # VALID_ARCHITECTURES = X64
19 | #
20 |
21 | [Sources]
22 | TestTcg2MeasurePeImage.c
23 |
24 | [Packages]
25 | MdePkg/MdePkg.dec
26 | MdeModulePkg/MdeModulePkg.dec
27 | OvmfPkg/OvmfPkg.dec
28 | SecurityPkg/SecurityPkg.dec
29 | CryptoPkg/CryptoPkg.dec
30 | UefiHostTestPkg/UefiHostTestPkg.dec
31 | UefiHostFuzzTestCasePkg/UefiHostFuzzTestCasePkg.dec
32 |
33 | [LibraryClasses]
34 | BaseMemoryLib
35 | DebugLib
36 | MemoryAllocationLib
37 | BaseLib
38 | DiskStubLib
39 | Tcg2StubLib
40 | UefiBootServicesTableLib
41 | DevicePathLib
42 | ToolChainHarnessLib
--------------------------------------------------------------------------------
/HBFA/UefiHostFuzzTestCasePkg/TestCase/SecurityPkg/Library/FmpAuthenticationLibPkcs7/CryptoLibStubPkcs7.inf:
--------------------------------------------------------------------------------
1 | ## @file
2 | # Component description file for TestTpm2CommandLib module.
3 | #
4 | # Copyright (c) 2018, Intel Corporation. All rights reserved.
5 | # SPDX-License-Identifier: BSD-2-Clause-Patent
6 | #
7 | ##
8 |
9 | [Defines]
10 | INF_VERSION = 0x00010005
11 | BASE_NAME = CryptoLibStubPkcs7
12 | FILE_GUID = C9FE7135-3EDA-4E4A-AB1F-EB4DD74A85CA
13 | MODULE_TYPE = BASE
14 | VERSION_STRING = 1.0
15 | LIBRARY_CLASS = BaseCryptLib
16 |
17 | #
18 | # The following information is for reference only and not required by the build tools.
19 | #
20 | # VALID_ARCHITECTURES = IA32 X64
21 | #
22 |
23 | [Sources]
24 | CryptoStubPkcs7.c
25 |
26 | [Packages]
27 | MdePkg/MdePkg.dec
28 | MdeModulePkg/MdeModulePkg.dec
29 | CryptoPkg/CryptoPkg.dec
30 | SecurityPkg/SecurityPkg.dec
31 | UefiHostTestPkg/UefiHostTestPkg.dec
32 | UefiHostFuzzTestCasePkg/UefiHostFuzzTestCasePkg.dec
33 |
34 | [LibraryClasses]
35 | BaseLib
36 | BaseMemoryLib
37 | MemoryAllocationLib
38 | DebugLib
39 | ToolChainHarnessLib
40 |
41 | [Guids]
42 | gEfiCertPkcs7Guid
43 |
44 |
--------------------------------------------------------------------------------
/HBFA/UefiHostFuzzTestCasePkg/TestCase/SecurityPkg/Library/FmpAuthenticationLibPkcs7/CryptoStubPkcs7.c:
--------------------------------------------------------------------------------
1 | /** @file
2 |
3 | Copyright (c) 2018, Intel Corporation. All rights reserved.
4 | SPDX-License-Identifier: BSD-2-Clause-Patent
5 |
6 | **/
7 |
8 | #include
9 |
10 | BOOLEAN
11 | EFIAPI
12 | Pkcs7Verify (
13 | IN CONST UINT8 *P7Data,
14 | IN UINTN P7Length,
15 | IN CONST UINT8 *TrustedCert,
16 | IN UINTN CertLength,
17 | IN CONST UINT8 *InData,
18 | IN UINTN DataLength
19 | )
20 | {
21 | return TRUE;
22 | }
23 |
--------------------------------------------------------------------------------
/HBFA/UefiHostFuzzTestCasePkg/TestCase/SecurityPkg/Library/FmpAuthenticationLibPkcs7/TestFmpAuthenticationLibPkcs7.c:
--------------------------------------------------------------------------------
1 | /** @file
2 |
3 | Copyright (c) 2018, Intel Corporation. All rights reserved.
4 | SPDX-License-Identifier: BSD-2-Clause-Patent
5 |
6 | **/
7 |
8 | #include
9 | #include
10 | #include
11 | #include
12 |
13 | #include
14 | #include
15 | #include
16 |
17 | #include
18 | #include
19 | #include
20 | #include
21 | #include
22 |
23 | #include
24 |
25 | #define TOTAL_SIZE (512 * 1024)
26 |
27 | extern UINT8 mPkcs7PublicKeyData[];
28 | extern UINTN mPkcs7PublicKeyDataSize;
29 |
30 | VOID
31 | FixBuffer (
32 | UINT8 *TestBuffer
33 | )
34 | {
35 | }
36 |
37 | UINTN
38 | EFIAPI
39 | GetMaxBufferSize (
40 | VOID
41 | )
42 | {
43 | return TOTAL_SIZE;
44 | }
45 |
46 | VOID
47 | EFIAPI
48 | RunTestHarness(
49 | IN VOID *TestBuffer,
50 | IN UINTN TestBufferSize
51 | )
52 | {
53 | FixBuffer (TestBuffer);
54 | AuthenticateFmpImage (TestBuffer, TestBufferSize, mPkcs7PublicKeyData, mPkcs7PublicKeyDataSize);
55 | }
56 |
--------------------------------------------------------------------------------
/HBFA/UefiHostFuzzTestCasePkg/TestCase/SecurityPkg/Library/FmpAuthenticationLibPkcs7/TestFmpAuthenticationLibPkcs7.inf:
--------------------------------------------------------------------------------
1 | ## @file
2 | # Component description file for TestTpm2CommandLib module.
3 | #
4 | # Copyright (c) 2018, Intel Corporation. All rights reserved.
5 | # SPDX-License-Identifier: BSD-2-Clause-Patent
6 | #
7 | ##
8 |
9 | [Defines]
10 | INF_VERSION = 0x00010005
11 | BASE_NAME = TestFmpAuthenticationLibPkcs7
12 | FILE_GUID = 671711BA-ED88-46D3-99E6-A690E7C301F0
13 | MODULE_TYPE = USER_DEFINED
14 | VERSION_STRING = 1.0
15 |
16 | #
17 | # The following information is for reference only and not required by the build tools.
18 | #
19 | # VALID_ARCHITECTURES = IA32 X64
20 | #
21 |
22 | [Sources]
23 | TestFmpAuthenticationLibPkcs7.c
24 | SamplePkcs7.c
25 |
26 | [Packages]
27 | MdePkg/MdePkg.dec
28 | MdeModulePkg/MdeModulePkg.dec
29 | CryptoPkg/CryptoPkg.dec
30 | SecurityPkg/SecurityPkg.dec
31 | UefiHostTestPkg/UefiHostTestPkg.dec
32 | UefiHostFuzzTestCasePkg/UefiHostFuzzTestCasePkg.dec
33 |
34 | [LibraryClasses]
35 | BaseLib
36 | BaseMemoryLib
37 | MemoryAllocationLib
38 | DebugLib
39 | FmpAuthenticationLib
40 | ToolChainHarnessLib
41 |
42 | [Guids]
43 | gEfiCertPkcs7Guid
44 |
45 |
--------------------------------------------------------------------------------
/HBFA/UefiHostFuzzTestCasePkg/TestCase/SecurityPkg/Library/FmpAuthenticationLibRsa2048Sha256/CryptoLibStubRsa2048Sha256.inf:
--------------------------------------------------------------------------------
1 | ## @file
2 | # Component description file for TestTpm2CommandLib module.
3 | #
4 | # Copyright (c) 2018, Intel Corporation. All rights reserved.
5 | # SPDX-License-Identifier: BSD-2-Clause-Patent
6 | #
7 | ##
8 |
9 | [Defines]
10 | INF_VERSION = 0x00010005
11 | BASE_NAME = CryptoLibStubRsa2048Sha256
12 | FILE_GUID = 2826B09D-AEEA-4BB4-876F-1A025BF43752
13 | MODULE_TYPE = BASE
14 | VERSION_STRING = 1.0
15 | LIBRARY_CLASS = BaseCryptLib
16 |
17 | #
18 | # The following information is for reference only and not required by the build tools.
19 | #
20 | # VALID_ARCHITECTURES = IA32 X64
21 | #
22 |
23 | [Sources]
24 | CryptoStubRsa2048Sha256.c
25 |
26 | [Packages]
27 | MdePkg/MdePkg.dec
28 | MdeModulePkg/MdeModulePkg.dec
29 | CryptoPkg/CryptoPkg.dec
30 | SecurityPkg/SecurityPkg.dec
31 | UefiHostTestPkg/UefiHostTestPkg.dec
32 | UefiHostFuzzTestCasePkg/UefiHostFuzzTestCasePkg.dec
33 |
34 | [LibraryClasses]
35 | BaseLib
36 | BaseMemoryLib
37 | MemoryAllocationLib
38 | DebugLib
39 | ToolChainHarnessLib
40 |
41 | [Guids]
42 | gEfiCertPkcs7Guid
43 |
44 |
--------------------------------------------------------------------------------
/HBFA/UefiHostFuzzTestCasePkg/TestCase/SecurityPkg/Library/FmpAuthenticationLibRsa2048Sha256/SampleRsa2048Sha256.c:
--------------------------------------------------------------------------------
1 | /** @file
2 |
3 | Copyright (c) 2018, Intel Corporation. All rights reserved.
4 | SPDX-License-Identifier: BSD-2-Clause-Patent
5 |
6 | **/
7 |
8 | #include
9 |
10 | UINT8 mRsa2048Sha256PublicKeyData[] = {0x91, 0x29, 0xc4, 0xbd, 0xea, 0x6d, 0xda, 0xb3, 0xaa, 0x6f, 0x50, 0x16, 0xfc, 0xdb, 0x4b, 0x7e, 0x3c, 0xd6, 0xdc, 0xa4, 0x7a, 0x0e, 0xdd, 0xe6, 0x15, 0x8c, 0x73, 0x96, 0xa2, 0xd4, 0xa6, 0x4d};
11 | UINTN mRsa2048Sha256PublicKeyDataSize = sizeof(mRsa2048Sha256PublicKeyData);
12 |
--------------------------------------------------------------------------------
/HBFA/UefiHostFuzzTestCasePkg/TestCase/SecurityPkg/Library/FmpAuthenticationLibRsa2048Sha256/TestFmpAuthenticationLibRsa2048Sha256.c:
--------------------------------------------------------------------------------
1 | /** @file
2 |
3 | Copyright (c) 2018, Intel Corporation. All rights reserved.
4 | SPDX-License-Identifier: BSD-2-Clause-Patent
5 |
6 | **/
7 |
8 | #include
9 | #include
10 | #include
11 | #include
12 |
13 | #include
14 | #include
15 | #include
16 |
17 | #include
18 | #include
19 | #include
20 | #include
21 | #include
22 |
23 | #include
24 |
25 | #define TOTAL_SIZE (512 * 1024)
26 |
27 | extern UINT8 mRsa2048Sha256PublicKeyData[];
28 | extern UINTN mRsa2048Sha256PublicKeyDataSize;
29 |
30 | VOID
31 | FixBuffer (
32 | UINT8 *TestBuffer
33 | )
34 | {
35 | }
36 |
37 | UINTN
38 | EFIAPI
39 | GetMaxBufferSize (
40 | VOID
41 | )
42 | {
43 | return TOTAL_SIZE;
44 | }
45 |
46 | VOID
47 | EFIAPI
48 | RunTestHarness(
49 | IN VOID *TestBuffer,
50 | IN UINTN TestBufferSize
51 | )
52 | {
53 | FixBuffer (TestBuffer);
54 | AuthenticateFmpImage (TestBuffer, TestBufferSize, mRsa2048Sha256PublicKeyData, mRsa2048Sha256PublicKeyDataSize);
55 | }
56 |
--------------------------------------------------------------------------------
/HBFA/UefiHostFuzzTestCasePkg/TestCase/SecurityPkg/Library/FmpAuthenticationLibRsa2048Sha256/TestFmpAuthenticationLibRsa2048Sha256.inf:
--------------------------------------------------------------------------------
1 | ## @file
2 | # Component description file for TestTpm2CommandLib module.
3 | #
4 | # Copyright (c) 2018, Intel Corporation. All rights reserved.
5 | # SPDX-License-Identifier: BSD-2-Clause-Patent
6 | #
7 | ##
8 |
9 | [Defines]
10 | INF_VERSION = 0x00010005
11 | BASE_NAME = TestFmpAuthenticationLibRsa2048Sha256
12 | FILE_GUID = 22914CAE-62CD-450E-BCC7-9A69C0EF9C93
13 | MODULE_TYPE = USER_DEFINED
14 | VERSION_STRING = 1.0
15 |
16 | #
17 | # The following information is for reference only and not required by the build tools.
18 | #
19 | # VALID_ARCHITECTURES = IA32 X64
20 | #
21 |
22 | [Sources]
23 | TestFmpAuthenticationLibRsa2048Sha256.c
24 | SampleRsa2048Sha256.c
25 |
26 | [Packages]
27 | MdePkg/MdePkg.dec
28 | MdeModulePkg/MdeModulePkg.dec
29 | CryptoPkg/CryptoPkg.dec
30 | SecurityPkg/SecurityPkg.dec
31 | UefiHostTestPkg/UefiHostTestPkg.dec
32 | UefiHostFuzzTestCasePkg/UefiHostFuzzTestCasePkg.dec
33 |
34 | [LibraryClasses]
35 | BaseLib
36 | BaseMemoryLib
37 | MemoryAllocationLib
38 | DebugLib
39 | FmpAuthenticationLib
40 | ToolChainHarnessLib
41 |
42 | [Guids]
43 | gEfiCertTypeRsa2048Sha256Guid
44 | gEfiHashAlgorithmSha256Guid
45 |
--------------------------------------------------------------------------------
/HBFA/UefiHostFuzzTestCasePkg/TestCase/SecurityPkg/Library/Tpm2CommandLib/TestTpm2CommandLib.inf:
--------------------------------------------------------------------------------
1 | ## @file
2 | # Component description file for TestTpm2CommandLib module.
3 | #
4 | # Copyright (c) 2018, Intel Corporation. All rights reserved.
5 | # SPDX-License-Identifier: BSD-2-Clause-Patent
6 | #
7 | ##
8 |
9 | [Defines]
10 | INF_VERSION = 0x00010005
11 | BASE_NAME = TestTpm2CommandLib
12 | FILE_GUID = 671711BA-ED88-46D3-99E6-A690E7C301F0
13 | MODULE_TYPE = USER_DEFINED
14 | VERSION_STRING = 1.0
15 |
16 | #
17 | # The following information is for reference only and not required by the build tools.
18 | #
19 | # VALID_ARCHITECTURES = IA32 X64
20 | #
21 |
22 | [Sources]
23 | TestTpm2CommandLib.c
24 |
25 | [Packages]
26 | MdePkg/MdePkg.dec
27 | SecurityPkg/SecurityPkg.dec
28 | UefiHostTestPkg/UefiHostTestPkg.dec
29 | UefiHostFuzzTestCasePkg/UefiHostFuzzTestCasePkg.dec
30 |
31 | [LibraryClasses]
32 | BaseLib
33 | BaseMemoryLib
34 | MemoryAllocationLib
35 | DebugLib
36 | Tpm2CommandLib
37 | Tpm2DeviceStubLib
38 | ToolChainHarnessLib
39 |
--------------------------------------------------------------------------------
/HBFA/UefiHostFuzzTestCasePkg/TestStub/DiskStubLib/DiskStubLib.inf:
--------------------------------------------------------------------------------
1 | ## @file
2 | # Component description file for TestUdf module.
3 | #
4 | # Copyright (c) 2018, Intel Corporation. All rights reserved.
5 | # SPDX-License-Identifier: BSD-2-Clause-Patent
6 | #
7 | ##
8 |
9 | [Defines]
10 | INF_VERSION = 0x00010005
11 | BASE_NAME = DiskStubLib
12 | FILE_GUID = 746FA64E-1095-44A6-BC15-5729E0335A49
13 | MODULE_TYPE = BASE
14 | VERSION_STRING = 1.0
15 | LIBRARY_CLASS = DiskStubLib
16 |
17 | #
18 | # The following information is for reference only and not required by the build tools.
19 | #
20 | # VALID_ARCHITECTURES = IA32 X64
21 | #
22 |
23 | [Sources]
24 | DiskStubLib.c
25 |
26 | [Packages]
27 | MdePkg/MdePkg.dec
28 | UefiHostTestPkg/UefiHostTestPkg.dec
29 | UefiHostFuzzTestCasePkg/UefiHostFuzzTestCasePkg.dec
30 |
31 | [LibraryClasses]
32 | BaseLib
33 | BaseMemoryLib
34 | MemoryAllocationLib
35 | DebugLib
36 |
--------------------------------------------------------------------------------
/HBFA/UefiHostFuzzTestCasePkg/TestStub/Include/Library/DiskStubLib.h:
--------------------------------------------------------------------------------
1 | /** @file
2 |
3 | Copyright (c) 2018, Intel Corporation. All rights reserved.
4 | SPDX-License-Identifier: BSD-2-Clause-Patent
5 |
6 | **/
7 |
8 | #ifndef _DISK_STUB_LIB_H_
9 | #define _DISK_STUB_LIB_H_
10 |
11 | #include
12 | #include
13 | #include
14 |
15 | EFI_STATUS
16 | EFIAPI
17 | DiskStubInitialize (
18 | IN VOID *Buffer,
19 | IN UINTN BufferSize,
20 | IN UINT32 BlockSize,
21 | IN UINT32 IoAlign,
22 | OUT EFI_BLOCK_IO_PROTOCOL **BlockIo,
23 | OUT EFI_DISK_IO_PROTOCOL **DiskIo
24 | );
25 |
26 | EFI_STATUS
27 | EFIAPI
28 | DiskStubDestory (
29 | VOID
30 | );
31 |
32 | #endif
33 |
--------------------------------------------------------------------------------
/HBFA/UefiHostFuzzTestCasePkg/TestStub/Include/Library/SmmMemLibStubLib.h:
--------------------------------------------------------------------------------
1 | /** @file
2 |
3 | Copyright (c) 2018, Intel Corporation. All rights reserved.
4 | SPDX-License-Identifier: BSD-2-Clause-Patent
5 |
6 | **/
7 |
8 | #ifndef _SMM_MEM_LIB_LIB_LIB_H_
9 | #define _SMM_MEM_LIB_LIB_LIB_H_
10 |
11 | #include
12 |
13 | typedef struct {
14 | EFI_PHYSICAL_ADDRESS Address;
15 | UINT64 Size;
16 | } SMM_COMMUNICATION_BUFFER_DESCRIPTOR;
17 |
18 | VOID
19 | EFIAPI
20 | SmmMemLibInitialize (
21 | IN UINTN SmmCommBufferDescCount,
22 | IN SMM_COMMUNICATION_BUFFER_DESCRIPTOR *SmmCommBufferDesc
23 | );
24 |
25 | #endif
26 |
--------------------------------------------------------------------------------
/HBFA/UefiHostFuzzTestCasePkg/TestStub/Include/Library/Tcg2StubLib.h:
--------------------------------------------------------------------------------
1 | #ifndef _TCG2_STUB_LIB_H_
2 | #define _TCG2_STUB_LIB_H_
3 |
4 | #include
5 |
6 | EFI_STATUS
7 | EFIAPI
8 | Tcg2StubInitlize(
9 | VOID
10 | );
11 |
12 | #endif
--------------------------------------------------------------------------------
/HBFA/UefiHostFuzzTestCasePkg/TestStub/Include/Library/Tpm2DeviceStubLib.h:
--------------------------------------------------------------------------------
1 | /** @file
2 |
3 | Copyright (c) 2018, Intel Corporation. All rights reserved.
4 | SPDX-License-Identifier: BSD-2-Clause-Patent
5 |
6 | **/
7 |
8 | #ifndef _TPM2_DEVICE_STUB_LIB_H_
9 | #define _TPM2_DEVICE_STUB_LIB_H_
10 |
11 | #include
12 |
13 | EFI_STATUS
14 | EFIAPI
15 | Tpm2ResponseInitialize (
16 | IN VOID *Buffer,
17 | IN UINTN BufferSize
18 | );
19 |
20 | #endif
21 |
--------------------------------------------------------------------------------
/HBFA/UefiHostFuzzTestCasePkg/TestStub/Include/Library/Usb2HcPpiStubLib.h:
--------------------------------------------------------------------------------
1 | /** @file
2 |
3 | Copyright (c) 2018, Intel Corporation. All rights reserved.
4 | SPDX-License-Identifier: BSD-2-Clause-Patent
5 |
6 | **/
7 |
8 | #ifndef _USB2_HC_PPI_STUB_LIB_H_
9 | #define _USB2_HC_PPI_STUB_LIB_H_
10 |
11 | #include
12 | #include
13 |
14 | EFI_STATUS
15 | EFIAPI
16 | Usb2HcPpiStubInitialize (
17 | IN VOID *DeviceDescBuffer,
18 | IN UINTN DeviceDescBufferSize,
19 | IN VOID *ConfigDescBuffer,
20 | IN UINTN ConfigDescBufferSize,
21 | IN VOID *StringDescBuffer,
22 | IN UINTN StringDescBufferSize,
23 | OUT PEI_USB2_HOST_CONTROLLER_PPI **Usb2HcPpi
24 | );
25 |
26 | #endif
27 |
--------------------------------------------------------------------------------
/HBFA/UefiHostFuzzTestCasePkg/TestStub/Include/Library/Usb2HcStubLib.h:
--------------------------------------------------------------------------------
1 | /** @file
2 |
3 | Copyright (c) 2018, Intel Corporation. All rights reserved.
4 | SPDX-License-Identifier: BSD-2-Clause-Patent
5 |
6 | **/
7 |
8 | #ifndef _USB2_HC_STUB_LIB_H_
9 | #define _USB2_HC_STUB_LIB_H_
10 |
11 | #include
12 | #include
13 |
14 | EFI_STATUS
15 | EFIAPI
16 | Usb2HcStubInitialize (
17 | IN VOID *DeviceDescBuffer,
18 | IN UINTN DeviceDescBufferSize,
19 | IN VOID *ConfigDescBuffer,
20 | IN UINTN ConfigDescBufferSize,
21 | IN VOID *StringDescBuffer,
22 | IN UINTN StringDescBufferSize,
23 | OUT EFI_USB2_HC_PROTOCOL **Usb2Hc
24 | );
25 |
26 | #endif
27 |
--------------------------------------------------------------------------------
/HBFA/UefiHostFuzzTestCasePkg/TestStub/Include/Library/UsbIoPpiStubLib.h:
--------------------------------------------------------------------------------
1 | /** @file
2 |
3 | Copyright (c) 2018, Intel Corporation. All rights reserved.
4 | SPDX-License-Identifier: BSD-2-Clause-Patent
5 |
6 | **/
7 |
8 | #ifndef _USB_IO_PPI_STUB_LIB_H_
9 | #define _USB_IO_PPI_STUB_LIB_H_
10 |
11 | #include
12 | #include
13 |
14 | EFI_STATUS
15 | EFIAPI
16 | UsbIoPpiStubInitialize (
17 | IN VOID *DeviceDescBuffer,
18 | IN UINTN DeviceDescBufferSize,
19 | IN VOID *ConfigDescBuffer,
20 | IN UINTN ConfigDescBufferSize,
21 | IN VOID *StringDescBuffer,
22 | IN UINTN StringDescBufferSize,
23 | OUT PEI_USB_IO_PPI **UsbIoPpi
24 | );
25 |
26 | #endif
27 |
--------------------------------------------------------------------------------
/HBFA/UefiHostFuzzTestCasePkg/TestStub/Include/Library/VirtioBlkStubLib.h:
--------------------------------------------------------------------------------
1 | /** @file
2 |
3 | Copyright (c) 2018, Intel Corporation. All rights reserved.
4 | SPDX-License-Identifier: BSD-2-Clause-Patent
5 |
6 | **/
7 |
8 | #ifndef _VIRTIOBLK_STUB_LIB_H_
9 | #define _VIRTIOBLK_STUB_LIB_H_
10 |
11 | #include
12 |
13 | #include
14 | #include
15 |
16 | #define VBLK_SIG SIGNATURE_32 ('V', 'B', 'L', 'K')
17 |
18 | typedef struct {
19 | //
20 | // Parts of this structure are initialized / torn down in various functions
21 | // at various call depths. The table to the right should make it easier to
22 | // track them.
23 | //
24 | // field init function init dpth
25 | // --------------------- ------------------ ---------
26 | UINT32 Signature; // DriverBindingStart 0
27 | VIRTIO_DEVICE_PROTOCOL *VirtIo; // DriverBindingStart 0
28 | EFI_EVENT ExitBoot; // DriverBindingStart 0
29 | VRING Ring; // VirtioRingInit 2
30 | EFI_BLOCK_IO_PROTOCOL BlockIo; // VirtioBlkInit 1
31 | EFI_BLOCK_IO_MEDIA BlockIoMedia; // VirtioBlkInit 1
32 | VOID *RingMap; // VirtioRingMap 2
33 | } VBLK_DEV;
34 |
35 | EFI_STATUS
36 | EFIAPI
37 | VirtioBlkInit (
38 | IN OUT VBLK_DEV *Dev
39 | );
40 |
41 | #endif
--------------------------------------------------------------------------------
/HBFA/UefiHostFuzzTestCasePkg/TestStub/Tcg2StubLib/Tcg2StubLib.inf:
--------------------------------------------------------------------------------
1 | ## @file
2 | # Component description file for Tcg2StubLib.
3 | #
4 | # Copyright (c) 2021, Intel Corporation. All rights reserved.
5 | # SPDX-License-Identifier: BSD-2-Clause-Patent
6 | #
7 | ##
8 |
9 | [Defines]
10 | INF_VERSION = 0x00010005
11 | BASE_NAME = Tcg2StubLib
12 | FILE_GUID = 520FA64E-1318-44A6-BC15-5729E0335A49
13 | MODULE_TYPE = BASE
14 | VERSION_STRING = 1.0
15 | LIBRARY_CLASS = Tcg2StubLib
16 |
17 | #
18 | # The following information is for reference only and not required by the build tools.
19 | #
20 | # VALID_ARCHITECTURES = IA32 X64
21 | #
22 |
23 | [Sources]
24 | Tcg2StubLib.c
25 |
26 | [Packages]
27 | MdePkg/MdePkg.dec
28 | UefiHostTestPkg/UefiHostTestPkg.dec
29 | UefiHostFuzzTestCasePkg/UefiHostFuzzTestCasePkg.dec
30 |
31 | [LibraryClasses]
32 | BaseLib
33 | BaseMemoryLib
34 | MemoryAllocationLib
35 | DebugLib
36 |
--------------------------------------------------------------------------------
/HBFA/UefiHostFuzzTestCasePkg/TestStub/Tpm2DeviceLibStub/Tpm2DeviceLibStub.inf:
--------------------------------------------------------------------------------
1 | ## @file
2 | #
3 | # Copyright (c) 2018, Intel Corporation. All rights reserved.
4 | # SPDX-License-Identifier: BSD-2-Clause-Patent
5 | #
6 | ##
7 |
8 | [Defines]
9 | INF_VERSION = 0x00010005
10 | BASE_NAME = Tpm2DeviceLibStub
11 | FILE_GUID = E54A3327-A345-4068-8842-70AC0D519855
12 | MODULE_TYPE = BASE
13 | VERSION_STRING = 1.0
14 | LIBRARY_CLASS = Tpm2DeviceLib
15 | LIBRARY_CLASS = Tpm2DeviceStubLib
16 |
17 | #
18 | # The following information is for reference only and not required by the build tools.
19 | #
20 | # VALID_ARCHITECTURES = IA32 X64
21 | #
22 |
23 | [Sources]
24 | Tpm2DeviceLibStub.c
25 |
26 | [Packages]
27 | MdePkg/MdePkg.dec
28 | SecurityPkg/SecurityPkg.dec
29 | UefiHostFuzzTestCasePkg/UefiHostFuzzTestCasePkg.dec
30 |
31 | [LibraryClasses]
32 | BaseLib
33 | BaseMemoryLib
34 | DebugLib
35 |
--------------------------------------------------------------------------------
/HBFA/UefiHostFuzzTestCasePkg/TestStub/Usb2HcPpiStubLib/Usb2HcPpiStubLib.inf:
--------------------------------------------------------------------------------
1 | ## @file
2 | # Component description file for TestUdf module.
3 | #
4 | # Copyright (c) 2018, Intel Corporation. All rights reserved.
5 | # SPDX-License-Identifier: BSD-2-Clause-Patent
6 | #
7 | ##
8 |
9 | [Defines]
10 | INF_VERSION = 0x00010005
11 | BASE_NAME = Usb2HcPpiStubLib
12 | FILE_GUID = A139202F-6BAA-4ED9-95CF-C5267D50208F
13 | MODULE_TYPE = BASE
14 | VERSION_STRING = 1.0
15 | LIBRARY_CLASS = Usb2HcPpiStubLib
16 |
17 | #
18 | # The following information is for reference only and not required by the build tools.
19 | #
20 | # VALID_ARCHITECTURES = IA32 X64
21 | #
22 |
23 | [Sources]
24 | Usb2HcPpiStubLib.c
25 |
26 | [Packages]
27 | MdePkg/MdePkg.dec
28 | MdeModulePkg/MdeModulePkg.dec
29 | UefiHostTestPkg/UefiHostTestPkg.dec
30 | UefiHostFuzzTestCasePkg/UefiHostFuzzTestCasePkg.dec
31 |
32 | [LibraryClasses]
33 | BaseLib
34 | BaseMemoryLib
35 | MemoryAllocationLib
36 | DebugLib
37 |
--------------------------------------------------------------------------------
/HBFA/UefiHostFuzzTestCasePkg/TestStub/Usb2HcStubLib/Usb2HcStubLib.inf:
--------------------------------------------------------------------------------
1 | ## @file
2 | # Component description file for TestUdf module.
3 | #
4 | # Copyright (c) 2018, Intel Corporation. All rights reserved.
5 | # SPDX-License-Identifier: BSD-2-Clause-Patent
6 | #
7 | ##
8 |
9 | [Defines]
10 | INF_VERSION = 0x00010005
11 | BASE_NAME = Usb2HcStubLib
12 | FILE_GUID = A139202F-6BAA-4ED9-95CF-C5267D50208F
13 | MODULE_TYPE = BASE
14 | VERSION_STRING = 1.0
15 | LIBRARY_CLASS = Usb2HcStubLib
16 |
17 | #
18 | # The following information is for reference only and not required by the build tools.
19 | #
20 | # VALID_ARCHITECTURES = IA32 X64
21 | #
22 |
23 | [Sources]
24 | Usb2HcStubLib.c
25 |
26 | [Packages]
27 | MdePkg/MdePkg.dec
28 | UefiHostTestPkg/UefiHostTestPkg.dec
29 | UefiHostFuzzTestCasePkg/UefiHostFuzzTestCasePkg.dec
30 |
31 | [LibraryClasses]
32 | BaseLib
33 | BaseMemoryLib
34 | MemoryAllocationLib
35 | DebugLib
36 |
--------------------------------------------------------------------------------
/HBFA/UefiHostFuzzTestCasePkg/TestStub/UsbIoPpiStubLib/UsbIoPpiStubLib.inf:
--------------------------------------------------------------------------------
1 | ## @file
2 | # Component description file for TestUdf module.
3 | #
4 | # Copyright (c) 2018, Intel Corporation. All rights reserved.
5 | # SPDX-License-Identifier: BSD-2-Clause-Patent
6 | #
7 | ##
8 |
9 | [Defines]
10 | INF_VERSION = 0x00010005
11 | BASE_NAME = UsbIoPpiStubLib
12 | FILE_GUID = A84AF093-3CAF-424E-BCEC-3E1606030A5F
13 | MODULE_TYPE = BASE
14 | VERSION_STRING = 1.0
15 | LIBRARY_CLASS = UsbIoPpiStubLib
16 |
17 | #
18 | # The following information is for reference only and not required by the build tools.
19 | #
20 | # VALID_ARCHITECTURES = IA32 X64
21 | #
22 |
23 | [Sources]
24 | UsbIoPpiStubLib.c
25 |
26 | [Packages]
27 | MdePkg/MdePkg.dec
28 | MdeModulePkg/MdeModulePkg.dec
29 | UefiHostTestPkg/UefiHostTestPkg.dec
30 | UefiHostFuzzTestCasePkg/UefiHostFuzzTestCasePkg.dec
31 |
32 | [LibraryClasses]
33 | BaseLib
34 | BaseMemoryLib
35 | MemoryAllocationLib
36 | DebugLib
37 |
--------------------------------------------------------------------------------
/HBFA/UefiHostFuzzTestCasePkg/TestStub/VirtioBlkStubLib/VirtioBlkStubLib.inf:
--------------------------------------------------------------------------------
1 | ## @file
2 | # Component description file for TestUdf module.
3 | #
4 | # Copyright (c) 2018, Intel Corporation. All rights reserved.
5 | # SPDX-License-Identifier: BSD-2-Clause-Patent
6 | #
7 | ##
8 |
9 | [Defines]
10 | INF_VERSION = 0x00010005
11 | BASE_NAME = VirtioBlkStubLib
12 | FILE_GUID = 1C7BD8C1-C26C-764C-0977-D8BF49A10DDA
13 | MODULE_TYPE = BASE
14 | VERSION_STRING = 1.0
15 | LIBRARY_CLASS = VirtioBlkStubLib
16 |
17 | #
18 | # The following information is for reference only and not required by the build tools.
19 | #
20 | # VALID_ARCHITECTURES = IA32 X64
21 | #
22 |
23 | [Sources]
24 | VirtioBlkStubLib.c
25 |
26 | [Packages]
27 | MdePkg/MdePkg.dec
28 | OvmfPkg/OvmfPkg.dec
29 | UefiHostTestPkg/UefiHostTestPkg.dec
30 | UefiHostFuzzTestCasePkg/UefiHostFuzzTestCasePkg.dec
31 |
32 | [LibraryClasses]
33 | BaseLib
34 | BaseMemoryLib
35 | MemoryAllocationLib
36 | DebugLib
--------------------------------------------------------------------------------
/HBFA/UefiHostFuzzTestCasePkg/TestStub/VirtioPciDevice10StubLib/VirtioPciDevice10StubLib.inf:
--------------------------------------------------------------------------------
1 | ## @file
2 | # Component description file for TestUdf module.
3 | #
4 | # Copyright (c) 2018, Intel Corporation. All rights reserved.
5 | # SPDX-License-Identifier: BSD-2-Clause-Patent
6 | #
7 | ##
8 |
9 | [Defines]
10 | INF_VERSION = 0x00010005
11 | BASE_NAME = VirtioPciDevice10StubLib
12 | FILE_GUID = 1C7BD2C1-C26C-764C-0927-D8BF49A30DDA
13 | MODULE_TYPE = BASE
14 | VERSION_STRING = 1.0
15 | LIBRARY_CLASS = VirtioPciDevice10StubLib
16 |
17 | #
18 | # The following information is for reference only and not required by the build tools.
19 | #
20 | # VALID_ARCHITECTURES = IA32 X64
21 | #
22 |
23 | [Sources]
24 | VirtioPciDevice10StubLib.c
25 |
26 | [Packages]
27 | MdePkg/MdePkg.dec
28 | OvmfPkg/OvmfPkg.dec
29 | UefiHostTestPkg/UefiHostTestPkg.dec
30 | UefiHostFuzzTestCasePkg/UefiHostFuzzTestCasePkg.dec
31 |
32 | [LibraryClasses]
33 | BaseLib
34 | BaseMemoryLib
35 | MemoryAllocationLib
36 | DebugLib
37 | UefiPciCapPciIoLib
38 | BasePciCapLib
39 | OrderedCollectionLib
--------------------------------------------------------------------------------
/HBFA/UefiHostFuzzTestCasePkg/TestStub/VirtioPciDeviceStubLib/VirtioPciDeviceStubLib.inf:
--------------------------------------------------------------------------------
1 | ## @file
2 | # Component description file for TestUdf module.
3 | #
4 | # Copyright (c) 2018, Intel Corporation. All rights reserved.
5 | # SPDX-License-Identifier: BSD-2-Clause-Patent
6 | #
7 | ##
8 |
9 | [Defines]
10 | INF_VERSION = 0x00010005
11 | BASE_NAME = VirtioPciDeviceStubLib
12 | FILE_GUID = 1C7BD2C1-C26C-764C-0927-D8BF49A30DDA
13 | MODULE_TYPE = BASE
14 | VERSION_STRING = 1.0
15 | LIBRARY_CLASS = VirtioPciDeviceStubLib
16 |
17 | #
18 | # The following information is for reference only and not required by the build tools.
19 | #
20 | # VALID_ARCHITECTURES = IA32 X64
21 | #
22 |
23 | [Sources]
24 | VirtioPciDeviceStubLib.c
25 |
26 | [Packages]
27 | MdePkg/MdePkg.dec
28 | OvmfPkg/OvmfPkg.dec
29 | UefiHostTestPkg/UefiHostTestPkg.dec
30 | UefiHostFuzzTestCasePkg/UefiHostFuzzTestCasePkg.dec
31 |
32 | [LibraryClasses]
33 | BaseLib
34 | BaseMemoryLib
35 | MemoryAllocationLib
36 | DebugLib
37 |
--------------------------------------------------------------------------------
/HBFA/UefiHostFuzzTestCasePkg/UefiHostFuzzTestCasePkg.dec:
--------------------------------------------------------------------------------
1 | ## @file UefiHostFuzzTestCasePkg.dec
2 | #
3 | # Copyright (c) 2018, Intel Corporation. All rights reserved.
4 | # SPDX-License-Identifier: BSD-2-Clause-Patent
5 | #
6 | ##
7 |
8 | [Defines]
9 | DEC_SPECIFICATION = 0x00010005
10 | PACKAGE_NAME = UefiHostFuzzTestCasePkg
11 | PACKAGE_GUID = C8C2F32C-35BC-4D74-9467-178BC9325EBE
12 | PACKAGE_VERSION = 0.11
13 |
14 | [Includes.common]
15 | TestStub/Include
16 |
--------------------------------------------------------------------------------
/HBFA/UefiHostFuzzTestPkg/Include/Library/ToolChainHarnessLib.h:
--------------------------------------------------------------------------------
1 | /** @file
2 |
3 | Copyright (c) 2019, Intel Corporation. All rights reserved.
4 | SPDX-License-Identifier: BSD-2-Clause-Patent
5 |
6 | **/
7 |
8 | #ifndef _TOOLCHAIN_HARNESS_LIB_
9 | #define _TOOLCHAIN_HARNESS_LIB_
10 |
11 | VOID
12 | EFIAPI
13 | RunTestHarness (
14 | IN VOID *TestBuffer,
15 | IN UINTN TestBufferSize
16 | );
17 |
18 | UINTN
19 | EFIAPI
20 | GetMaxBufferSize (
21 | VOID
22 | );
23 |
24 | #endif
--------------------------------------------------------------------------------
/HBFA/UefiHostFuzzTestPkg/Library/ToolChainHarnessLib/ToolChainHarnessLib.inf:
--------------------------------------------------------------------------------
1 | ## @file
2 | # Component description file for ToolChainHarnessLib module.
3 | #
4 | # Copyright (c) 2019, Intel Corporation. All rights reserved.
5 | # SPDX-License-Identifier: BSD-2-Clause-Patent
6 | #
7 | ##
8 |
9 | [Defines]
10 | INF_VERSION = 0x00010005
11 | BASE_NAME = ToolChainHarnessLib
12 | FILE_GUID = 053c6bc3-5ad4-491a-94c9-c4f5e3c91e39
13 | MODULE_TYPE = BASE
14 | VERSION_STRING = 1.0
15 | LIBRARY_CLASS = ToolChainHarnessLib
16 |
17 | #
18 | # The following information is for reference only and not required by the build tools.
19 | #
20 | # VALID_ARCHITECTURES = IA32 X64
21 | #
22 |
23 | [Sources]
24 | ToolChainHarnessLib.c
25 |
26 | [Packages]
27 | MdePkg/MdePkg.dec
28 | UefiHostFuzzTestPkg/UefiHostFuzzTestPkg.dec
29 | UefiInstrumentTestPkg/UefiInstrumentTestPkg.dec
30 |
31 | [LibraryClasses]
32 | BaseLib
33 |
--------------------------------------------------------------------------------
/HBFA/UefiHostFuzzTestPkg/ReadMe-ErrorInjection.txt:
--------------------------------------------------------------------------------
1 | How to do error injection?
2 | ==============
3 | Build
4 | 1) Make sure UefiInstrumentTestPkg is in PACKAGES_PATH.
5 | 2) build -p UefiHostFuzzTestCasePkg\UefiHostFuzzTestCasePkg.dsc -a IA32 -t XXX -D TEST_WITH_INSTRUMENT
6 |
7 | Write Error Injection Profile
8 | 1) Create .Ini file like below: (test.ini)
9 | #######################
10 | # CallErrorCount=N means which call returns error. N means the Nth call returns error.
11 | # N start from 1. CallErrorCount = 0 means disable.
12 | # ReturnValue=X means when error happens, which value is returned.
13 | #######################
14 |
15 | [AllocateZeroPool]
16 | CallErrorCount = 1
17 | ReturnValue = 0
18 |
19 | [ReadBlocks]
20 | CallErrorCount = 1
21 | ReturnValue = EFI_DEVICE_ERROR
22 |
23 | [ReadDisk]
24 | CallErrorCount = 1
25 | ReturnValue = EFI_DEVICE_ERROR
26 | #######################
27 |
28 | Run
29 | 1)
30 | for example: Build\UefiHostFuzzTestCasePkg\DEBUG_VS2015x86\IA32\TestPartition.exe UefiHostFuzzTestCasePkg\Seed\UDF\Raw\Udf_linux.bin test.ini
31 |
32 | Recommendation:
33 | 1) We had better provide a set of seeds, which already have high coverage. Only error handling path is not covered.
34 | 2) We had better have a script to increase CallErrorCount from 1 to N. And run the TestApp again and again.
35 | As such, all the error can be returned.
36 |
37 |
--------------------------------------------------------------------------------
/HBFA/UefiHostFuzzTestPkg/UefiHostFuzzTestPkg.dec:
--------------------------------------------------------------------------------
1 | ## @file UefiHostFuzzTestPkg.dec
2 | #
3 | # Copyright (c) 2018, Intel Corporation. All rights reserved.
4 | # SPDX-License-Identifier: BSD-2-Clause-Patent
5 | #
6 | ##
7 |
8 | [Defines]
9 | DEC_SPECIFICATION = 0x00010005
10 | PACKAGE_NAME = UefiHostFuzzTestPkg
11 | PACKAGE_GUID = 9996C2CE-80B4-473E-B7C3-E326BA6B5D73
12 | PACKAGE_VERSION = 0.11
13 |
14 | [Includes]
15 | Include
--------------------------------------------------------------------------------
/HBFA/UefiHostTestPkg/Include/Library/OsServiceLib.h:
--------------------------------------------------------------------------------
1 | /**
2 |
3 | Implement UnitTestLib
4 |
5 | Copyright (c) Microsoft
6 | **/
7 |
8 | #ifndef _OS_SERVICE_LIB_H_
9 | #define _OS_SERVICE_LIB_H_
10 |
11 | #include
12 |
13 | VOID *
14 | AllocateExecutableMemory (
15 | IN UINTN Size
16 | );
17 |
18 | VOID
19 | FreeExecutableMemory (
20 | IN VOID *Buffer,
21 | IN UINTN Size
22 | );
23 |
24 | #endif
25 |
--------------------------------------------------------------------------------
/HBFA/UefiHostTestPkg/Library/BaseCacheMaintenanceLibHost/BaseCacheMaintenanceLibHost.inf:
--------------------------------------------------------------------------------
1 | ## @file
2 | # Instance of Cache Maintenance Library using Base Library services.
3 | #
4 | # Cache Maintenance Library that uses Base Library services to maintain caches.
5 | # This library assumes there are no chipset dependencies required to maintain caches.
6 | #
7 | # Copyright (c) 2007 - 2018, Intel Corporation. All rights reserved.
8 | # Portions copyright (c) 2008 - 2009, Apple Inc. All rights reserved.
9 | #
10 | # SPDX-License-Identifier: BSD-2-Clause-Patent
11 | #
12 | #
13 | ##
14 |
15 | [Defines]
16 | INF_VERSION = 0x00010005
17 | BASE_NAME = BaseCacheMaintenanceLibHost
18 | FILE_GUID = 0F652FA7-946D-4737-A6D7-4B8B97AD0EA3
19 | MODULE_TYPE = BASE
20 | VERSION_STRING = 1.1
21 | LIBRARY_CLASS = CacheMaintenanceLib
22 |
23 | #
24 | # VALID_ARCHITECTURES = IA32 X64 IPF EBC ARM AARCH64
25 | #
26 |
27 | [Sources]
28 | Cache.c
29 |
30 | [Packages]
31 | MdePkg/MdePkg.dec
32 |
--------------------------------------------------------------------------------
/HBFA/UefiHostTestPkg/Library/BaseCpuLibHost/BaseCpuLibHost.c:
--------------------------------------------------------------------------------
1 | /** @file
2 | Base Library CPU Functions for EBC
3 |
4 | Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.
5 | SPDX-License-Identifier: BSD-2-Clause-Patent
6 |
7 | **/
8 | #include
9 |
10 | /**
11 | Flushes all the Translation Lookaside Buffers(TLB) entries in a CPU.
12 |
13 | Flushes all the Translation Lookaside Buffers(TLB) entries in a CPU.
14 |
15 | **/
16 | VOID
17 | EFIAPI
18 | CpuFlushTlb (
19 | VOID
20 | )
21 | {
22 | }
23 |
24 | /**
25 | Places the CPU in a sleep state until an interrupt is received.
26 |
27 | Places the CPU in a sleep state until an interrupt is received. If interrupts
28 | are disabled prior to calling this function, then the CPU will be placed in a
29 | sleep state indefinitely.
30 |
31 | **/
32 | VOID
33 | EFIAPI
34 | CpuSleep (
35 | VOID
36 | )
37 | {
38 | }
39 |
--------------------------------------------------------------------------------
/HBFA/UefiHostTestPkg/Library/BaseCpuLibHost/BaseCpuLibHost.inf:
--------------------------------------------------------------------------------
1 | ## @file
2 | # Instance of CPU Library for various architecture.
3 | #
4 | # Copyright (c) 2007 - 2018, Intel Corporation. All rights reserved.
5 | #
6 | # SPDX-License-Identifier: BSD-2-Clause-Patent
7 | #
8 | #
9 | ##
10 |
11 | [Defines]
12 | INF_VERSION = 0x00010005
13 | BASE_NAME = BaseCpuLibHost
14 | FILE_GUID = 197E7CD0-2C4A-4AF1-A84D-DCAC0A1D7EF8
15 | MODULE_TYPE = BASE
16 | VERSION_STRING = 1.0
17 | LIBRARY_CLASS = CpuLib
18 |
19 | [Sources]
20 | BaseCpuLibHost.c
21 |
22 | [Packages]
23 | MdePkg/MdePkg.dec
24 |
25 |
26 |
--------------------------------------------------------------------------------
/HBFA/UefiHostTestPkg/Library/BaseLibHost/ARShiftU64.c:
--------------------------------------------------------------------------------
1 | /** @file
2 | Math worker functions.
3 |
4 | Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.
5 | SPDX-License-Identifier: BSD-2-Clause-Patent
6 |
7 | **/
8 |
9 | #include
10 | #include
11 | #include
12 |
13 | UINT64
14 | EFIAPI
15 | InternalMathARShiftU64 (
16 | IN UINT64 Operand,
17 | IN UINTN Count
18 | );
19 |
20 | /**
21 | Shifts a 64-bit integer right between 0 and 63 bits. The high bits are filled
22 | with the original integer's bit 63. The shifted value is returned.
23 |
24 | This function shifts the 64-bit value Operand to the right by Count bits. The
25 | high Count bits are set to bit 63 of Operand. The shifted value is returned.
26 |
27 | If Count is greater than 63, then ASSERT().
28 |
29 | @param Operand The 64-bit operand to shift right.
30 | @param Count The number of bits to shift right.
31 |
32 | @return Operand >> Count
33 |
34 | **/
35 | UINT64
36 | EFIAPI
37 | ARShiftU64 (
38 | IN UINT64 Operand,
39 | IN UINTN Count
40 | )
41 | {
42 | ASSERT (Count < 64);
43 | return InternalMathARShiftU64 (Operand, Count);
44 | }
45 |
--------------------------------------------------------------------------------
/HBFA/UefiHostTestPkg/Library/BaseLibHost/Cache.c:
--------------------------------------------------------------------------------
1 | /** @file
2 | Base Library CPU Functions for all architectures.
3 |
4 | Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.
5 | SPDX-License-Identifier: BSD-2-Clause-Patent
6 |
7 | **/
8 |
9 | #include
10 |
11 | /**
12 | Set CD bit and clear NW bit of CR0 followed by a WBINVD.
13 |
14 | Disables the caches by setting the CD bit of CR0 to 1, clearing the NW bit of CR0 to 0,
15 | and executing a WBINVD instruction. This function is only available on IA-32 and x64.
16 |
17 | **/
18 | VOID
19 | EFIAPI
20 | AsmDisableCache (
21 | VOID
22 | )
23 | {
24 | }
25 |
26 |
27 | /**
28 | Perform a WBINVD and clear both the CD and NW bits of CR0.
29 |
30 | Enables the caches by executing a WBINVD instruction and then clear both the CD and NW
31 | bits of CR0 to 0. This function is only available on IA-32 and x64.
32 |
33 | **/
34 | VOID
35 | EFIAPI
36 | AsmEnableCache (
37 | VOID
38 | )
39 | {
40 | }
41 |
--------------------------------------------------------------------------------
/HBFA/UefiHostTestPkg/Library/BaseLibHost/CpuBreakpointGcc.c:
--------------------------------------------------------------------------------
1 | /** @file
2 | CpuBreakpoint function.
3 |
4 | Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.
5 | SPDX-License-Identifier: BSD-2-Clause-Patent
6 |
7 | **/
8 |
9 |
10 |
11 |
12 | /**
13 | Generates a breakpoint on the CPU.
14 |
15 | Generates a breakpoint on the CPU. The breakpoint must be implemented such
16 | that code can resume normal execution after the breakpoint.
17 |
18 | **/
19 | VOID
20 | EFIAPI
21 | CpuBreakpoint (
22 | VOID
23 | )
24 | {
25 | __asm__ __volatile__ ("int $3");
26 | }
27 |
--------------------------------------------------------------------------------
/HBFA/UefiHostTestPkg/Library/BaseLibHost/CpuBreakpointMsvc.c:
--------------------------------------------------------------------------------
1 | /** @file
2 | CpuBreakpoint function.
3 |
4 | Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.
5 | SPDX-License-Identifier: BSD-2-Clause-Patent
6 |
7 | **/
8 |
9 |
10 |
11 |
12 | /**
13 | Microsoft Visual Studio 7.1 Function Prototypes for I/O Intrinsics.
14 | **/
15 |
16 | void __debugbreak (VOID);
17 |
18 | #pragma intrinsic(__debugbreak)
19 |
20 | /**
21 | Generates a breakpoint on the CPU.
22 |
23 | Generates a breakpoint on the CPU. The breakpoint must be implemented such
24 | that code can resume normal execution after the breakpoint.
25 |
26 | **/
27 | VOID
28 | EFIAPI
29 | CpuBreakpoint (
30 | VOID
31 | )
32 | {
33 | __debugbreak ();
34 | }
35 |
36 |
--------------------------------------------------------------------------------
/HBFA/UefiHostTestPkg/Library/BaseLibHost/CpuDeadLoop.c:
--------------------------------------------------------------------------------
1 | /** @file
2 | Base Library CPU Functions for all architectures.
3 |
4 | Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.
5 | SPDX-License-Identifier: BSD-2-Clause-Patent
6 |
7 | **/
8 |
9 |
10 |
11 | #include
12 | #include
13 |
14 | /**
15 | Executes an infinite loop.
16 |
17 | Forces the CPU to execute an infinite loop. A debugger may be used to skip
18 | past the loop and the code that follows the loop must execute properly. This
19 | implies that the infinite loop must not cause the code that follow it to be
20 | optimized away.
21 |
22 | **/
23 | VOID
24 | EFIAPI
25 | CpuDeadLoop (
26 | VOID
27 | )
28 | {
29 | volatile UINTN Index;
30 |
31 | for (Index = 0; Index == 0;);
32 | }
33 |
--------------------------------------------------------------------------------
/HBFA/UefiHostTestPkg/Library/BaseLibHost/DivU64x32.c:
--------------------------------------------------------------------------------
1 | /** @file
2 | Math worker functions.
3 |
4 | Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.
5 | SPDX-License-Identifier: BSD-2-Clause-Patent
6 |
7 | **/
8 |
9 | #include
10 | #include
11 | #include
12 |
13 | UINT64
14 | EFIAPI
15 | InternalMathDivU64x32 (
16 | IN UINT64 Dividend,
17 | IN UINT32 Divisor
18 | );
19 |
20 | /**
21 | Divides a 64-bit unsigned integer by a 32-bit unsigned integer and generates
22 | a 64-bit unsigned result.
23 |
24 | This function divides the 64-bit unsigned value Dividend by the 32-bit
25 | unsigned value Divisor and generates a 64-bit unsigned quotient. This
26 | function returns the 64-bit unsigned quotient.
27 |
28 | If Divisor is 0, then ASSERT().
29 |
30 | @param Dividend A 64-bit unsigned value.
31 | @param Divisor A 32-bit unsigned value.
32 |
33 | @return Dividend / Divisor
34 |
35 | **/
36 | UINT64
37 | EFIAPI
38 | DivU64x32 (
39 | IN UINT64 Dividend,
40 | IN UINT32 Divisor
41 | )
42 | {
43 | ASSERT (Divisor != 0);
44 | return InternalMathDivU64x32 (Dividend, Divisor);
45 | }
46 |
--------------------------------------------------------------------------------
/HBFA/UefiHostTestPkg/Library/BaseLibHost/DummyReadTsc.c:
--------------------------------------------------------------------------------
1 | /** @file
2 |
3 | Copyright (c) 2016, Intel Corporation. All rights reserved.
4 | SPDX-License-Identifier: BSD-2-Clause-Patent
5 |
6 | **/
7 |
8 | #include
9 | #include
10 | #include
11 |
12 | UINT64
13 | EFIAPI
14 | AsmReadTsc (
15 | VOID
16 | )
17 | {
18 | return 0;
19 | }
20 |
--------------------------------------------------------------------------------
/HBFA/UefiHostTestPkg/Library/BaseLibHost/GetPowerOfTwo32.c:
--------------------------------------------------------------------------------
1 | /** @file
2 | Math worker functions.
3 |
4 | Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.
5 | SPDX-License-Identifier: BSD-2-Clause-Patent
6 |
7 | **/
8 |
9 | #include
10 | #include
11 | #include
12 |
13 | /**
14 | Returns the value of the highest bit set in a 32-bit value. Equivalent to
15 | 1 << log2(x).
16 |
17 | This function computes the value of the highest bit set in the 32-bit value
18 | specified by Operand. If Operand is zero, then zero is returned.
19 |
20 | @param Operand The 32-bit operand to evaluate.
21 |
22 | @return 1 << HighBitSet32(Operand)
23 | @retval 0 Operand is zero.
24 |
25 | **/
26 | UINT32
27 | EFIAPI
28 | GetPowerOfTwo32 (
29 | IN UINT32 Operand
30 | )
31 | {
32 | if (0 == Operand) {
33 | return 0;
34 | }
35 |
36 | return 1ul << HighBitSet32 (Operand);
37 | }
38 |
--------------------------------------------------------------------------------
/HBFA/UefiHostTestPkg/Library/BaseLibHost/GetPowerOfTwo64.c:
--------------------------------------------------------------------------------
1 | /** @file
2 | Math worker functions.
3 |
4 | Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.
5 | SPDX-License-Identifier: BSD-2-Clause-Patent
6 |
7 | **/
8 |
9 | #include
10 | #include
11 | #include
12 |
13 | /**
14 | Returns the value of the highest bit set in a 64-bit value. Equivalent to
15 | 1 << log2(x).
16 |
17 | This function computes the value of the highest bit set in the 64-bit value
18 | specified by Operand. If Operand is zero, then zero is returned.
19 |
20 | @param Operand The 64-bit operand to evaluate.
21 |
22 | @return 1 << HighBitSet64(Operand)
23 | @retval 0 Operand is zero.
24 |
25 | **/
26 | UINT64
27 | EFIAPI
28 | GetPowerOfTwo64 (
29 | IN UINT64 Operand
30 | )
31 | {
32 | if (Operand == 0) {
33 | return 0;
34 | }
35 |
36 | return LShiftU64 (1, (UINTN) HighBitSet64 (Operand));
37 | }
38 |
--------------------------------------------------------------------------------
/HBFA/UefiHostTestPkg/Library/BaseLibHost/HighBitSet32.c:
--------------------------------------------------------------------------------
1 | /** @file
2 | Math worker functions.
3 |
4 | Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.
5 | SPDX-License-Identifier: BSD-2-Clause-Patent
6 |
7 | **/
8 |
9 | #include
10 | #include
11 | #include
12 |
13 | /**
14 | Returns the bit position of the highest bit set in a 32-bit value. Equivalent
15 | to log2(x).
16 |
17 | This function computes the bit position of the highest bit set in the 32-bit
18 | value specified by Operand. If Operand is zero, then -1 is returned.
19 | Otherwise, a value between 0 and 31 is returned.
20 |
21 | @param Operand The 32-bit operand to evaluate.
22 |
23 | @retval 0..31 Position of the highest bit set in Operand if found.
24 | @retval -1 Operand is zero.
25 |
26 | **/
27 | INTN
28 | EFIAPI
29 | HighBitSet32 (
30 | IN UINT32 Operand
31 | )
32 | {
33 | INTN BitIndex;
34 |
35 | if (Operand == 0) {
36 | return - 1;
37 | }
38 | for (BitIndex = 31; (INT32)Operand > 0; BitIndex--, Operand <<= 1);
39 | return BitIndex;
40 | }
41 |
--------------------------------------------------------------------------------
/HBFA/UefiHostTestPkg/Library/BaseLibHost/HighBitSet64.c:
--------------------------------------------------------------------------------
1 | /** @file
2 | Math worker functions.
3 |
4 | Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.
5 | SPDX-License-Identifier: BSD-2-Clause-Patent
6 |
7 | **/
8 |
9 | #include
10 | #include
11 |
12 | /**
13 | Returns the bit position of the highest bit set in a 64-bit value. Equivalent
14 | to log2(x).
15 |
16 | This function computes the bit position of the highest bit set in the 64-bit
17 | value specified by Operand. If Operand is zero, then -1 is returned.
18 | Otherwise, a value between 0 and 63 is returned.
19 |
20 | @param Operand The 64-bit operand to evaluate.
21 |
22 | @retval 0..63 Position of the highest bit set in Operand if found.
23 | @retval -1 Operand is zero.
24 |
25 | **/
26 | INTN
27 | EFIAPI
28 | HighBitSet64 (
29 | IN UINT64 Operand
30 | )
31 | {
32 | if (Operand == (UINT32)Operand) {
33 | //
34 | // Operand is just a 32-bit integer
35 | //
36 | return HighBitSet32 ((UINT32)Operand);
37 | }
38 |
39 | //
40 | // Operand is really a 64-bit integer
41 | //
42 | if (sizeof (UINTN) == sizeof (UINT32)) {
43 | return HighBitSet32 (((UINT32*)&Operand)[1]) + 32;
44 | } else {
45 | return HighBitSet32 ((UINT32)RShiftU64 (Operand, 32)) + 32;
46 | }
47 | }
48 |
--------------------------------------------------------------------------------
/HBFA/UefiHostTestPkg/Library/BaseLibHost/Ia32/ReadTsc.nasm:
--------------------------------------------------------------------------------
1 | ;------------------------------------------------------------------------------
2 | ;
3 | ; Copyright (c) 2006, Intel Corporation. All rights reserved.
4 | ; SPDX-License-Identifier: BSD-2-Clause-Patent
5 | ;
6 | ; Module Name:
7 | ;
8 | ; ReadTsc.Asm
9 | ;
10 | ; Abstract:
11 | ;
12 | ; AsmReadTsc function
13 | ;
14 | ; Notes:
15 | ;
16 | ;------------------------------------------------------------------------------
17 |
18 | SECTION .text
19 |
20 | ;------------------------------------------------------------------------------
21 | ; UINT64
22 | ; EFIAPI
23 | ; AsmReadTsc (
24 | ; VOID
25 | ; );
26 | ;------------------------------------------------------------------------------
27 | global ASM_PFX(AsmReadTsc)
28 | ASM_PFX(AsmReadTsc):
29 | rdtsc
30 | ret
31 |
32 |
--------------------------------------------------------------------------------
/HBFA/UefiHostTestPkg/Library/BaseLibHost/LRotU32.c:
--------------------------------------------------------------------------------
1 | /** @file
2 | Math worker functions.
3 |
4 | Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.
5 | SPDX-License-Identifier: BSD-2-Clause-Patent
6 |
7 | **/
8 |
9 | #include
10 | #include
11 | #include
12 |
13 | /**
14 | Rotates a 32-bit integer left between 0 and 31 bits, filling the low bits
15 | with the high bits that were rotated.
16 |
17 | This function rotates the 32-bit value Operand to the left by Count bits. The
18 | low Count bits are fill with the high Count bits of Operand. The rotated
19 | value is returned.
20 |
21 | If Count is greater than 31, then ASSERT().
22 |
23 | @param Operand The 32-bit operand to rotate left.
24 | @param Count The number of bits to rotate left.
25 |
26 | @return Operand << Count
27 |
28 | **/
29 | UINT32
30 | EFIAPI
31 | LRotU32 (
32 | IN UINT32 Operand,
33 | IN UINTN Count
34 | )
35 | {
36 | ASSERT (Count < 32);
37 | return (Operand << Count) | (Operand >> (32 - Count));
38 | }
39 |
--------------------------------------------------------------------------------
/HBFA/UefiHostTestPkg/Library/BaseLibHost/LRotU64.c:
--------------------------------------------------------------------------------
1 | /** @file
2 | Math worker functions.
3 |
4 | Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.
5 | SPDX-License-Identifier: BSD-2-Clause-Patent
6 |
7 | **/
8 |
9 | #include
10 | #include
11 | #include
12 |
13 | UINT64
14 | EFIAPI
15 | InternalMathLRotU64 (
16 | IN UINT64 Operand,
17 | IN UINTN Count
18 | );
19 |
20 | /**
21 | Rotates a 64-bit integer left between 0 and 63 bits, filling the low bits
22 | with the high bits that were rotated.
23 |
24 | This function rotates the 64-bit value Operand to the left by Count bits. The
25 | low Count bits are fill with the high Count bits of Operand. The rotated
26 | value is returned.
27 |
28 | If Count is greater than 63, then ASSERT().
29 |
30 | @param Operand The 64-bit operand to rotate left.
31 | @param Count The number of bits to rotate left.
32 |
33 | @return Operand << Count
34 |
35 | **/
36 | UINT64
37 | EFIAPI
38 | LRotU64 (
39 | IN UINT64 Operand,
40 | IN UINTN Count
41 | )
42 | {
43 | ASSERT (Count < 64);
44 | return InternalMathLRotU64 (Operand, Count);
45 | }
46 |
--------------------------------------------------------------------------------
/HBFA/UefiHostTestPkg/Library/BaseLibHost/LShiftU64.c:
--------------------------------------------------------------------------------
1 | /** @file
2 | Math worker functions.
3 |
4 | Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.
5 | SPDX-License-Identifier: BSD-2-Clause-Patent
6 |
7 | **/
8 |
9 | #include
10 | #include
11 | #include
12 |
13 | UINT64
14 | EFIAPI
15 | InternalMathLShiftU64 (
16 | IN UINT64 Operand,
17 | IN UINTN Count
18 | );
19 |
20 | /**
21 | Shifts a 64-bit integer left between 0 and 63 bits. The low bits are filled
22 | with zeros. The shifted value is returned.
23 |
24 | This function shifts the 64-bit value Operand to the left by Count bits. The
25 | low Count bits are set to zero. The shifted value is returned.
26 |
27 | If Count is greater than 63, then ASSERT().
28 |
29 | @param Operand The 64-bit operand to shift left.
30 | @param Count The number of bits to shift left.
31 |
32 | @return Operand << Count.
33 |
34 | **/
35 | UINT64
36 | EFIAPI
37 | LShiftU64 (
38 | IN UINT64 Operand,
39 | IN UINTN Count
40 | )
41 | {
42 | ASSERT (Count < 64);
43 | return InternalMathLShiftU64 (Operand, Count);
44 | }
45 |
--------------------------------------------------------------------------------
/HBFA/UefiHostTestPkg/Library/BaseLibHost/Lfence.c:
--------------------------------------------------------------------------------
1 | /** @file
2 |
3 | Copyright (c) 2016, Intel Corporation. All rights reserved.
4 | SPDX-License-Identifier: BSD-2-Clause-Patent
5 |
6 | **/
7 |
8 | #include
9 | #include
10 | #include
11 |
--------------------------------------------------------------------------------
/HBFA/UefiHostTestPkg/Library/BaseLibHost/LongJump.c:
--------------------------------------------------------------------------------
1 | /** @file
2 | Long Jump functions.
3 |
4 | Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.
5 | SPDX-License-Identifier: BSD-2-Clause-Patent
6 |
7 | **/
8 |
9 |
10 | #include
11 | #include
12 | #include
13 | #include
14 | #include
15 |
16 | /**
17 | Restores the CPU context that was saved with SetJump().
18 |
19 | Restores the CPU context from the buffer specified by JumpBuffer. This
20 | function never returns to the caller. Instead is resumes execution based on
21 | the state of JumpBuffer.
22 |
23 | If JumpBuffer is NULL, then ASSERT().
24 | For Itanium processors, if JumpBuffer is not aligned on a 16-byte boundary, then ASSERT().
25 | If Value is 0, then ASSERT().
26 |
27 | @param JumpBuffer A pointer to CPU context buffer.
28 | @param Value The value to return when the SetJump() context is
29 | restored and must be non-zero.
30 |
31 | **/
32 | VOID
33 | EFIAPI
34 | LongJump (
35 | IN BASE_LIBRARY_JUMP_BUFFER *JumpBuffer,
36 | IN UINTN Value
37 | )
38 | {
39 | jmp_buf local_buf;
40 | jmp_buf *buf;
41 |
42 | buf = *(VOID **)JumpBuffer;
43 | memcpy (&local_buf, buf, sizeof(jmp_buf));
44 | free (buf);
45 | longjmp (local_buf, (int)Value);
46 | }
47 |
--------------------------------------------------------------------------------
/HBFA/UefiHostTestPkg/Library/BaseLibHost/LowBitSet32.c:
--------------------------------------------------------------------------------
1 | /** @file
2 | Math worker functions.
3 |
4 | Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.
5 | SPDX-License-Identifier: BSD-2-Clause-Patent
6 |
7 | **/
8 |
9 | #include
10 | #include
11 | #include
12 |
13 | /**
14 | Returns the bit position of the lowest bit set in a 32-bit value.
15 |
16 | This function computes the bit position of the lowest bit set in the 32-bit
17 | value specified by Operand. If Operand is zero, then -1 is returned.
18 | Otherwise, a value between 0 and 31 is returned.
19 |
20 | @param Operand The 32-bit operand to evaluate.
21 |
22 | @retval 0..31 The lowest bit set in Operand was found.
23 | @retval -1 Operand is zero.
24 |
25 | **/
26 | INTN
27 | EFIAPI
28 | LowBitSet32 (
29 | IN UINT32 Operand
30 | )
31 | {
32 | INTN BitIndex;
33 |
34 | if (Operand == 0) {
35 | return -1;
36 | }
37 |
38 | for (BitIndex = 0; 0 == (Operand & 1); BitIndex++, Operand >>= 1);
39 | return BitIndex;
40 | }
41 |
--------------------------------------------------------------------------------
/HBFA/UefiHostTestPkg/Library/BaseLibHost/LowBitSet64.c:
--------------------------------------------------------------------------------
1 | /** @file
2 | Math worker functions.
3 |
4 | Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.
5 | SPDX-License-Identifier: BSD-2-Clause-Patent
6 |
7 | **/
8 |
9 | #include
10 | #include
11 | #include
12 |
13 | /**
14 | Returns the bit position of the lowest bit set in a 64-bit value.
15 |
16 | This function computes the bit position of the lowest bit set in the 64-bit
17 | value specified by Operand. If Operand is zero, then -1 is returned.
18 | Otherwise, a value between 0 and 63 is returned.
19 |
20 | @param Operand The 64-bit operand to evaluate.
21 |
22 | @retval 0..63 The lowest bit set in Operand was found.
23 | @retval -1 Operand is zero.
24 |
25 |
26 | **/
27 | INTN
28 | EFIAPI
29 | LowBitSet64 (
30 | IN UINT64 Operand
31 | )
32 | {
33 | INTN BitIndex;
34 |
35 | if (Operand == 0) {
36 | return -1;
37 | }
38 |
39 | for (BitIndex = 0;
40 | (Operand & 1) == 0;
41 | BitIndex++, Operand = RShiftU64 (Operand, 1));
42 | return BitIndex;
43 | }
44 |
--------------------------------------------------------------------------------
/HBFA/UefiHostTestPkg/Library/BaseLibHost/ModU64x32.c:
--------------------------------------------------------------------------------
1 | /** @file
2 | Math worker functions.
3 |
4 | Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.
5 | SPDX-License-Identifier: BSD-2-Clause-Patent
6 |
7 | **/
8 |
9 | #include
10 | #include
11 | #include
12 |
13 | UINT32
14 | EFIAPI
15 | InternalMathModU64x32 (
16 | IN UINT64 Dividend,
17 | IN UINT32 Divisor
18 | );
19 |
20 | /**
21 | Divides a 64-bit unsigned integer by a 32-bit unsigned integer and generates
22 | a 32-bit unsigned remainder.
23 |
24 | This function divides the 64-bit unsigned value Dividend by the 32-bit
25 | unsigned value Divisor and generates a 32-bit remainder. This function
26 | returns the 32-bit unsigned remainder.
27 |
28 | If Divisor is 0, then ASSERT().
29 |
30 | @param Dividend A 64-bit unsigned value.
31 | @param Divisor A 32-bit unsigned value.
32 |
33 | @return Dividend % Divisor.
34 |
35 | **/
36 | UINT32
37 | EFIAPI
38 | ModU64x32 (
39 | IN UINT64 Dividend,
40 | IN UINT32 Divisor
41 | )
42 | {
43 | ASSERT (Divisor != 0);
44 | return InternalMathModU64x32 (Dividend, Divisor);
45 | }
46 |
--------------------------------------------------------------------------------
/HBFA/UefiHostTestPkg/Library/BaseLibHost/MultS64x64.c:
--------------------------------------------------------------------------------
1 | /** @file
2 | Math worker functions.
3 |
4 | Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.
5 | SPDX-License-Identifier: BSD-2-Clause-Patent
6 |
7 | **/
8 |
9 | #include
10 | #include
11 | #include
12 |
13 | /**
14 | Multiplies a 64-bit signed integer by a 64-bit signed integer and generates a
15 | 64-bit signed result.
16 |
17 | This function multiplies the 64-bit signed value Multiplicand by the 64-bit
18 | signed value Multiplier and generates a 64-bit signed result. This 64-bit
19 | signed result is returned.
20 |
21 | @param Multiplicand A 64-bit signed value.
22 | @param Multiplier A 64-bit signed value.
23 |
24 | @return Multiplicand * Multiplier.
25 |
26 | **/
27 | INT64
28 | EFIAPI
29 | MultS64x64 (
30 | IN INT64 Multiplicand,
31 | IN INT64 Multiplier
32 | )
33 | {
34 | return (INT64)MultU64x64 ((UINT64) Multiplicand, (UINT64) Multiplier);
35 | }
36 |
--------------------------------------------------------------------------------
/HBFA/UefiHostTestPkg/Library/BaseLibHost/MultU64x32.c:
--------------------------------------------------------------------------------
1 | /** @file
2 | Math worker functions.
3 |
4 | Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.
5 | SPDX-License-Identifier: BSD-2-Clause-Patent
6 |
7 | **/
8 |
9 | #include
10 | #include
11 | #include
12 |
13 | UINT64
14 | EFIAPI
15 | InternalMathMultU64x32 (
16 | IN UINT64 Multiplicand,
17 | IN UINT32 Multiplier
18 | );
19 |
20 | /**
21 | Multiplies a 64-bit unsigned integer by a 32-bit unsigned integer and
22 | generates a 64-bit unsigned result.
23 |
24 | This function multiplies the 64-bit unsigned value Multiplicand by the 32-bit
25 | unsigned value Multiplier and generates a 64-bit unsigned result. This 64-
26 | bit unsigned result is returned.
27 |
28 | @param Multiplicand A 64-bit unsigned value.
29 | @param Multiplier A 32-bit unsigned value.
30 |
31 | @return Multiplicand * Multiplier.
32 |
33 | **/
34 | UINT64
35 | EFIAPI
36 | MultU64x32 (
37 | IN UINT64 Multiplicand,
38 | IN UINT32 Multiplier
39 | )
40 | {
41 | UINT64 Result;
42 |
43 | Result = InternalMathMultU64x32 (Multiplicand, Multiplier);
44 |
45 | return Result;
46 | }
47 |
--------------------------------------------------------------------------------
/HBFA/UefiHostTestPkg/Library/BaseLibHost/MultU64x64.c:
--------------------------------------------------------------------------------
1 | /** @file
2 | Math worker functions.
3 |
4 | Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.
5 | SPDX-License-Identifier: BSD-2-Clause-Patent
6 |
7 | **/
8 |
9 | #include
10 | #include
11 | #include
12 |
13 | UINT64
14 | EFIAPI
15 | InternalMathMultU64x64 (
16 | IN UINT64 Multiplicand,
17 | IN UINT64 Multiplier
18 | );
19 |
20 | /**
21 | Multiplies a 64-bit unsigned integer by a 64-bit unsigned integer and
22 | generates a 64-bit unsigned result.
23 |
24 | This function multiplies the 64-bit unsigned value Multiplicand by the 64-bit
25 | unsigned value Multiplier and generates a 64-bit unsigned result. This 64-
26 | bit unsigned result is returned.
27 |
28 | @param Multiplicand A 64-bit unsigned value.
29 | @param Multiplier A 64-bit unsigned value.
30 |
31 | @return Multiplicand * Multiplier.
32 |
33 | **/
34 | UINT64
35 | EFIAPI
36 | MultU64x64 (
37 | IN UINT64 Multiplicand,
38 | IN UINT64 Multiplier
39 | )
40 | {
41 | UINT64 Result;
42 |
43 | Result = InternalMathMultU64x64 (Multiplicand, Multiplier);
44 |
45 | return Result;
46 | }
47 |
--------------------------------------------------------------------------------
/HBFA/UefiHostTestPkg/Library/BaseLibHost/RRotU32.c:
--------------------------------------------------------------------------------
1 | /** @file
2 | Math worker functions.
3 |
4 | Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.
5 | SPDX-License-Identifier: BSD-2-Clause-Patent
6 |
7 | **/
8 |
9 | #include
10 | #include
11 | #include
12 |
13 | /**
14 | Rotates a 32-bit integer right between 0 and 31 bits, filling the high bits
15 | with the low bits that were rotated.
16 |
17 | This function rotates the 32-bit value Operand to the right by Count bits.
18 | The high Count bits are fill with the low Count bits of Operand. The rotated
19 | value is returned.
20 |
21 | If Count is greater than 31, then ASSERT().
22 |
23 | @param Operand The 32-bit operand to rotate right.
24 | @param Count The number of bits to rotate right.
25 |
26 | @return Operand >> Count.
27 |
28 | **/
29 | UINT32
30 | EFIAPI
31 | RRotU32 (
32 | IN UINT32 Operand,
33 | IN UINTN Count
34 | )
35 | {
36 | ASSERT (Count < 32);
37 | return (Operand >> Count) | (Operand << (32 - Count));
38 | }
39 |
--------------------------------------------------------------------------------
/HBFA/UefiHostTestPkg/Library/BaseLibHost/RRotU64.c:
--------------------------------------------------------------------------------
1 | /** @file
2 | Math worker functions.
3 |
4 | Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.
5 | SPDX-License-Identifier: BSD-2-Clause-Patent
6 |
7 | **/
8 |
9 | #include
10 | #include
11 | #include
12 |
13 | UINT64
14 | EFIAPI
15 | InternalMathRRotU64 (
16 | IN UINT64 Operand,
17 | IN UINTN Count
18 | );
19 |
20 | /**
21 | Rotates a 64-bit integer right between 0 and 63 bits, filling the high bits
22 | with the high low bits that were rotated.
23 |
24 | This function rotates the 64-bit value Operand to the right by Count bits.
25 | The high Count bits are fill with the low Count bits of Operand. The rotated
26 | value is returned.
27 |
28 | If Count is greater than 63, then ASSERT().
29 |
30 | @param Operand The 64-bit operand to rotate right.
31 | @param Count The number of bits to rotate right.
32 |
33 | @return Operand >> Count.
34 |
35 | **/
36 | UINT64
37 | EFIAPI
38 | RRotU64 (
39 | IN UINT64 Operand,
40 | IN UINTN Count
41 | )
42 | {
43 | ASSERT (Count < 64);
44 | return InternalMathRRotU64 (Operand, Count);
45 | }
46 |
--------------------------------------------------------------------------------
/HBFA/UefiHostTestPkg/Library/BaseLibHost/RShiftU64.c:
--------------------------------------------------------------------------------
1 | /** @file
2 | Math worker functions.
3 |
4 | Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.
5 | SPDX-License-Identifier: BSD-2-Clause-Patent
6 |
7 | **/
8 |
9 | #include
10 | #include
11 | #include
12 |
13 | UINT64
14 | EFIAPI
15 | InternalMathRShiftU64 (
16 | IN UINT64 Operand,
17 | IN UINTN Count
18 | );
19 |
20 | /**
21 | Shifts a 64-bit integer right between 0 and 63 bits. This high bits are
22 | filled with zeros. The shifted value is returned.
23 |
24 | This function shifts the 64-bit value Operand to the right by Count bits. The
25 | high Count bits are set to zero. The shifted value is returned.
26 |
27 | If Count is greater than 63, then ASSERT().
28 |
29 | @param Operand The 64-bit operand to shift right.
30 | @param Count The number of bits to shift right.
31 |
32 | @return Operand >> Count.
33 |
34 | **/
35 | UINT64
36 | EFIAPI
37 | RShiftU64 (
38 | IN UINT64 Operand,
39 | IN UINTN Count
40 | )
41 | {
42 | ASSERT (Count < 64);
43 | return InternalMathRShiftU64 (Operand, Count);
44 | }
45 |
--------------------------------------------------------------------------------
/HBFA/UefiHostTestPkg/Library/BaseLibHost/SwapBytes16.c:
--------------------------------------------------------------------------------
1 | /** @file
2 | Math worker functions.
3 |
4 | Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.
5 | SPDX-License-Identifier: BSD-2-Clause-Patent
6 |
7 | **/
8 |
9 | #include
10 | #include
11 |
12 | /**
13 | Switches the endianess of a 16-bit integer.
14 |
15 | This function swaps the bytes in a 16-bit unsigned value to switch the value
16 | from little endian to big endian or vice versa. The byte swapped value is
17 | returned.
18 |
19 | @param Value A 16-bit unsigned value.
20 |
21 | @return The byte swapped Value.
22 |
23 | **/
24 | UINT16
25 | EFIAPI
26 | SwapBytes16 (
27 | IN UINT16 Value
28 | )
29 | {
30 | return (UINT16) ((Value<< 8) | (Value>> 8));
31 | }
32 |
--------------------------------------------------------------------------------
/HBFA/UefiHostTestPkg/Library/BaseLibHost/SwapBytes32.c:
--------------------------------------------------------------------------------
1 | /** @file
2 | Math worker functions.
3 |
4 | Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.
5 | SPDX-License-Identifier: BSD-2-Clause-Patent
6 |
7 | **/
8 |
9 | #include
10 | #include
11 |
12 | /**
13 | Switches the endianess of a 32-bit integer.
14 |
15 | This function swaps the bytes in a 32-bit unsigned value to switch the value
16 | from little endian to big endian or vice versa. The byte swapped value is
17 | returned.
18 |
19 | @param Value A 32-bit unsigned value.
20 |
21 | @return The byte swapped Value.
22 |
23 | **/
24 | UINT32
25 | EFIAPI
26 | SwapBytes32 (
27 | IN UINT32 Value
28 | )
29 | {
30 | UINT32 LowerBytes;
31 | UINT32 HigherBytes;
32 |
33 | LowerBytes = (UINT32) SwapBytes16 ((UINT16) Value);
34 | HigherBytes = (UINT32) SwapBytes16 ((UINT16) (Value >> 16));
35 |
36 | return (LowerBytes << 16 | HigherBytes);
37 | }
38 |
--------------------------------------------------------------------------------
/HBFA/UefiHostTestPkg/Library/BaseLibHost/SwapBytes64.c:
--------------------------------------------------------------------------------
1 | /** @file
2 | Math worker functions.
3 |
4 | Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.
5 | SPDX-License-Identifier: BSD-2-Clause-Patent
6 |
7 | **/
8 |
9 | #include
10 | #include
11 |
12 | UINT64
13 | EFIAPI
14 | InternalMathSwapBytes64 (
15 | IN UINT64 Operand
16 | );
17 |
18 | /**
19 | Switches the endianess of a 64-bit integer.
20 |
21 | This function swaps the bytes in a 64-bit unsigned value to switch the value
22 | from little endian to big endian or vice versa. The byte swapped value is
23 | returned.
24 |
25 | @param Value A 64-bit unsigned value.
26 |
27 | @return The byte swapped Value.
28 |
29 | **/
30 | UINT64
31 | EFIAPI
32 | SwapBytes64 (
33 | IN UINT64 Value
34 | )
35 | {
36 | return InternalMathSwapBytes64 (Value);
37 | }
38 |
--------------------------------------------------------------------------------
/HBFA/UefiHostTestPkg/Library/BaseLibHost/X64/ReadTsc.nasm:
--------------------------------------------------------------------------------
1 | ;------------------------------------------------------------------------------
2 | ;
3 | ; Copyright (c) 2006, Intel Corporation. All rights reserved.
4 | ; SPDX-License-Identifier: BSD-2-Clause-Patent
5 | ;
6 | ; Module Name:
7 | ;
8 | ; ReadTsc.Asm
9 | ;
10 | ; Abstract:
11 | ;
12 | ; AsmReadTsc function
13 | ;
14 | ; Notes:
15 | ;
16 | ;------------------------------------------------------------------------------
17 |
18 | DEFAULT REL
19 | SECTION .text
20 |
21 | ;------------------------------------------------------------------------------
22 | ; UINT64
23 | ; EFIAPI
24 | ; AsmReadTsc (
25 | ; VOID
26 | ; );
27 | ;------------------------------------------------------------------------------
28 | global ASM_PFX(AsmReadTsc)
29 | ASM_PFX(AsmReadTsc):
30 | rdtsc
31 | shl rdx, 0x20
32 | or rax, rdx
33 | ret
34 |
35 |
--------------------------------------------------------------------------------
/HBFA/UefiHostTestPkg/Library/BaseLibHost/X86GdtrNull.c:
--------------------------------------------------------------------------------
1 | /** @file
2 | IA-32/x64 AsmReadGdtr()
3 |
4 | Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.
5 | SPDX-License-Identifier: BSD-2-Clause-Patent
6 |
7 | **/
8 |
9 | #include
10 | #include
11 |
12 | /**
13 | Reads the current Global Descriptor Table Register(GDTR) descriptor.
14 |
15 | Reads and returns the current GDTR descriptor and returns it in Gdtr. This
16 | function is only available on IA-32 and x64.
17 |
18 | If Gdtr is NULL, then ASSERT().
19 |
20 | @param Gdtr The pointer to a GDTR descriptor.
21 |
22 | **/
23 | VOID
24 | EFIAPI
25 | AsmReadGdtr (
26 | OUT IA32_DESCRIPTOR *Gdtr
27 | )
28 | {
29 | ASSERT (FALSE);
30 | }
31 |
32 | /**
33 | Writes the current Global Descriptor Table Register (GDTR) descriptor.
34 |
35 | Writes and the current GDTR descriptor specified by Gdtr. This function is
36 | only available on IA-32 and x64.
37 |
38 | If Gdtr is NULL, then ASSERT().
39 |
40 | @param Gdtr The pointer to a GDTR descriptor.
41 |
42 | **/
43 | VOID
44 | EFIAPI
45 | AsmWriteGdtr (
46 | IN CONST IA32_DESCRIPTOR *Gdtr
47 | )
48 | {
49 | ASSERT (FALSE);
50 | }
51 |
--------------------------------------------------------------------------------
/HBFA/UefiHostTestPkg/Library/BaseLibHost/X86IdtrNull.c:
--------------------------------------------------------------------------------
1 | /** @file
2 | IA-32/x64 AsmReadIdtr()
3 |
4 | Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.
5 | SPDX-License-Identifier: BSD-2-Clause-Patent
6 |
7 | **/
8 |
9 | #include
10 | #include
11 |
12 | /**
13 | Reads the current Interrupt Descriptor Table Register(IDTR) descriptor.
14 |
15 | Reads and returns the current IDTR descriptor and returns it in Idtr. This
16 | function is only available on IA-32 and x64.
17 |
18 | If Idtr is NULL, then ASSERT().
19 |
20 | @param Idtr The pointer to a IDTR descriptor.
21 |
22 | **/
23 | VOID
24 | EFIAPI
25 | AsmReadIdtr (
26 | OUT IA32_DESCRIPTOR *Idtr
27 | )
28 | {
29 | ASSERT (FALSE);
30 | }
31 |
32 | /**
33 | Writes the current Interrupt Descriptor Table Register(IDTR) descriptor.
34 |
35 | Writes the current IDTR descriptor and returns it in Idtr. This function is
36 | only available on IA-32 and x64.
37 |
38 | If Idtr is NULL, then ASSERT().
39 |
40 | @param Idtr The pointer to a IDTR descriptor.
41 |
42 | **/
43 | VOID
44 | EFIAPI
45 | AsmWriteIdtr (
46 | IN CONST IA32_DESCRIPTOR *Idtr
47 | )
48 | {
49 | ASSERT (FALSE);
50 | }
51 |
--------------------------------------------------------------------------------
/HBFA/UefiHostTestPkg/Library/BaseLibHost/X86MemoryFenceGcc.c:
--------------------------------------------------------------------------------
1 | /** @file
2 | GCC inline implementation of BaseLib processor specific functions.
3 |
4 | Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.
5 | Portions copyright (c) 2008 - 2009, Apple Inc. All rights reserved.
6 | SPDX-License-Identifier: BSD-2-Clause-Patent
7 |
8 | **/
9 |
10 |
11 | /**
12 | Used to serialize load and store operations.
13 |
14 | All loads and stores that proceed calls to this function are guaranteed to be
15 | globally visible when this function returns.
16 |
17 | **/
18 | VOID
19 | EFIAPI
20 | MemoryFence (
21 | VOID
22 | )
23 | {
24 | // This is a little bit of overkill and it is more about the compiler that it is
25 | // actually processor synchronization. This is like the _ReadWriteBarrier
26 | // Microsoft specific intrinsic
27 | __asm__ __volatile__ ("":::"memory");
28 | }
29 |
30 |
--------------------------------------------------------------------------------
/HBFA/UefiHostTestPkg/Library/BaseLibHost/X86MemoryFenceMsvc.c:
--------------------------------------------------------------------------------
1 | /** @file
2 | IA-32/x64 MemoryFence().
3 |
4 | Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.
5 | SPDX-License-Identifier: BSD-2-Clause-Patent
6 |
7 | **/
8 |
9 | void _ReadWriteBarrier (void);
10 | #pragma intrinsic(_ReadWriteBarrier)
11 |
12 | /**
13 | Used to serialize load and store operations.
14 |
15 | All loads and stores that proceed calls to this function are guaranteed to be
16 | globally visible when this function returns.
17 |
18 | **/
19 | VOID
20 | EFIAPI
21 | MemoryFence (
22 | VOID
23 | )
24 | {
25 | _ReadWriteBarrier ();
26 | return;
27 | }
28 |
--------------------------------------------------------------------------------
/HBFA/UefiHostTestPkg/Library/BaseLibNullCpuid/BaseLibNullCpuid.c:
--------------------------------------------------------------------------------
1 | /** @file
2 |
3 | Copyright (c) 2018, Intel Corporation. All rights reserved.
4 | SPDX-License-Identifier: BSD-2-Clause-Patent
5 |
6 | **/
7 |
8 | #include
9 | #include
10 | #include
11 |
12 | UINT32
13 | EFIAPI
14 | AsmCpuidEx (
15 | IN UINT32 Index,
16 | IN UINT32 SubIndex,
17 | OUT UINT32 *RegisterEax, OPTIONAL
18 | OUT UINT32 *RegisterEbx, OPTIONAL
19 | OUT UINT32 *RegisterEcx, OPTIONAL
20 | OUT UINT32 *RegisterEdx OPTIONAL
21 | )
22 | {
23 | ASSERT (FALSE);
24 | return 0;
25 | }
26 |
27 | UINT32
28 | EFIAPI
29 | AsmCpuid (
30 | IN UINT32 Index,
31 | OUT UINT32 *RegisterEax, OPTIONAL
32 | OUT UINT32 *RegisterEbx, OPTIONAL
33 | OUT UINT32 *RegisterEcx, OPTIONAL
34 | OUT UINT32 *RegisterEdx OPTIONAL
35 | )
36 | {
37 | ASSERT (FALSE);
38 | return 0;
39 | }
40 |
--------------------------------------------------------------------------------
/HBFA/UefiHostTestPkg/Library/BaseLibNullCpuid/BaseLibNullCpuid.inf:
--------------------------------------------------------------------------------
1 | ## @file
2 | # Component description file for TestUdf module.
3 | #
4 | # Copyright (c) 2018, Intel Corporation. All rights reserved.
5 | # SPDX-License-Identifier: BSD-2-Clause-Patent
6 | #
7 | ##
8 |
9 | [Defines]
10 | INF_VERSION = 0x00010005
11 | BASE_NAME = BaseLibNullCpuid
12 | FILE_GUID = 9099E2A7-8A28-4115-9F8E-B2865AECEF8A
13 | MODULE_TYPE = BASE
14 | VERSION_STRING = 1.0
15 | LIBRARY_CLASS = NULL
16 |
17 | #
18 | # The following information is for reference only and not required by the build tools.
19 | #
20 | # VALID_ARCHITECTURES = IA32 X64
21 | #
22 |
23 | [Sources]
24 | BaseLibNullCpuid.c
25 |
26 | [Packages]
27 | MdePkg/MdePkg.dec
28 |
29 | [LibraryClasses]
30 | BaseLib
31 | DebugLib
32 |
--------------------------------------------------------------------------------
/HBFA/UefiHostTestPkg/Library/BaseLibNullMsr/BaseLibNullMsr.inf:
--------------------------------------------------------------------------------
1 | ## @file
2 | # Component description file for TestUdf module.
3 | #
4 | # Copyright (c) 2018, Intel Corporation. All rights reserved.
5 | # SPDX-License-Identifier: BSD-2-Clause-Patent
6 | #
7 | ##
8 |
9 | [Defines]
10 | INF_VERSION = 0x00010005
11 | BASE_NAME = BaseLibNullMsr
12 | FILE_GUID = 24DFBE26-ED67-47F3-B4FC-F23C59C7AAD3
13 | MODULE_TYPE = BASE
14 | VERSION_STRING = 1.0
15 | LIBRARY_CLASS = NULL
16 |
17 | #
18 | # The following information is for reference only and not required by the build tools.
19 | #
20 | # VALID_ARCHITECTURES = IA32 X64
21 | #
22 |
23 | [Sources]
24 | BaseLibNullMsr.c
25 |
26 | [Packages]
27 | MdePkg/MdePkg.dec
28 |
29 | [LibraryClasses]
30 | BaseLib
31 | DebugLib
32 |
--------------------------------------------------------------------------------
/HBFA/UefiHostTestPkg/Library/BaseMemoryLibHost/BaseMemoryLibHost.inf:
--------------------------------------------------------------------------------
1 | ## @file
2 | #
3 | # Copyright (c) 2018, Intel Corporation. All rights reserved.
4 | # SPDX-License-Identifier: BSD-2-Clause-Patent
5 | #
6 | ##
7 |
8 | [Defines]
9 | INF_VERSION = 0x00010005
10 | BASE_NAME = BaseMemoryLibHost
11 | FILE_GUID = 90B7948B-DFED-46FB-BABE-770A5A464BA5
12 | MODULE_TYPE = BASE
13 | VERSION_STRING = 1.0
14 | LIBRARY_CLASS = BaseMemoryLib
15 |
16 | [Sources]
17 | BaseMemoryLibHost.c
18 |
19 | [Packages]
20 | MdePkg/MdePkg.dec
21 | UefiHostTestPkg/UefiHostTestPkg.dec
22 |
23 | [LibraryClasses]
24 | BaseLib
25 |
26 |
--------------------------------------------------------------------------------
/HBFA/UefiHostTestPkg/Library/BasePcdLibHost/BasePcdLibHost.inf:
--------------------------------------------------------------------------------
1 | ## @file
2 | # Instance of PCD Library without support of dynamic PCD entries.
3 | #
4 | # PCD Library that only provides access to Feature Flag, Fixed At Build,
5 | # and Binary Patch typed PCD entries. Access to Dynamic PCD entries is ignored.
6 | #
7 | # Copyright (c) 2007 - 2018, Intel Corporation. All rights reserved.
8 | #
9 | # SPDX-License-Identifier: BSD-2-Clause-Patent
10 | #
11 | #
12 | ##
13 |
14 | [Defines]
15 | INF_VERSION = 0x00010005
16 | BASE_NAME = BasePcdLibHost
17 | FILE_GUID = 388756FE-4860-44D2-81DB-1DD4E712F1BD
18 | MODULE_TYPE = BASE
19 | VERSION_STRING = 1.0
20 | LIBRARY_CLASS = PcdLib
21 |
22 | #
23 | # VALID_ARCHITECTURES = IA32 X64 EBC
24 | #
25 |
26 | [Sources]
27 | BasePcdLibHost.c
28 |
29 | [LibraryClasses]
30 | DebugLib
31 | BaseMemoryLib
32 |
33 | [Packages]
34 | MdePkg/MdePkg.dec
35 |
36 |
--------------------------------------------------------------------------------
/HBFA/UefiHostTestPkg/Library/BaseTimerLibHost/BaseTimerLibHost.inf:
--------------------------------------------------------------------------------
1 | ## @file
2 | # Base Timer Library
3 | #
4 | # Copyright (c) 2018, Intel Corporation. All rights reserved.
5 | #
6 | # SPDX-License-Identifier: BSD-2-Clause-Patent
7 | #
8 | #
9 | ##
10 |
11 | [Defines]
12 | INF_VERSION = 0x00010005
13 | BASE_NAME = BaseTimerLibHost
14 | FILE_GUID = 5E659347-D32A-4E8F-9299-7FEE78E645E9
15 | MODULE_TYPE = BASE
16 | VERSION_STRING = 1.0
17 | LIBRARY_CLASS = TimerLib
18 |
19 | #
20 | # VALID_ARCHITECTURES = IA32 X64 IPF EBC
21 | #
22 |
23 | [Sources]
24 | BaseTimerLibHost.c
25 |
26 |
27 | [Packages]
28 | MdePkg/MdePkg.dec
29 |
30 |
31 | [LibraryClasses]
32 | DebugLib
33 |
34 |
--------------------------------------------------------------------------------
/HBFA/UefiHostTestPkg/Library/DebugLibHost/DebugLibHost.inf:
--------------------------------------------------------------------------------
1 | ## @file
2 | #
3 | # Copyright (c) 2018, Intel Corporation. All rights reserved.
4 | # SPDX-License-Identifier: BSD-2-Clause-Patent
5 | #
6 | ##
7 |
8 | [Defines]
9 | INF_VERSION = 0x00010005
10 | BASE_NAME = DebugLibHost
11 | FILE_GUID = 6A77CE89-C1B6-4A6B-9561-07D7127514A7
12 | MODULE_TYPE = BASE
13 | VERSION_STRING = 1.0
14 | LIBRARY_CLASS = DebugLib
15 |
16 | [Sources]
17 | DebugLibHost.c
18 |
19 | [Packages]
20 | MdePkg/MdePkg.dec
21 | UefiHostTestPkg/UefiHostTestPkg.dec
22 |
23 | [LibraryClasses]
24 | BaseLib
25 | PrintLib
26 |
27 | [BuildOptions]
28 | MSFT:*_*_*_CC_FLAGS = /D _CRT_SECURE_NO_WARNINGS
29 | GCC:*_KLEE_*_CC_FLAGS = "-DTEST_WITH_KLEE=TRUE"
30 |
31 |
32 |
--------------------------------------------------------------------------------
/HBFA/UefiHostTestPkg/Library/DxeServicesTableLibHost/DxeServicesTableLibHost.inf:
--------------------------------------------------------------------------------
1 | ## @file
2 | # Instance of DXE Services Table Library using EFI Configuration Table.
3 | #
4 | # DXE Services Table Library that retrieves a pointer to the DXE Services
5 | # Table from the Configuration Table in the EFI System Table.
6 | #
7 | # Copyright (c) 2007 - 2018, Intel Corporation. All rights reserved.
8 | #
9 | # SPDX-License-Identifier: BSD-2-Clause-Patent
10 | #
11 | #
12 | ##
13 |
14 | [Defines]
15 | INF_VERSION = 0x00010005
16 | BASE_NAME = DxeServicesTableLib
17 | FILE_GUID = 3F614DC7-4B8B-4181-9AEF-995427F4E0A1
18 | MODULE_TYPE = BASE
19 | VERSION_STRING = 1.0
20 | LIBRARY_CLASS = DxeServicesTableLib
21 | CONSTRUCTOR = DxeServicesTableLibConstructor
22 |
23 | #
24 | # VALID_ARCHITECTURES = IA32 X64 EBC
25 | #
26 |
27 | [Sources]
28 | DxeServicesTableLibHost.c
29 | Gcd.c
30 |
31 | [Packages]
32 | MdePkg/MdePkg.dec
33 |
34 | [LibraryClasses]
35 | BaseLib
36 | BaseMemoryLib
37 | MemoryAllocationLib
38 | DebugLib
39 | UefiBootServicesTableLib
40 |
41 |
--------------------------------------------------------------------------------
/HBFA/UefiHostTestPkg/Library/HobLibHost/HobLibHost.inf:
--------------------------------------------------------------------------------
1 | ## @file
2 | #
3 | # Copyright (c) 2018, Intel Corporation. All rights reserved.
4 | # SPDX-License-Identifier: BSD-2-Clause-Patent
5 | #
6 | ##
7 |
8 | [Defines]
9 | INF_VERSION = 0x00010005
10 | BASE_NAME = HobLibHost
11 | FILE_GUID = 05DA0183-444E-497D-8B4F-76E910F1E12C
12 | MODULE_TYPE = BASE
13 | VERSION_STRING = 1.0
14 | LIBRARY_CLASS = HobLib
15 |
16 | [Sources]
17 | HobLibHost.c
18 |
19 | [Packages]
20 | MdePkg/MdePkg.dec
21 | UefiHostTestPkg/UefiHostTestPkg.dec
22 |
23 | [LibraryClasses]
24 | BaseLib
25 | BaseMemoryLib
26 | MemoryAllocationLib
27 |
28 | [Guids]
29 | gEfiHobMemoryAllocStackGuid
30 | gEfiHobMemoryAllocBspStoreGuid
31 | gEfiHobMemoryAllocModuleGuid
32 |
--------------------------------------------------------------------------------
/HBFA/UefiHostTestPkg/Library/MemoryAllocationLibHost/MemoryAllocationLibHost.inf:
--------------------------------------------------------------------------------
1 | ## @file
2 | #
3 | # Copyright (c) 2018, Intel Corporation. All rights reserved.
4 | # SPDX-License-Identifier: BSD-2-Clause-Patent
5 | #
6 | ##
7 |
8 | [Defines]
9 | INF_VERSION = 0x00010005
10 | BASE_NAME = MemoryAllocationLibHost
11 | FILE_GUID = A1672454-A3D3-4AAC-A86B-8D63132BBB91
12 | MODULE_TYPE = BASE
13 | VERSION_STRING = 1.0
14 | LIBRARY_CLASS = MemoryAllocationLib
15 |
16 | [Sources]
17 | MemoryAllocationLibHost.c
18 |
19 | [Packages]
20 | MdePkg/MdePkg.dec
21 | UefiHostTestPkg/UefiHostTestPkg.dec
22 |
23 | [LibraryClasses]
24 | BaseLib
25 |
26 |
--------------------------------------------------------------------------------
/HBFA/UefiHostTestPkg/Library/OsServiceLibHost/OsServiceLibGcc.c:
--------------------------------------------------------------------------------
1 | /**@file
2 |
3 | Copyright (c) 2019, Intel Corporation. All rights reserved.
4 | SPDX-License-Identifier: BSD-2-Clause-Patent
5 |
6 | **/
7 |
8 | #include
9 |
10 | VOID *
11 | AllocateExecutableMemory (
12 | IN UINTN Size
13 | )
14 | {
15 | VOID *Buffer;
16 | size_t FinalSize;
17 | size_t PageSize;
18 |
19 | PageSize = getpagesize();
20 |
21 | FinalSize = (Size + PageSize - 1) / PageSize * PageSize;
22 |
23 | Buffer = mmap(NULL, FinalSize, PROT_READ | PROT_WRITE | PROT_EXEC, MAP_ANONYMOUS | MAP_PRIVATE, 0, 0);
24 | if (Buffer == NULL) {
25 | return NULL;
26 | }
27 |
28 | return Buffer;
29 | }
30 |
31 | VOID
32 | FreeExecutableMemory (
33 | IN VOID *Buffer,
34 | IN UINTN Size
35 | )
36 | {
37 | size_t FinalSize;
38 | size_t PageSize;
39 |
40 | PageSize = getpagesize();
41 |
42 | FinalSize = (Size + PageSize - 1) / PageSize * PageSize;
43 |
44 | munmap (Buffer, FinalSize);
45 | }
46 |
--------------------------------------------------------------------------------
/HBFA/UefiHostTestPkg/Library/OsServiceLibHost/OsServiceLibHost.inf:
--------------------------------------------------------------------------------
1 | ## @file
2 | #
3 | # Copyright (c) 2017, Intel Corporation. All rights reserved.
4 | # SPDX-License-Identifier: BSD-2-Clause-Patent
5 | #
6 | ##
7 |
8 | [Defines]
9 | INF_VERSION = 0x00010005
10 | BASE_NAME = OsServiceLibHost
11 | FILE_GUID = 56DCD496-CD73-42D0-B145-B7C100CE5877
12 | MODULE_TYPE = BASE
13 | VERSION_STRING = 1.0
14 | LIBRARY_CLASS = OsServiceLib
15 |
16 | [Sources]
17 | OsServiceLibMsvc.c | MSFT
18 | OsServiceLibGcc.c | GCC
19 |
20 | [Packages]
21 | MdePkg/MdePkg.dec
22 |
23 | [LibraryClasses]
24 |
25 | [BuildOptions]
26 |
27 |
--------------------------------------------------------------------------------
/HBFA/UefiHostTestPkg/Library/OsServiceLibHost/OsServiceLibMsvc.c:
--------------------------------------------------------------------------------
1 | /**@file
2 |
3 | Copyright (c) 2019, Intel Corporation. All rights reserved.
4 | SPDX-License-Identifier: BSD-2-Clause-Patent
5 |
6 | **/
7 |
8 | #include
9 | #include
10 |
11 | VOID *
12 | AllocateExecutableMemory (
13 | IN UINTN Size
14 | )
15 | {
16 | VOID *Buffer;
17 | SIZE_T FinalSize;
18 | UINT32 PageSize;
19 | SYSTEM_INFO SystemInfo;
20 |
21 | GetSystemInfo(&SystemInfo);
22 | PageSize = SystemInfo.dwPageSize;
23 |
24 | FinalSize = (Size + PageSize - 1) / PageSize * PageSize;
25 |
26 | Buffer = VirtualAlloc(NULL, FinalSize, MEM_COMMIT, PAGE_EXECUTE_READWRITE);
27 | if (Buffer == NULL) {
28 | return NULL;
29 | }
30 |
31 | return Buffer;
32 | }
33 |
34 | VOID
35 | FreeExecutableMemory (
36 | IN VOID *Buffer,
37 | IN UINTN Size
38 | )
39 | {
40 | VirtualFree(Buffer, 0, MEM_RELEASE);
41 | }
42 |
--------------------------------------------------------------------------------
/HBFA/UefiHostTestPkg/Library/PeiServicesTablePointerLibHost/PeiServicesTablePointerLibHost.inf:
--------------------------------------------------------------------------------
1 | ## @file
2 | # Instance of PEI Services Table Pointer Library using global variable for the table pointer.
3 | #
4 | # PEI Services Table Pointer Library implementation that retrieves a pointer to the
5 | # PEI Services Table from a global variable. Not available to modules that execute from
6 | # read-only memory.
7 | #
8 | # Copyright (c) 2007 - 2018, Intel Corporation. All rights reserved.
9 | #
10 | # SPDX-License-Identifier: BSD-2-Clause-Patent
11 | #
12 | #
13 | ##
14 |
15 | [Defines]
16 | INF_VERSION = 0x00010005
17 | BASE_NAME = PeiServicesTablePointerLibHost
18 | FILE_GUID = AFA925DB-1728-4CE3-9171-E72548E8526A
19 | MODULE_TYPE = PEIM
20 | VERSION_STRING = 1.0
21 | LIBRARY_CLASS = PeiServicesTablePointerLibHost|PEIM PEI_CORE SEC
22 |
23 | #
24 | # VALID_ARCHITECTURES = IA32 X64 EBC (EBC is for build only)
25 | #
26 |
27 | [Sources]
28 | PeiServicesTablePointerLibHost.c
29 | Ppi.c
30 | CpuIo.c
31 | PciCfg2.c
32 |
33 | [Packages]
34 | MdePkg/MdePkg.dec
35 |
36 |
37 | [LibraryClasses]
38 | DebugLib
39 |
40 |
--------------------------------------------------------------------------------
/HBFA/UefiHostTestPkg/Library/PeimEntryPointHost/PeimEntryPointHost.c:
--------------------------------------------------------------------------------
1 | /** @file
2 | Entry point to a PEIM.
3 |
4 | Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.
5 | SPDX-License-Identifier: BSD-2-Clause-Patent
6 |
7 | **/
8 |
9 |
10 | #include
11 |
12 |
13 | #include
14 | #include
15 |
16 | /**
17 | The entry point of PE/COFF Image for a PEIM.
18 |
19 | This function is the entry point for a PEIM. This function must call ProcessLibraryConstructorList()
20 | and ProcessModuleEntryPointList(). The return value from ProcessModuleEntryPointList() is returned.
21 | If _gPeimRevision is not zero and PeiServices->Hdr.Revision is less than _gPeimRevison, then ASSERT().
22 |
23 | @param FileHandle Handle of the file being invoked.
24 | @param PeiServices Describes the list of possible PEI Services.
25 |
26 | @retval EFI_SUCCESS The PEIM executed normally.
27 | @retval !EFI_SUCCESS The PEIM failed to execute normally.
28 | **/
29 | EFI_STATUS
30 | EFIAPI
31 | _ModuleEntryPoint (
32 | IN EFI_PEI_FILE_HANDLE FileHandle,
33 | IN CONST EFI_PEI_SERVICES **PeiServices
34 | )
35 | {
36 | ASSERT(FALSE);
37 | return EFI_UNSUPPORTED;
38 | }
39 |
40 |
--------------------------------------------------------------------------------
/HBFA/UefiHostTestPkg/Library/PeimEntryPointHost/PeimEntryPointHost.inf:
--------------------------------------------------------------------------------
1 | ## @file
2 | # Module entry point library for PEIM.
3 | #
4 | # Copyright (c) 2007 - 2014, Intel Corporation. All rights reserved.
5 | #
6 | # SPDX-License-Identifier: BSD-2-Clause-Patent
7 | #
8 | #
9 | ##
10 |
11 | [Defines]
12 | INF_VERSION = 0x00010005
13 | BASE_NAME = PeimEntryPointHost
14 | FILE_GUID = CC3E60E7-92EC-4475-BFE2-A608E1776B73
15 | MODULE_TYPE = PEIM
16 | VERSION_STRING = 1.0
17 | LIBRARY_CLASS = PeimEntryPoint|PEIM
18 |
19 | #
20 | # VALID_ARCHITECTURES = IA32 X64 IPF EBC (EBC is for build only)
21 | #
22 |
23 | [Sources]
24 | PeimEntryPointHost.c
25 |
26 |
27 | [Packages]
28 | MdePkg/MdePkg.dec
29 |
30 |
31 | [LibraryClasses]
32 | DebugLib
33 |
34 |
--------------------------------------------------------------------------------
/HBFA/UefiHostTestPkg/Library/SmmMemLibHost/SmmMemLibHost.inf:
--------------------------------------------------------------------------------
1 | ## @file
2 | # Instance of SMM memory check library.
3 | #
4 | # Copyright (c) 2018, Intel Corporation. All rights reserved.
5 | # SPDX-License-Identifier: BSD-2-Clause-Patent
6 | #
7 | ##
8 |
9 | [Defines]
10 | INF_VERSION = 0x00010005
11 | BASE_NAME = SmmMemLibHost
12 | FILE_GUID = 7F23F839-C81C-4B89-8132-69746FCBCE52
13 | MODULE_TYPE = BASE
14 | VERSION_STRING = 1.0
15 | LIBRARY_CLASS = SmmMemLib
16 | LIBRARY_CLASS = SmmMemLibStubLib
17 |
18 | #
19 | # The following information is for reference only and not required by the build tools.
20 | #
21 | # VALID_ARCHITECTURES = IA32 X64
22 | #
23 |
24 | [Sources]
25 | SmmMemLibHost.c
26 |
27 | [Packages]
28 | MdePkg/MdePkg.dec
29 |
30 | [LibraryClasses]
31 | BaseMemoryLib
32 | DebugLib
33 |
34 |
--------------------------------------------------------------------------------
/HBFA/UefiHostTestPkg/Library/SmmServicesTableLibHost/SmmServicesTableLibHost.inf:
--------------------------------------------------------------------------------
1 | ## @file
2 | # SMM Services Table Library.
3 | #
4 | # Copyright (c) 2009 - 2014, Intel Corporation. All rights reserved.
5 | #
6 | # SPDX-License-Identifier: BSD-2-Clause-Patent
7 | #
8 | #
9 | ##
10 |
11 | [Defines]
12 | INF_VERSION = 0x00010005
13 | BASE_NAME = SmmServicesTableLibHost
14 | FILE_GUID = BC01EA4A-7CD7-456F-9BD3-1EF71FD0E026
15 | MODULE_TYPE = BASE
16 | VERSION_STRING = 1.0
17 | LIBRARY_CLASS = SmmServicesTableLib
18 | LIBRARY_CLASS = MmServicesTableLib
19 |
20 | #
21 | # VALID_ARCHITECTURES = IA32 X64 EBC
22 | #
23 |
24 | [Sources]
25 | SmmServicesTableLibHost.c
26 | PiSmmCore.c
27 | Handle.c
28 | Locate.c
29 | Notify.c
30 | InstallConfigurationTable.c
31 |
32 | [Packages]
33 | MdePkg/MdePkg.dec
34 | MdeModulePkg/MdeModulePkg.dec
35 | UefiHostTestPkg/UefiHostTestPkg.dec
36 |
37 | [LibraryClasses]
38 | BaseLib
39 | BaseMemoryLib
40 | MemoryAllocationLib
41 | DebugLib
42 |
43 |
44 |
--------------------------------------------------------------------------------
/HBFA/UefiHostTestPkg/Library/UefiBootServicesTableLibHost/UefiBootServicesTableLibHost.inf:
--------------------------------------------------------------------------------
1 | ## @file
2 | #
3 | # Copyright (c) 2018, Intel Corporation. All rights reserved.
4 | # SPDX-License-Identifier: BSD-2-Clause-Patent
5 | #
6 | ##
7 |
8 | [Defines]
9 | INF_VERSION = 0x00010005
10 | BASE_NAME = UefiBootServicesTableLibHost
11 | FILE_GUID = D440EF07-2EFD-4054-BEAC-88ED18722C8F
12 | MODULE_TYPE = BASE
13 | VERSION_STRING = 1.0
14 | LIBRARY_CLASS = UefiBootServicesTableLib
15 | CONSTRUCTOR = UefiBootServicesTableLibConstructor
16 |
17 | [Sources]
18 | UefiBootServicesTableLibHost.c
19 | DriverSupport.c
20 | Handle.c
21 | Locate.c
22 | Notify.c
23 | Tpl.c
24 | Library.c
25 |
26 | [Packages]
27 | MdePkg/MdePkg.dec
28 | MdeModulePkg/MdeModulePkg.dec
29 | UefiHostTestPkg/UefiHostTestPkg.dec
30 |
31 | [LibraryClasses]
32 | BaseLib
33 | BaseMemoryLib
34 | DevicePathLib
35 | PerformanceLib
36 |
37 | [Protocols]
38 | gEfiDevicePathProtocolGuid
39 | gEfiPlatformDriverOverrideProtocolGuid
40 | gEfiDriverBindingProtocolGuid
41 | gEfiBusSpecificDriverOverrideProtocolGuid
42 | gEfiDriverFamilyOverrideProtocolGuid
43 | gEfiLoadedImageProtocolGuid
44 |
--------------------------------------------------------------------------------
/HBFA/UefiHostTestPkg/Library/UefiDevicePathLibHost/UefiDevicePathLibHost.inf:
--------------------------------------------------------------------------------
1 | ## @file
2 | # Instance of Device Path Library based on Memory Allocation Library.
3 | #
4 | # Device Path Library that layers on top of the Memory Allocation Library.
5 | #
6 | # Copyright (c) 2007 - 2018, Intel Corporation. All rights reserved.
7 | #
8 | # SPDX-License-Identifier: BSD-2-Clause-Patent
9 | #
10 | #
11 | ##
12 |
13 | [Defines]
14 | INF_VERSION = 0x00010005
15 | BASE_NAME = UefiDevicePathLibHost
16 | FILE_GUID = 91c1677a-e57f-4191-8b8e-eb7711a716e0
17 | MODULE_TYPE = UEFI_DRIVER
18 | VERSION_STRING = 1.0
19 | LIBRARY_CLASS = DevicePathLib
20 |
21 |
22 | #
23 | # VALID_ARCHITECTURES = IA32 X64 EBC
24 | #
25 |
26 | [Sources]
27 | DevicePathUtilities.c
28 | UefiDevicePathLib.c
29 | UefiDevicePathLib.h
30 |
31 | [Packages]
32 | MdePkg/MdePkg.dec
33 |
34 |
35 | [LibraryClasses]
36 | BaseLib
37 | MemoryAllocationLib
38 | DebugLib
39 | BaseMemoryLib
40 |
41 | [Pcd]
42 | gEfiMdePkgTokenSpaceGuid.PcdMaximumDevicePathNodeCount ## SOMETIMES_CONSUMES
43 |
44 |
--------------------------------------------------------------------------------
/HBFA/UefiHostTestPkg/Library/UefiLibHost/UefiLibInternal.h:
--------------------------------------------------------------------------------
1 | /** @file
2 | Internal include file for UefiLib.
3 |
4 | Copyright (c) 2007 - 2017, Intel Corporation. All rights reserved.
5 | SPDX-License-Identifier: BSD-2-Clause-Patent
6 | **/
7 |
8 | #ifndef __UEFI_LIB_INTERNAL_H_
9 | #define __UEFI_LIB_INTERNAL_H_
10 |
11 |
12 | #include
13 | #include
14 | #include
15 | #include
16 | #include
17 | #include
18 | #include
19 | #include
20 | #include
21 | #include
22 | #include
23 | #include
24 |
25 | #include
26 | #include
27 | #include
28 | #include
29 | #include
30 | #include
31 | #include
32 | #include
33 | #include
34 | #include
35 | #include
36 | #include
37 | #include
38 |
39 | #endif
40 |
--------------------------------------------------------------------------------
/HBFA/UefiHostTestPkg/Library/UefiRuntimeServicesTableLibHost/Time.c:
--------------------------------------------------------------------------------
1 | /** @file
2 |
3 | Copyright (c) 2018, Intel Corporation. All rights reserved.
4 | SPDX-License-Identifier: BSD-2-Clause-Patent
5 |
6 | **/
7 |
8 | #include
9 | #include
10 | #include
11 | #include
12 | #include
13 |
14 | #include
15 | #include
16 | #include
17 |
18 | EFI_STATUS
19 | EFIAPI
20 | CoreGetTime (
21 | OUT EFI_TIME *Time,
22 | OUT EFI_TIME_CAPABILITIES *Capabilities OPTIONAL
23 | )
24 | {
25 | time_t timer;
26 | struct tm *info;
27 |
28 | if (Time != NULL) {
29 | ZeroMem (Time, sizeof(*Time));
30 | time (&timer);
31 | info = localtime (&timer);
32 | Time->Year = (UINT16)(info->tm_year + 1900);
33 | Time->Month = (UINT8)(info->tm_mon + 1);
34 | Time->Day = (UINT8)info->tm_mday;
35 | Time->Hour = (UINT8)info->tm_hour;
36 | Time->Minute = (UINT8)info->tm_min;
37 | Time->Second = (UINT8)info->tm_sec;
38 | }
39 | if (Capabilities != NULL) {
40 | ZeroMem (Capabilities, sizeof(*Capabilities));
41 | }
42 | return EFI_SUCCESS;
43 | }
44 |
--------------------------------------------------------------------------------
/HBFA/UefiHostTestPkg/Library/UefiRuntimeServicesTableLibHost/UefiRuntimeServicesTableLibHost.inf:
--------------------------------------------------------------------------------
1 | ## @file
2 | #
3 | # Copyright (c) 2018, Intel Corporation. All rights reserved.
4 | # SPDX-License-Identifier: BSD-2-Clause-Patent
5 | #
6 | ##
7 |
8 | [Defines]
9 | INF_VERSION = 0x00010005
10 | BASE_NAME = UefiRuntimeServicesTableLibHost
11 | FILE_GUID = 2F5F71C6-932D-4F91-ACC2-ED886DE088A0
12 | MODULE_TYPE = BASE
13 | VERSION_STRING = 1.0
14 | LIBRARY_CLASS = UefiRuntimeServicesTableLib
15 |
16 | [Sources]
17 | UefiRuntimeServicesTableLibHost.c
18 | Time.c
19 | OsVariable.c
20 | AuthVariable.c
21 | AuthVarCertDB.c
22 | Variable.c
23 |
24 | [Packages]
25 | MdePkg/MdePkg.dec
26 | MdeModulePkg/MdeModulePkg.dec
27 | SecurityPkg/SecurityPkg.dec
28 | CryptoPkg/CryptoPkg.dec
29 | UefiHostTestPkg/UefiHostTestPkg.dec
30 |
31 | [LibraryClasses]
32 | BaseLib
33 | BaseMemoryLib
34 | UefiBootServicesTableLib
35 |
36 | [Guids]
37 | gEfiGlobalVariableGuid
38 | gEfiImageSecurityDatabaseGuid
39 | gEfiCertDbGuid
40 | gEfiCertX509Sha256Guid
41 | gEfiCertX509Sha384Guid
42 | gEfiCertX509Sha512Guid
43 | gEfiCertPkcs7Guid
44 |
--------------------------------------------------------------------------------
/HBFA/UefiHostTestPkg/Library/UefiRuntimeServicesTableLibHost/VariableCommon.h:
--------------------------------------------------------------------------------
1 | /** @file
2 | The header of common Variable.c
3 |
4 | Copyright (c) 2018, Intel Corporation. All rights reserved.
5 | SPDX-License-Identifier: BSD-2-Clause-Patent
6 |
7 | **/
8 |
9 | #ifndef __VARIABLE_COMMON_H__
10 | #define __VARIABLE_COMMON_H__
11 |
12 | typedef enum {
13 | VariableTypeNormal,
14 | VariableTypeCountBasedAuth,
15 | VariableTypeTimeBasedAuth,
16 | VariableTypeUnknown,
17 | } VARIABLE_TYPE;
18 |
19 | EFI_STATUS
20 | CreateVariableList (
21 | IN LIST_ENTRY *StorageListHead,
22 | IN CHAR16 *Name,
23 | IN EFI_GUID *Guid,
24 | IN UINT32 Attributes,
25 | IN EFI_TIME *TimeStamp,
26 | IN UINTN Size,
27 | IN UINT8 *Buffer,
28 | IN BOOLEAN Append
29 | );
30 |
31 | EFI_STATUS
32 | DeleteVariableList (
33 | IN LIST_ENTRY *StorageListHead,
34 | IN CHAR16 *Name,
35 | IN EFI_GUID *Guid
36 | );
37 |
38 | LIST_ENTRY *
39 | FindVariableList (
40 | IN LIST_ENTRY *StorageListHead,
41 | IN CHAR16 *Name,
42 | IN EFI_GUID *Guid
43 | );
44 |
45 | VARIABLE_INFO_PRIVATE*
46 | FindVariableInfoPtr(
47 | IN CHAR16 *VariableName,
48 | IN EFI_GUID *VendorGuid
49 | );
50 |
51 | #endif // _EFI_VARIABLE_COMMON_H_
52 |
--------------------------------------------------------------------------------
/HBFA/UefiHostTestPkg/Library/VarCheckLibNull/VarCheckLibNull.inf:
--------------------------------------------------------------------------------
1 | ## @file
2 | # Provides variable check services and database management.
3 | #
4 | # Copyright (c) 2015, Intel Corporation. All rights reserved.
5 | #
6 | # SPDX-License-Identifier: BSD-2-Clause-Patent
7 | #
8 | ##
9 |
10 | [Defines]
11 | INF_VERSION = 0x00010005
12 | BASE_NAME = VarCheckLibNull
13 | FILE_GUID = 531905B9-0DB7-4CB0-82A1-917DCEE51D6F
14 | MODULE_TYPE = BASE
15 | VERSION_STRING = 1.0
16 | LIBRARY_CLASS = VarCheckLib
17 |
18 | #
19 | # The following information is for reference only and not required by the build tools.
20 | #
21 | # VALID_ARCHITECTURES = IA32 X64
22 | #
23 |
24 | [Sources]
25 | VarCheckLibNull.c
26 |
27 | [Packages]
28 | MdePkg/MdePkg.dec
29 | MdeModulePkg/MdeModulePkg.dec
30 |
31 | [LibraryClasses]
32 | BaseLib
33 | BaseMemoryLib
34 | DebugLib
35 | MemoryAllocationLib
36 |
37 | [Guids]
38 | ## SOMETIMES_CONSUMES ## Variable:L"Boot####"
39 | ## SOMETIMES_CONSUMES ## Variable:L"Driver####"
40 | ## SOMETIMES_CONSUMES ## Variable:L"SysPrep####"
41 | ## SOMETIMES_CONSUMES ## Variable:L"Key####"
42 | gEfiGlobalVariableGuid
43 | gEfiHardwareErrorVariableGuid ## SOMETIMES_CONSUMES ## Variable:L"HwErrRec####"
44 |
--------------------------------------------------------------------------------
/HBFA/UefiHostTestPkg/UefiHostTestPkg.dec:
--------------------------------------------------------------------------------
1 | ## @file UefiHostTestPkg.dec
2 | #
3 | # Copyright (c) 2018, Intel Corporation. All rights reserved.
4 | # SPDX-License-Identifier: BSD-2-Clause-Patent
5 | #
6 | ##
7 |
8 | [Defines]
9 | DEC_SPECIFICATION = 0x00010005
10 | PACKAGE_NAME = UefiHostTestPkg
11 | PACKAGE_GUID = 1D212CA8-77BF-4957-80DA-75609227E70C
12 | PACKAGE_VERSION = 0.11
13 |
14 | [Includes.common]
15 | Include
--------------------------------------------------------------------------------
/HBFA/UefiHostTestTools/Report/__init__.py:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/intel/HBFA-FL/a803974fd721e973781e4ec144b894843f7ef567/HBFA/UefiHostTestTools/Report/__init__.py
--------------------------------------------------------------------------------
/HBFA/UefiHostTestTools/Script/RunAllSeeds.py:
--------------------------------------------------------------------------------
1 | # @file
2 | #
3 | # Copyright (c) 2018, Intel Corporation. All rights reserved.
4 | # SPDX-License-Identifier: BSD-2-Clause-Patent
5 | #
6 |
7 | import os
8 | import sys
9 | import subprocess
10 |
11 | workdir = os.getcwd()
12 |
13 | tcsbin_path = sys.argv[1]
14 | findings_dir_path = sys.argv[2]
15 |
16 |
17 | def run_all_seeds():
18 | for root, dirs, files in os.walk(findings_dir_path):
19 | for dir in dirs:
20 | if dir in ['crashed', 'hangs', 'queue']:
21 | dir_path = os.path.join(root, dir)
22 | for file in os.listdir(dir_path):
23 | file_path = os.path.join(dir_path, file)
24 | if os.path.isfile(file_path):
25 | cmd = './' + tcsbin_path + ' ' + file_path
26 | print(cmd)
27 | try:
28 | subprocess.run(cmd.split(' '), shell=False,
29 | check=True)
30 | except subprocess.CalledProcessError as e:
31 | print(e)
32 |
33 |
34 | if __name__ == '__main__':
35 | run_all_seeds()
36 |
--------------------------------------------------------------------------------
/HBFA/UefiHostTestTools/__init__.py:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/intel/HBFA-FL/a803974fd721e973781e4ec144b894843f7ef567/HBFA/UefiHostTestTools/__init__.py
--------------------------------------------------------------------------------
/HBFA/UefiHostTestTools/__pycache__/RunAFL.cpython-311.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/intel/HBFA-FL/a803974fd721e973781e4ec144b894843f7ef567/HBFA/UefiHostTestTools/__pycache__/RunAFL.cpython-311.pyc
--------------------------------------------------------------------------------
/HBFA/UefiHostTestTools/__pycache__/RunAFLTurbo.cpython-311.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/intel/HBFA-FL/a803974fd721e973781e4ec144b894843f7ef567/HBFA/UefiHostTestTools/__pycache__/RunAFLTurbo.cpython-311.pyc
--------------------------------------------------------------------------------
/HBFA/UefiHostTestTools/__pycache__/RunKLEE.cpython-311.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/intel/HBFA-FL/a803974fd721e973781e4ec144b894843f7ef567/HBFA/UefiHostTestTools/__pycache__/RunKLEE.cpython-311.pyc
--------------------------------------------------------------------------------
/HBFA/UefiHostTestTools/__pycache__/RunLibFuzzer.cpython-311.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/intel/HBFA-FL/a803974fd721e973781e4ec144b894843f7ef567/HBFA/UefiHostTestTools/__pycache__/RunLibFuzzer.cpython-311.pyc
--------------------------------------------------------------------------------
/HBFA/UefiHostTestTools/__pycache__/__init__.cpython-311.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/intel/HBFA-FL/a803974fd721e973781e4ec144b894843f7ef567/HBFA/UefiHostTestTools/__pycache__/__init__.cpython-311.pyc
--------------------------------------------------------------------------------
/HBFA/UefiInstrumentTestCasePkg/ReadMe-BME.txt:
--------------------------------------------------------------------------------
1 | How to collect PCI BME access in BIOS?
2 | ==============
3 | 1) Add below in Platform.dsc
4 |
5 | [LibraryClasses.common]
6 | NULL|UefiInstrumentTestPkg/Library/InstrumentLib/InstrumentLib.inf
7 | InstrumentHookLib|UefiInstrumentTestPkg/TestCase/InstrumentHookLibTracingPci/InstrumentHookLibTracingPci.inf
8 |
9 | DebugLib|MdePkg/Library/BaseDebugLibSerialPort/BaseDebugLibSerialPort.inf
10 | DebugPrintErrorLevelLib|MdePkg/Library/BaseDebugPrintErrorLevelLib/BaseDebugPrintErrorLevelLib.inf
11 | SerialPortLib|PcAtChipsetPkg/Library/SerialIoLib/SerialIoLib.inf
12 |
13 | NOTE: The UefiInstrumentTestPkg provides the hook capability.
14 | NOTE: Overriding debug serial port lib is needed, because we want to use simple serial port output to dump the resource access.
15 |
16 | 2) Add below in Platform.dsc
17 |
18 | [Components]
19 |
20 | MdePkg/Library/BaseIoLibIntrinsic/BaseIoLibIntrinsic.inf {
21 |
22 | MSFT: *_*_*_CC_FLAGS = /Gh /GH /Od /GL-
23 | }
24 |
25 | 3) Build and run the new BIOS image.
26 | You may see some resource access below:
27 |
28 | RSC_TRACE: MmioRead8(0xE00F9004->0x06) - FFF0ACA0 from FFF0AB41 (*** TOUCH PCIE BME ***)
29 | RSC_TRACE: MmioWrite8(0xE00F9004<-0x06) - FFF0ADF0 from FFF0AB57 (*** TOUCH PCIE BME ***)
30 |
31 | RSC_TRACE: IoWrite32(0xCF8<-0x80000004) - 89FEF558 from 89FEE52A (*** TOUCH PCI BME ***)
32 | RSC_TRACE: IoRead32(0xCFC->0x20900006) - 89FEF46C from 89FEE532
33 |
--------------------------------------------------------------------------------
/HBFA/UefiInstrumentTestCasePkg/TestCase/InstrumentHookLibTracingPci/InstrumentHookLibTracingPci.inf:
--------------------------------------------------------------------------------
1 | ## @file
2 | #
3 | # Copyright (c) 2017, Intel Corporation. All rights reserved.
4 | # SPDX-License-Identifier: BSD-2-Clause-Patent
5 | #
6 | ##
7 |
8 | [Defines]
9 | INF_VERSION = 0x00010005
10 | BASE_NAME = InstrumentHookLibTracingPci
11 | FILE_GUID = 7973B1E7-660A-486A-87D9-8EEE17079B9B
12 | MODULE_TYPE = BASE
13 | VERSION_STRING = 1.0
14 | LIBRARY_CLASS = InstrumentHookLib
15 |
16 | [Sources]
17 | InstrumentHookLibTracingPci.c
18 |
19 | [Packages]
20 | MdePkg/MdePkg.dec
21 | UefiInstrumentTestPkg/UefiInstrumentTestPkg.dec
22 |
23 | [LibraryClasses]
24 | BaseLib
25 | BaseMemoryLib
26 | MemoryAllocationLib
27 | DebugLib
28 | IoLib
29 |
30 | [Pcd]
31 | gEfiMdePkgTokenSpaceGuid.PcdPciExpressBaseAddress
32 |
33 | [BuildOptions]
34 | MSFT:*_*_*_CC_FLAGS = /Od /GL-
35 | GCC:*_*_*_CC_FLAGS = -O0
36 |
37 |
--------------------------------------------------------------------------------
/HBFA/UefiInstrumentTestCasePkg/TestCase/Usb2HcHook/Usb2HcHook.inf:
--------------------------------------------------------------------------------
1 | ## @file
2 | #
3 | # Copyright (c) 2017, Intel Corporation. All rights reserved.
4 | # SPDX-License-Identifier: BSD-2-Clause-Patent
5 | #
6 | ##
7 |
8 | [Defines]
9 | INF_VERSION = 0x00010005
10 | BASE_NAME = Usb2HcHook
11 | FILE_GUID = 55813F94-A25D-4408-BE66-E8F9EDE62310
12 | MODULE_TYPE = DXE_DRIVER
13 | PI_SPECIFICATION_VERSION = 0x0001000A
14 | VERSION_STRING = 1.0
15 | ENTRY_POINT = InitializeUsb2HcHook
16 |
17 | [Sources]
18 | Usb2HcHook.c
19 |
20 | [Packages]
21 | MdePkg/MdePkg.dec
22 |
23 | [LibraryClasses]
24 | BaseLib
25 | BaseMemoryLib
26 | MemoryAllocationLib
27 | DebugLib
28 | UefiBootServicesTableLib
29 | UefiDriverEntryPoint
30 | UefiLib
31 |
32 | [Protocols]
33 | gEfiUsb2HcProtocolGuid
34 |
35 | [Depex]
36 | TRUE
--------------------------------------------------------------------------------
/HBFA/UefiInstrumentTestCasePkg/UefiInstrumentTestCasePkg.dec:
--------------------------------------------------------------------------------
1 | ## @file
2 | #
3 | # Copyright (c) 2018, Intel Corporation. All rights reserved.
4 | #
5 | # SPDX-License-Identifier: BSD-2-Clause-Patent
6 | #
7 | ##
8 |
9 | [Defines]
10 | DEC_SPECIFICATION = 0x00010005
11 | PACKAGE_NAME = UefiInstrumentTestCasePkg
12 | PACKAGE_GUID = F9F21376-CF30-4DA2-B164-F0035465EC3D
13 | PACKAGE_VERSION = 0.11
14 |
15 | [Includes]
16 |
--------------------------------------------------------------------------------
/HBFA/UefiInstrumentTestPkg/Library/IniParsingLib/IniParsingLib.inf:
--------------------------------------------------------------------------------
1 | ## @file
2 | # INI configuration parsing library.
3 | #
4 | # This library parses the INI configuration file.
5 | #
6 | # Copyright (c) 2016, Intel Corporation. All rights reserved.
7 | # SPDX-License-Identifier: BSD-2-Clause-Patent
8 | #
9 | ##
10 |
11 | [Defines]
12 | INF_VERSION = 0x00010005
13 | BASE_NAME = IniParsingLib
14 | MODULE_UNI_FILE = IniParsingLib.uni
15 | FILE_GUID = 6E4CD200-43E5-43CE-89E9-D715CF9526C4
16 | MODULE_TYPE = BASE
17 | VERSION_STRING = 1.0
18 | LIBRARY_CLASS = IniParsingLib
19 |
20 | #
21 | # The following information is for reference only and not required by the build tools.
22 | #
23 | # VALID_ARCHITECTURES = IA32 X64 IPF EBC
24 | #
25 |
26 | [Sources]
27 | IniParsingLib.c
28 |
29 | [Packages]
30 | MdePkg/MdePkg.dec
31 | UefiInstrumentTestPkg/UefiInstrumentTestPkg.dec
32 |
33 | [LibraryClasses]
34 | BaseLib
35 | BaseMemoryLib
36 | DebugLib
37 | MemoryAllocationLib
38 |
--------------------------------------------------------------------------------
/HBFA/UefiInstrumentTestPkg/Library/IniParsingLib/IniParsingLib.uni:
--------------------------------------------------------------------------------
1 | // /** @file
2 | // INI configuration parsing library.
3 | //
4 | // This library parses the INI configuration file.
5 | //
6 | // Copyright (c) 2016, Intel Corporation. All rights reserved.
7 | //
8 | // SPDX-License-Identifier: BSD-2-Clause-Patent
9 | //
10 | // **/
11 |
12 |
13 | #string STR_MODULE_ABSTRACT #language en-US "INI configuration parsing library."
14 |
15 | #string STR_MODULE_DESCRIPTION #language en-US "This library parses the INI configuration file."
16 |
17 |
--------------------------------------------------------------------------------
/HBFA/UefiInstrumentTestPkg/Library/InstrumentHookLibNull/InstrumentHookLibNull.c:
--------------------------------------------------------------------------------
1 | /** @file
2 |
3 | Copyright (c) 2017, Intel Corporation. All rights reserved.
4 | SPDX-License-Identifier: BSD-2-Clause-Patent
5 |
6 | **/
7 |
8 | #include
9 | #include
10 |
11 | UINTN
12 | EFIAPI
13 | FunctionEnter (
14 | IN OUT FUNC_ENTER_CONTEXT EntryContext,
15 | IN UINTN FunctionAddress,
16 | IN UINTN CallerAddress
17 | )
18 | {
19 | return 0;
20 | }
21 |
22 | VOID
23 | EFIAPI
24 | FunctionExit (
25 | IN OUT FUNC_EXIT_CONTEXT ExitContext,
26 | IN UINTN FunctionAddress,
27 | IN UINTN CallerAddress
28 | )
29 | {
30 | return ;
31 | }
32 |
--------------------------------------------------------------------------------
/HBFA/UefiInstrumentTestPkg/Library/InstrumentHookLibNull/InstrumentHookLibNull.inf:
--------------------------------------------------------------------------------
1 | ## @file
2 | #
3 | # Copyright (c) 2017, Intel Corporation. All rights reserved.
4 | # SPDX-License-Identifier: BSD-2-Clause-Patent
5 | #
6 | ##
7 |
8 | [Defines]
9 | INF_VERSION = 0x00010005
10 | BASE_NAME = InstrumentHookLibNull
11 | FILE_GUID = B3044F07-E1C8-412B-ADD5-AD93DB330966
12 | MODULE_TYPE = BASE
13 | VERSION_STRING = 1.0
14 | LIBRARY_CLASS = InstrumentHookLib
15 |
16 | [Sources]
17 | InstrumentHookLibNull.c
18 |
19 | [Packages]
20 | MdePkg/MdePkg.dec
21 | UefiInstrumentTestPkg/UefiInstrumentTestPkg.dec
22 |
23 | [LibraryClasses]
24 | BaseLib
25 | BaseMemoryLib
26 |
27 | [BuildOptions]
28 | MSFT:*_*_*_CC_FLAGS = /Od /GL-
29 | GCC:*_*_*_CC_FLAGS = -O0
30 |
--------------------------------------------------------------------------------
/HBFA/UefiInstrumentTestPkg/Library/InstrumentLib/Ia32/CygProfileEnterExitStub.c:
--------------------------------------------------------------------------------
1 | /** @file
2 |
3 | Copyright (c) 2017, Intel Corporation. All rights reserved.
4 | SPDX-License-Identifier: BSD-2-Clause-Patent
5 |
6 | **/
7 |
8 | #include
9 | #include
10 | #include
11 | #include
12 |
13 | UINTN
14 | EFIAPI
15 | CygProfileEnter (
16 | IN OUT FUNC_ENTER_CONTEXT EntryContext,
17 | IN UINTN CallerAddress,
18 | IN UINTN FunctionAddress
19 | )
20 | {
21 | EntryContext.Ia32->Esp = EntryContext.Ia32->Ebp;
22 | EntryContext.Ia32->Esp += 4; // the caller to the caller to __cyg_profile_func_enter
23 |
24 | return FunctionEnter (EntryContext, FunctionAddress, CallerAddress);
25 | }
26 |
27 | VOID
28 | EFIAPI
29 | CygProfileExit (
30 | IN OUT FUNC_EXIT_CONTEXT ExitContext,
31 | IN UINTN CallerAddress,
32 | IN UINTN FunctionAddress
33 | )
34 | {
35 | ExitContext.Ia32->Esp = ExitContext.Ia32->Ebp;
36 | ExitContext.Ia32->Esp += 4; // the caller to the caller to __cyg_profile_func_enter
37 |
38 | FunctionExit (ExitContext, FunctionAddress, CallerAddress);
39 | }
40 |
--------------------------------------------------------------------------------
/HBFA/UefiInstrumentTestPkg/Library/InstrumentLib/InstrumentLib.inf:
--------------------------------------------------------------------------------
1 | ## @file
2 | #
3 | # Copyright (c) 2017, Intel Corporation. All rights reserved.
4 | # SPDX-License-Identifier: BSD-2-Clause-Patent
5 | #
6 | ##
7 |
8 | [Defines]
9 | INF_VERSION = 0x00010005
10 | BASE_NAME = InstrumentLib
11 | FILE_GUID = 06C8E8A4-C8A8-4E19-B38D-13F0E1E48470
12 | MODULE_TYPE = BASE
13 | VERSION_STRING = 1.0
14 | LIBRARY_CLASS = NULL
15 |
16 | [Sources]
17 |
18 | [Sources.Ia32]
19 | Ia32/FuncParamMsvc.c | MSFT
20 | Ia32/PEnterExit.nasm | MSFT
21 | Ia32/PEnterExitStub.c | MSFT
22 | Ia32/FuncParamGcc.c | GCC
23 | Ia32/CygProfileEnterExit.nasm | GCC
24 | Ia32/CygProfileEnterExitStub.c | GCC
25 |
26 | [Sources.X64]
27 | X64/FuncParamMsvc.c | MSFT
28 | X64/PEnterExit.nasm | MSFT
29 | X64/PEnterExitStub.c | MSFT
30 | X64/FuncParamGcc.c | GCC
31 | X64/CygProfileEnterExit.nasm | GCC
32 | X64/CygProfileEnterExitStub.c | GCC
33 |
34 | [Packages]
35 | MdePkg/MdePkg.dec
36 | UefiInstrumentTestPkg/UefiInstrumentTestPkg.dec
37 |
38 | [LibraryClasses]
39 | BaseLib
40 | InstrumentHookLib
41 | DebugLib
42 |
43 | [BuildOptions]
44 | # https://msdn.microsoft.com/en-us/library/c63a9b7h.aspx
45 | MSFT:*_*_*_CC_FLAGS = /Od /GL-
46 | # https://gcc.gnu.org/onlinedocs/gcc-4.3.3/gcc/Code-Gen-Options.html#Code-Gen-Options
47 | GCC:*_*_*_CC_FLAGS = -O0
48 |
49 |
--------------------------------------------------------------------------------
/HBFA/UefiInstrumentTestPkg/Library/InstrumentLib/X64/CygProfileEnterExitStub.c:
--------------------------------------------------------------------------------
1 | /** @file
2 |
3 | Copyright (c) 2017, Intel Corporation. All rights reserved.
4 | SPDX-License-Identifier: BSD-2-Clause-Patent
5 |
6 | **/
7 |
8 | #include
9 | #include
10 | #include
11 | #include
12 |
13 | UINTN
14 | EFIAPI
15 | CygProfileEnter (
16 | IN OUT FUNC_ENTER_CONTEXT EntryContext,
17 | IN UINTN CallerAddress,
18 | IN UINTN FunctionAddress
19 | )
20 | {
21 | EntryContext.X64->Rsp = EntryContext.X64->Rbp;
22 | EntryContext.X64->Rsp += 8; // the caller to the caller to __cyg_profile_func_enter
23 |
24 | return FunctionEnter (EntryContext, FunctionAddress, CallerAddress);
25 | }
26 |
27 | VOID
28 | EFIAPI
29 | CygProfileExit (
30 | IN OUT FUNC_EXIT_CONTEXT ExitContext,
31 | IN UINTN CallerAddress,
32 | IN UINTN FunctionAddress
33 | )
34 | {
35 | ExitContext.X64->Rsp = ExitContext.X64->Rbp;
36 | ExitContext.X64->Rsp += 8; // the caller to the caller to __cyg_profile_func_enter
37 |
38 | FunctionExit (ExitContext, FunctionAddress, CallerAddress);
39 | }
40 |
--------------------------------------------------------------------------------
/HBFA/UefiInstrumentTestPkg/Library/SimpleSynchronizationLib/Ia32/InterlockedCompareExchange32.asm:
--------------------------------------------------------------------------------
1 | ;------------------------------------------------------------------------------
2 | ;
3 | ; Copyright (c) 2006, Intel Corporation. All rights reserved.
4 | ; SPDX-License-Identifier: BSD-2-Clause-Patent
5 | ;
6 | ; Module Name:
7 | ;
8 | ; InterlockedCompareExchange32.Asm
9 | ;
10 | ; Abstract:
11 | ;
12 | ; InterlockedCompareExchange32 function
13 | ;
14 | ; Notes:
15 | ;
16 | ;------------------------------------------------------------------------------
17 |
18 | .486
19 | .model flat,C
20 | .code
21 |
22 | ;------------------------------------------------------------------------------
23 | ; UINT32
24 | ; EFIAPI
25 | ; InternalSyncCompareExchange32 (
26 | ; IN volatile UINT32 *Value,
27 | ; IN UINT32 CompareValue,
28 | ; IN UINT32 ExchangeValue
29 | ; );
30 | ;------------------------------------------------------------------------------
31 | InternalSyncCompareExchange32 PROC
32 | mov ecx, [esp + 4]
33 | mov eax, [esp + 8]
34 | mov edx, [esp + 12]
35 | lock cmpxchg [ecx], edx
36 | ret
37 | InternalSyncCompareExchange32 ENDP
38 |
39 | END
40 |
--------------------------------------------------------------------------------
/HBFA/UefiInstrumentTestPkg/Library/SimpleSynchronizationLib/Ia32/InterlockedCompareExchange32.c:
--------------------------------------------------------------------------------
1 | /** @file
2 | InterlockedCompareExchange32 function
3 |
4 | Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.
5 | SPDX-License-Identifier: BSD-2-Clause-Patent
6 |
7 | **/
8 |
9 |
10 |
11 |
12 | /**
13 | Performs an atomic compare exchange operation on a 32-bit unsigned integer.
14 |
15 | Performs an atomic compare exchange operation on the 32-bit unsigned integer
16 | specified by Value. If Value is equal to CompareValue, then Value is set to
17 | ExchangeValue and CompareValue is returned. If Value is not equal to CompareValue,
18 | then Value is returned. The compare exchange operation must be performed using
19 | MP safe mechanisms.
20 |
21 | @param Value A pointer to the 32-bit value for the compare exchange
22 | operation.
23 | @param CompareValue 32-bit value used in compare operation.
24 | @param ExchangeValue 32-bit value used in exchange operation.
25 |
26 | @return The original *Value before exchange.
27 |
28 | **/
29 | UINT32
30 | EFIAPI
31 | InternalSyncCompareExchange32 (
32 | IN volatile UINT32 *Value,
33 | IN UINT32 CompareValue,
34 | IN UINT32 ExchangeValue
35 | )
36 | {
37 | _asm {
38 | mov ecx, Value
39 | mov eax, CompareValue
40 | mov edx, ExchangeValue
41 | lock cmpxchg [ecx], edx
42 | }
43 | }
44 |
45 |
--------------------------------------------------------------------------------
/HBFA/UefiInstrumentTestPkg/Library/SimpleSynchronizationLib/Ia32/InterlockedCompareExchange64.asm:
--------------------------------------------------------------------------------
1 | ;------------------------------------------------------------------------------
2 | ;
3 | ; Copyright (c) 2006, Intel Corporation. All rights reserved.
4 | ; SPDX-License-Identifier: BSD-2-Clause-Patent
5 | ;
6 | ; Module Name:
7 | ;
8 | ; InterlockedCompareExchange64.Asm
9 | ;
10 | ; Abstract:
11 | ;
12 | ; InterlockedCompareExchange64 function
13 | ;
14 | ; Notes:
15 | ;
16 | ;------------------------------------------------------------------------------
17 |
18 | .586P
19 | .model flat,C
20 | .code
21 |
22 | ;------------------------------------------------------------------------------
23 | ; UINT64
24 | ; EFIAPI
25 | ; InternalSyncCompareExchange64 (
26 | ; IN volatile UINT64 *Value,
27 | ; IN UINT64 CompareValue,
28 | ; IN UINT64 ExchangeValue
29 | ; );
30 | ;------------------------------------------------------------------------------
31 | InternalSyncCompareExchange64 PROC USES esi ebx
32 | mov esi, [esp + 12]
33 | mov eax, [esp + 16]
34 | mov edx, [esp + 20]
35 | mov ebx, [esp + 24]
36 | mov ecx, [esp + 28]
37 | lock cmpxchg8b qword ptr [esi]
38 | ret
39 | InternalSyncCompareExchange64 ENDP
40 |
41 | END
42 |
--------------------------------------------------------------------------------
/HBFA/UefiInstrumentTestPkg/Library/SimpleSynchronizationLib/Ia32/InterlockedDecrement.asm:
--------------------------------------------------------------------------------
1 | ;------------------------------------------------------------------------------
2 | ;
3 | ; Copyright (c) 2006, Intel Corporation. All rights reserved.
4 | ; SPDX-License-Identifier: BSD-2-Clause-Patent
5 | ;
6 | ; Module Name:
7 | ;
8 | ; InterlockedDecrement.Asm
9 | ;
10 | ; Abstract:
11 | ;
12 | ; InterlockedDecrement function
13 | ;
14 | ; Notes:
15 | ;
16 | ;------------------------------------------------------------------------------
17 |
18 | .386
19 | .model flat,C
20 | .code
21 |
22 | ;------------------------------------------------------------------------------
23 | ; UINT32
24 | ; EFIAPI
25 | ; InternalSyncDecrement (
26 | ; IN volatile UINT32 *Value
27 | ; );
28 | ;------------------------------------------------------------------------------
29 | InternalSyncDecrement PROC
30 | mov eax, [esp + 4]
31 | lock dec dword ptr [eax]
32 | mov eax, [eax]
33 | ret
34 | InternalSyncDecrement ENDP
35 |
36 | END
37 |
--------------------------------------------------------------------------------
/HBFA/UefiInstrumentTestPkg/Library/SimpleSynchronizationLib/Ia32/InterlockedDecrement.c:
--------------------------------------------------------------------------------
1 | /** @file
2 | InterlockedDecrement function
3 |
4 | Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.
5 | SPDX-License-Identifier: BSD-2-Clause-Patent
6 |
7 | **/
8 |
9 |
10 |
11 |
12 | /**
13 | Performs an atomic decrement of an 32-bit unsigned integer.
14 |
15 | Performs an atomic decrement of the 32-bit unsigned integer specified by
16 | Value and returns the decrement value. The decrement operation must be
17 | performed using MP safe mechanisms. The state of the return value is not
18 | guaranteed to be MP safe.
19 |
20 | @param Value A pointer to the 32-bit value to decrement.
21 |
22 | @return The decrement value.
23 |
24 | **/
25 | UINT32
26 | EFIAPI
27 | InternalSyncDecrement (
28 | IN volatile UINT32 *Value
29 | )
30 | {
31 | _asm {
32 | mov eax, Value
33 | lock dec dword ptr [eax]
34 | mov eax, [eax]
35 | }
36 | }
37 |
--------------------------------------------------------------------------------
/HBFA/UefiInstrumentTestPkg/Library/SimpleSynchronizationLib/Ia32/InterlockedIncrement.asm:
--------------------------------------------------------------------------------
1 | ;------------------------------------------------------------------------------
2 | ;
3 | ; Copyright (c) 2006, Intel Corporation. All rights reserved.
4 | ; SPDX-License-Identifier: BSD-2-Clause-Patent
5 | ;
6 | ; Module Name:
7 | ;
8 | ; InterlockedIncrement.Asm
9 | ;
10 | ; Abstract:
11 | ;
12 | ; InterlockedIncrement function
13 | ;
14 | ; Notes:
15 | ;
16 | ;------------------------------------------------------------------------------
17 |
18 | .386
19 | .model flat,C
20 | .code
21 |
22 | ;------------------------------------------------------------------------------
23 | ; UINT32
24 | ; EFIAPI
25 | ; InternalSyncIncrement (
26 | ; IN volatile UINT32 *Value
27 | ; );
28 | ;------------------------------------------------------------------------------
29 | InternalSyncIncrement PROC
30 | mov eax, [esp + 4]
31 | lock inc dword ptr [eax]
32 | mov eax, [eax]
33 | ret
34 | InternalSyncIncrement ENDP
35 |
36 | END
37 |
--------------------------------------------------------------------------------
/HBFA/UefiInstrumentTestPkg/Library/SimpleSynchronizationLib/Ia32/InterlockedIncrement.c:
--------------------------------------------------------------------------------
1 | /** @file
2 | InterLockedIncrement function
3 |
4 | Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.
5 | SPDX-License-Identifier: BSD-2-Clause-Patent
6 |
7 | **/
8 |
9 |
10 |
11 |
12 | /**
13 | Performs an atomic increment of an 32-bit unsigned integer.
14 |
15 | Performs an atomic increment of the 32-bit unsigned integer specified by
16 | Value and returns the incremented value. The increment operation must be
17 | performed using MP safe mechanisms. The state of the return value is not
18 | guaranteed to be MP safe.
19 |
20 | @param Value A pointer to the 32-bit value to increment.
21 |
22 | @return The incremented value.
23 |
24 | **/
25 | UINT32
26 | EFIAPI
27 | InternalSyncIncrement (
28 | IN volatile UINT32 *Value
29 | )
30 | {
31 | _asm {
32 | mov eax, Value
33 | lock inc dword ptr [eax]
34 | mov eax, [eax]
35 | }
36 | }
37 |
38 |
--------------------------------------------------------------------------------
/HBFA/UefiInstrumentTestPkg/Library/SimpleSynchronizationLib/X64/InterlockedCompareExchange32.asm:
--------------------------------------------------------------------------------
1 | ;------------------------------------------------------------------------------
2 | ;
3 | ; Copyright (c) 2006, Intel Corporation. All rights reserved.
4 | ; SPDX-License-Identifier: BSD-2-Clause-Patent
5 | ;
6 | ; Module Name:
7 | ;
8 | ; InterlockedCompareExchange32.Asm
9 | ;
10 | ; Abstract:
11 | ;
12 | ; InterlockedCompareExchange32 function
13 | ;
14 | ; Notes:
15 | ;
16 | ;------------------------------------------------------------------------------
17 |
18 | .code
19 |
20 | ;------------------------------------------------------------------------------
21 | ; UINT32
22 | ; EFIAPI
23 | ; InternalSyncCompareExchange32 (
24 | ; IN volatile UINT32 *Value,
25 | ; IN UINT32 CompareValue,
26 | ; IN UINT32 ExchangeValue
27 | ; );
28 | ;------------------------------------------------------------------------------
29 | InternalSyncCompareExchange32 PROC
30 | mov eax, edx
31 | lock cmpxchg [rcx], r8d
32 | ret
33 | InternalSyncCompareExchange32 ENDP
34 |
35 | END
36 |
--------------------------------------------------------------------------------
/HBFA/UefiInstrumentTestPkg/Library/SimpleSynchronizationLib/X64/InterlockedCompareExchange64.asm:
--------------------------------------------------------------------------------
1 | ;------------------------------------------------------------------------------
2 | ;
3 | ; Copyright (c) 2006, Intel Corporation. All rights reserved.
4 | ; SPDX-License-Identifier: BSD-2-Clause-Patent
5 | ;
6 | ; Module Name:
7 | ;
8 | ; InterlockedCompareExchange64.Asm
9 | ;
10 | ; Abstract:
11 | ;
12 | ; InterlockedCompareExchange64 function
13 | ;
14 | ; Notes:
15 | ;
16 | ;------------------------------------------------------------------------------
17 |
18 | .code
19 |
20 | ;------------------------------------------------------------------------------
21 | ; UINT64
22 | ; EFIAPI
23 | ; InternalSyncCompareExchange64 (
24 | ; IN volatile UINT64 *Value,
25 | ; IN UINT64 CompareValue,
26 | ; IN UINT64 ExchangeValue
27 | ; );
28 | ;------------------------------------------------------------------------------
29 | InternalSyncCompareExchange64 PROC
30 | mov rax, rdx
31 | lock cmpxchg [rcx], r8
32 | ret
33 | InternalSyncCompareExchange64 ENDP
34 |
35 | END
36 |
--------------------------------------------------------------------------------
/HBFA/UefiInstrumentTestPkg/Library/SimpleSynchronizationLib/X64/InterlockedDecrement.asm:
--------------------------------------------------------------------------------
1 | ;------------------------------------------------------------------------------
2 | ;
3 | ; Copyright (c) 2006, Intel Corporation. All rights reserved.
4 | ; SPDX-License-Identifier: BSD-2-Clause-Patent
5 | ;
6 | ; Module Name:
7 | ;
8 | ; InterlockedDecrement.Asm
9 | ;
10 | ; Abstract:
11 | ;
12 | ; InterlockedDecrement function
13 | ;
14 | ; Notes:
15 | ;
16 | ;------------------------------------------------------------------------------
17 |
18 | .code
19 |
20 | ;------------------------------------------------------------------------------
21 | ; UINT32
22 | ; EFIAPI
23 | ; InternalSyncDecrement (
24 | ; IN volatile UINT32 *Value
25 | ; );
26 | ;------------------------------------------------------------------------------
27 | InternalSyncDecrement PROC
28 | lock dec dword ptr [rcx]
29 | mov eax, [rcx]
30 | ret
31 | InternalSyncDecrement ENDP
32 |
33 | END
34 |
--------------------------------------------------------------------------------
/HBFA/UefiInstrumentTestPkg/Library/SimpleSynchronizationLib/X64/InterlockedDecrement.c:
--------------------------------------------------------------------------------
1 | /** @file
2 | InterlockedDecrement function
3 |
4 | Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.
5 | SPDX-License-Identifier: BSD-2-Clause-Patent
6 |
7 | **/
8 |
9 | /**
10 | Microsoft Visual Studio 7.1 Function Prototypes for I/O Intrinsics.
11 | **/
12 |
13 | long _InterlockedDecrement(
14 | long * lpAddend
15 | );
16 |
17 | #pragma intrinsic(_InterlockedDecrement)
18 |
19 | /**
20 | Performs an atomic decrement of an 32-bit unsigned integer.
21 |
22 | Performs an atomic decrement of the 32-bit unsigned integer specified by
23 | Value and returns the decrement value. The decrement operation must be
24 | performed using MP safe mechanisms. The state of the return value is not
25 | guaranteed to be MP safe.
26 |
27 | @param Value A pointer to the 32-bit value to decrement.
28 |
29 | @return The decrement value.
30 |
31 | **/
32 | UINT32
33 | EFIAPI
34 | InternalSyncDecrement (
35 | IN volatile UINT32 *Value
36 | )
37 | {
38 | return _InterlockedDecrement ((long *)(UINTN)(Value));
39 | }
40 |
41 |
--------------------------------------------------------------------------------
/HBFA/UefiInstrumentTestPkg/Library/SimpleSynchronizationLib/X64/InterlockedIncrement.asm:
--------------------------------------------------------------------------------
1 | ;------------------------------------------------------------------------------
2 | ;
3 | ; Copyright (c) 2006, Intel Corporation. All rights reserved.
4 | ; SPDX-License-Identifier: BSD-2-Clause-Patent
5 | ;
6 | ; Module Name:
7 | ;
8 | ; InterlockedIncrement.Asm
9 | ;
10 | ; Abstract:
11 | ;
12 | ; InterlockedIncrement function
13 | ;
14 | ; Notes:
15 | ;
16 | ;------------------------------------------------------------------------------
17 |
18 | .code
19 |
20 | ;------------------------------------------------------------------------------
21 | ; UINT32
22 | ; EFIAPI
23 | ; InternalSyncIncrement (
24 | ; IN volatile UINT32 *Value
25 | ; );
26 | ;------------------------------------------------------------------------------
27 | InternalSyncIncrement PROC
28 | lock inc dword ptr [rcx]
29 | mov eax, [rcx]
30 | ret
31 | InternalSyncIncrement ENDP
32 |
33 | END
34 |
--------------------------------------------------------------------------------
/HBFA/UefiInstrumentTestPkg/Library/SimpleSynchronizationLib/X64/InterlockedIncrement.c:
--------------------------------------------------------------------------------
1 | /** @file
2 | InterLockedIncrement function
3 |
4 | Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.
5 | SPDX-License-Identifier: BSD-2-Clause-Patent
6 |
7 | **/
8 |
9 | /**
10 | Microsoft Visual Studio 7.1 Function Prototypes for I/O Intrinsics.
11 | **/
12 |
13 | long _InterlockedIncrement(
14 | long * lpAddend
15 | );
16 |
17 | #pragma intrinsic(_InterlockedIncrement)
18 |
19 | /**
20 | Performs an atomic increment of an 32-bit unsigned integer.
21 |
22 | Performs an atomic increment of the 32-bit unsigned integer specified by
23 | Value and returns the incremented value. The increment operation must be
24 | performed using MP safe mechanisms. The state of the return value is not
25 | guaranteed to be MP safe.
26 |
27 | @param Value A pointer to the 32-bit value to increment.
28 |
29 | @return The incremented value.
30 |
31 | **/
32 | UINT32
33 | EFIAPI
34 | InternalSyncIncrement (
35 | IN volatile UINT32 *Value
36 | )
37 | {
38 | return _InterlockedIncrement ((long *)(UINTN)(Value));
39 | }
40 |
41 |
--------------------------------------------------------------------------------
/HBFA/UefiInstrumentTestPkg/UefiInstrumentTestPkg.dec:
--------------------------------------------------------------------------------
1 | ## @file
2 | #
3 | # Copyright (c) 2018, Intel Corporation. All rights reserved.
4 | #
5 | # SPDX-License-Identifier: BSD-2-Clause-Patent
6 | #
7 | ##
8 |
9 | [Defines]
10 | DEC_SPECIFICATION = 0x00010005
11 | PACKAGE_NAME = UefiInstrumentTestPkg
12 | PACKAGE_GUID = DA14F9B4-A294-4171-91AC-C81E39D7153B
13 | PACKAGE_VERSION = 0.11
14 |
15 | [Includes]
16 | Include
--------------------------------------------------------------------------------
/HBFA/__init__.py:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/intel/HBFA-FL/a803974fd721e973781e4ec144b894843f7ef567/HBFA/__init__.py
--------------------------------------------------------------------------------
/HBFA/tests/__init__.py:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/intel/HBFA-FL/a803974fd721e973781e4ec144b894843f7ef567/HBFA/tests/__init__.py
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Host-based Firmware Analyzer - Fuzzing Lite (HBFA-FL)
2 |
3 | The the Host-based Firmware Analysis - Fuzzing Lite (HBFA-FL) is based off of forking the original HBFA from the [edk2-staging repository](https://github.com/tianocore/edk2-staging/tree/HBFA). The original release of HBFA is described in the white-paper: ["Using Host-based Firmware Analysis to Improve Platform Resiliency"](https://www.intel.com/content/dam/develop/external/us/en/documents/intel-usinghbfatoimproveplatformresiliency-820238.pdf). The original release authors were Brian Richardson, Chris Wu, Jiewen Yao, and Vincent J. Zimmer.
4 |
5 | The goal for HBFA-FL is to update the original codebase, enhancing some features and removing/streamlining some others, with a focus on functionality for Linux environments. To that end, HBFA-FL removes much of the original HBFA code base, including support for Windows and unit-testing; we retain support for fuzzing with AFL and LibFuzzer. This repository is effectively a fork from the original version of HBFA at this commit : [ead8f4f8eefdb2eb762184e1a5809c43d6908952](https://github.com/tianocore/edk2-staging/commit/ead8f4f8eefdb2eb762184e1a5809c43d6908952)
6 |
7 | ## Getting Started
8 |
9 | To get started using HBFA-FL, we recommend taking a look at the documentation, starting [here](./docs/src/SUMMARY.md).
10 |
--------------------------------------------------------------------------------
/SECURITY.md:
--------------------------------------------------------------------------------
1 | # Security Policy
2 | Intel is committed to rapidly addressing security vulnerabilities affecting our customers and providing clear guidance on the solution, impact, severity and mitigation.
3 |
4 | ## Reporting a Vulnerability
5 | Please report any security vulnerabilities in this project utilizing the guidelines [here](https://www.intel.com/content/www/us/en/security-center/vulnerability-handling-guidelines.html).
6 |
--------------------------------------------------------------------------------
/docs/.gitignore:
--------------------------------------------------------------------------------
1 | book
--------------------------------------------------------------------------------
/docs/book.toml:
--------------------------------------------------------------------------------
1 | [book]
2 | authors = ["el-tipton"]
3 | language = "en"
4 | multilingual = false
5 | src = "src"
6 | title = "HBFA-FL: Host-Based Firmware Analyzer - Fuzzing Lite"
--------------------------------------------------------------------------------
/docs/images/Step3_Select_Boot_Manager.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/intel/HBFA-FL/a803974fd721e973781e4ec144b894843f7ef567/docs/images/Step3_Select_Boot_Manager.png
--------------------------------------------------------------------------------
/docs/images/Step4_Select_EFI_Shell.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/intel/HBFA-FL/a803974fd721e973781e4ec144b894843f7ef567/docs/images/Step4_Select_EFI_Shell.png
--------------------------------------------------------------------------------
/docs/images/Step5_EFI_Shell_Press_Escape.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/intel/HBFA-FL/a803974fd721e973781e4ec144b894843f7ef567/docs/images/Step5_EFI_Shell_Press_Escape.png
--------------------------------------------------------------------------------
/docs/images/Ubuntu_boot_select_firmware_settings.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/intel/HBFA-FL/a803974fd721e973781e4ec144b894843f7ef567/docs/images/Ubuntu_boot_select_firmware_settings.png
--------------------------------------------------------------------------------
/docs/images/hbfa_covreport.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/intel/HBFA-FL/a803974fd721e973781e4ec144b894843f7ef567/docs/images/hbfa_covreport.png
--------------------------------------------------------------------------------
/docs/images/hbfa_covreport2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/intel/HBFA-FL/a803974fd721e973781e4ec144b894843f7ef567/docs/images/hbfa_covreport2.png
--------------------------------------------------------------------------------
/docs/images/hbfa_crash_AAA.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/intel/HBFA-FL/a803974fd721e973781e4ec144b894843f7ef567/docs/images/hbfa_crash_AAA.png
--------------------------------------------------------------------------------
/docs/images/hbfa_crashes.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/intel/HBFA-FL/a803974fd721e973781e4ec144b894843f7ef567/docs/images/hbfa_crashes.png
--------------------------------------------------------------------------------
/docs/images/hbfa_hangs.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/intel/HBFA-FL/a803974fd721e973781e4ec144b894843f7ef567/docs/images/hbfa_hangs.png
--------------------------------------------------------------------------------
/docs/images/hbfa_helloworld_AAAAs.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/intel/HBFA-FL/a803974fd721e973781e4ec144b894843f7ef567/docs/images/hbfa_helloworld_AAAAs.png
--------------------------------------------------------------------------------
/docs/images/hbfa_helloworld_debug_Acrash1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/intel/HBFA-FL/a803974fd721e973781e4ec144b894843f7ef567/docs/images/hbfa_helloworld_debug_Acrash1.png
--------------------------------------------------------------------------------
/docs/images/hbfa_helloworld_debug_Acrash2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/intel/HBFA-FL/a803974fd721e973781e4ec144b894843f7ef567/docs/images/hbfa_helloworld_debug_Acrash2.png
--------------------------------------------------------------------------------
/docs/images/hbfa_helloworld_debug_Acrash3.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/intel/HBFA-FL/a803974fd721e973781e4ec144b894843f7ef567/docs/images/hbfa_helloworld_debug_Acrash3.png
--------------------------------------------------------------------------------
/docs/images/hbfa_helloworld_extended.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/intel/HBFA-FL/a803974fd721e973781e4ec144b894843f7ef567/docs/images/hbfa_helloworld_extended.png
--------------------------------------------------------------------------------
/docs/images/hbfa_helloworld_list.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/intel/HBFA-FL/a803974fd721e973781e4ec144b894843f7ef567/docs/images/hbfa_helloworld_list.png
--------------------------------------------------------------------------------
/docs/images/hbfa_helloworld_list2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/intel/HBFA-FL/a803974fd721e973781e4ec144b894843f7ef567/docs/images/hbfa_helloworld_list2.png
--------------------------------------------------------------------------------
/docs/images/hbfa_helloworld_reprocrash.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/intel/HBFA-FL/a803974fd721e973781e4ec144b894843f7ef567/docs/images/hbfa_helloworld_reprocrash.png
--------------------------------------------------------------------------------
/docs/images/hbfa_shell_helloworld.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/intel/HBFA-FL/a803974fd721e973781e4ec144b894843f7ef567/docs/images/hbfa_shell_helloworld.png
--------------------------------------------------------------------------------
/docs/images/hbfa_shell_ls.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/intel/HBFA-FL/a803974fd721e973781e4ec144b894843f7ef567/docs/images/hbfa_shell_ls.png
--------------------------------------------------------------------------------
/docs/images/hbfa_shell_map.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/intel/HBFA-FL/a803974fd721e973781e4ec144b894843f7ef567/docs/images/hbfa_shell_map.png
--------------------------------------------------------------------------------
/docs/images/hbfa_source_UefiHostTestPkg.dsc.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/intel/HBFA-FL/a803974fd721e973781e4ec144b894843f7ef567/docs/images/hbfa_source_UefiHostTestPkg.dsc.png
--------------------------------------------------------------------------------
/docs/images/hbfa_source_helloworld.c.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/intel/HBFA-FL/a803974fd721e973781e4ec144b894843f7ef567/docs/images/hbfa_source_helloworld.c.png
--------------------------------------------------------------------------------
/docs/images/hbfa_source_testhelloworld.c.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/intel/HBFA-FL/a803974fd721e973781e4ec144b894843f7ef567/docs/images/hbfa_source_testhelloworld.c.png
--------------------------------------------------------------------------------
/docs/images/hbfa_summary.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/intel/HBFA-FL/a803974fd721e973781e4ec144b894843f7ef567/docs/images/hbfa_summary.png
--------------------------------------------------------------------------------
/docs/src/SUMMARY.md:
--------------------------------------------------------------------------------
1 | # Summary
2 |
3 | [Introduction](README.md)
4 |
5 | ## User Guide
6 |
7 | - [Setting Up](setup/README.md)
8 | - [For Linux](setup/linux.md)
9 | - [Getting started with fuzzing in HBFA-FL](fuzzing/README.md)
10 | - [Where to create and save a fuzzing test case harness](harness/wheretoharness.md)
11 | - [Creating and Compiling New Test Cases](fuzzing/building.md)
12 | - [Fuzzing test harnesses included with HBFA-FL](harness/includedfuzzharnesses.md)
13 | - [Fuzzing with AFL: RunAFL.py](fuzzing/fuzzingwithAFL.md)
14 | - [Fuzzing with LibFuzzer: RunLibFuzzer.py](fuzzing/fuzzingwithLibFuzzer.md)
15 | - [Generating fuzzing summary and coverage data reports](./generatingCoverageReports.md)
16 | - [Tutorials](tutorials/README.md)
17 | - [HBFA-FL: Writing a fuzzing harness](tutorials/writingafuzzingharness.md)
18 |
19 | ## Archived Documentation
20 |
21 | - [Original HBFA Documentation](archive/originalHBFA/README.md)
--------------------------------------------------------------------------------
/docs/src/archive/originalHBFA/Doc/User Guide - How-to-Add-New-Case.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/intel/HBFA-FL/a803974fd721e973781e4ec144b894843f7ef567/docs/src/archive/originalHBFA/Doc/User Guide - How-to-Add-New-Case.pdf
--------------------------------------------------------------------------------
/docs/src/archive/originalHBFA/Doc/User Guide - How-to-Run-Test-Case.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/intel/HBFA-FL/a803974fd721e973781e4ec144b894843f7ef567/docs/src/archive/originalHBFA/Doc/User Guide - How-to-Run-Test-Case.pdf
--------------------------------------------------------------------------------
/docs/src/archive/originalHBFA/README.md:
--------------------------------------------------------------------------------
1 | # Archive for documentation
2 |
3 | Several documents related to HBFA are referenced externally or archived locally in this repository in this folder. A Table of these documents is included in the following.
4 |
5 | | Document | Reference link |
6 | | -------- | -------------- |
7 | | The original HBFA release in the whitepaper | [Link](https://www.intel.com/content/dam/develop/external/us/en/documents/intel-usinghbfatoimproveplatformresiliency-820238.pdf) |
8 | | The original HBFA 'User Guide - How-to-Add-New-Case.pdf' | [Link](./Doc/User%20Guide%20-%20How-to-Add-New-Case.pdf) |
9 |
10 |
11 | Return to [Summary](../../SUMMARY.md)
--------------------------------------------------------------------------------
/docs/src/fuzzing/README.md:
--------------------------------------------------------------------------------
1 | # Getting started with fuzzing in HBFA-FL
2 |
3 | Fuzzing with AFL and LibFuzzer are supported in HBFA-FL. For a given test-harness, the source can be compiled and fuzzed with either AFL or LibFuzzer. To do this, you may directly invoke the build process from EDK-II or you may leverage the included 'RunAFL.py' and 'RunLibFuzzer.py' scripts (recommended). Additionally, several fuzzing test-harnesses are included with HBFA-FL and can be helpful for fuzzing, or as a good reference for developing other fuzzing harnesses.
4 |
5 | - For information on creating and building test cases, see these sections: [Where to create and save a fuzzing test case harness](../harness/wheretoharness.md) and [Creating and Compiling New Test Cases](./building.md)
6 | - For a full-tutorial on creating fuzzing harnesses for HBFA-FL, see the tutorial [HBFA-FL: Writing a fuzzing harness](../tutorials/writingafuzzingharness.md)
7 | - For more information on the fuzzing test-harnesses included with HBFA-FL, see this [section](../harness/includedfuzzharnesses.md)
8 | - To get started fuzzing with AFL, see [Fuzzing with AFL](fuzzingwithAFL.md)
9 | - To get started fuzzing with LibFuzzer, see [Fuzzing with LibFuzzer](./fuzzingwithLibFuzzer.md)
10 | - To learn more on how to generate Fuzzing Report and Coverage data for your fuzzing, see [Generating fuzzing summary and coverage data reports](./generatingCoverageReports.md)
11 |
12 | [<<](../setup/linux.md) Back | Return to [Summary](../SUMMARY.md) | Next [>>](./building.md)
--------------------------------------------------------------------------------
/docs/src/harness/README.md:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/intel/HBFA-FL/a803974fd721e973781e4ec144b894843f7ef567/docs/src/harness/README.md
--------------------------------------------------------------------------------
/docs/src/harness/wheretoharness.md:
--------------------------------------------------------------------------------
1 | # Where to create and save a fuzzing test case harness
2 |
3 | It is recommended to create fuzzing test harness cases in the file structure provided in HBFA-FL. At a minimum, the folder used for the fuzzing test cases should be located in a sub-directory under the 'HBFA' directory for use with the RunAFL.py and RunLibFuzzer.py script. For a fuzzing test harness, a minimal test case folder would consist of the test harness C-source code file (containing the fuzzing harness logic) and a module description file (the .inf file). The 'HBFA' folder shown in the file structure (tree) relative to the HBFA-FL repository root directory.
4 |
5 | ```
6 | ├── HBFA
7 | ├── UefiHostFuzzTestCasePkb
8 | ├── TestCase
9 | ├── ... # The directories here somewhat follow the
10 | DeviceSecurityPkg # analogous directories from the EDK2 root
11 | FatPkg # file structure (e.g. see MdeModulePkg)
12 | MdeModulePkg
13 | OvmfPkg
14 | SecurityPkg
15 | ...
16 | └── TestModuleFolder # This is the folder containing the new test case
17 | └── TestXYZ.c # Test harness/logic goes in this C-source code file
18 | └── TestXYZ.inf # The INF, module description file
19 |
20 | ```
21 |
22 | [<<](../fuzzing/README.md) Back | Return to [Summary](../SUMMARY.md) | Next [>>](../fuzzing/building.md)
--------------------------------------------------------------------------------
/docs/src/setup/README.md:
--------------------------------------------------------------------------------
1 | # Setting up an environment for HBFA-FL
2 |
3 | In order to leverage HBFA-FL, several additional software packages and tools are needed. Further, setting up a few environment variables is necessary, so that HBFA-FL can source necessary build environment parameters, EDK II source code, and invoke the various tools and fuzzing frameworks.
4 |
5 | [<<](../README.md) Back | Return to [Summary](../SUMMARY.md) | Next [>>](./linux.md)
--------------------------------------------------------------------------------
/docs/src/tutorials/README.md:
--------------------------------------------------------------------------------
1 | # Tutorials
2 |
3 | Available tutorials:
4 |
5 | [HBFA-FL: Writing a fuzzing harness](./writingafuzzingharness.md)
6 |
7 | Return to [Summary](../SUMMARY.md)
--------------------------------------------------------------------------------
/oss-fuzz/TestBmpSupportLib.options:
--------------------------------------------------------------------------------
1 | [libfuzzer]
2 | rss_limit_mb=6000
3 |
--------------------------------------------------------------------------------
/requirements.txt:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/intel/HBFA-FL/a803974fd721e973781e4ec144b894843f7ef567/requirements.txt
--------------------------------------------------------------------------------