IA32 build from VS2019 toolchain has security violation
because Digest value from SHA512_384 is not matching the
value calculated and stored in hashstore during build.
Aligning the stack to 32-byte boundary during SHA_Update
fixes this error.
Signed-off-by: Talamudupula <stalamudupula@gmail.com>
Resolve link error when using UsbInitLib
UsbInitLib invokes UsbDeInitBot() which is defined in UsbBlockIoLib
Signed-off-by: Vincent Chen <vincent.chen@intel.com>
This patch allows to use a mailbox register (DWORD) to support debug
port. If CCA debug is connected, it is possible to access certain
SOC register through BSSB. Then this register can be used for debug
console input/output.
Signed-off-by: Maurice Ma <maurice.ma@intel.com>
This patch adds DebugPortLib as a platform extention lib to add new
debug port support. It also adds a generic GpioDebugPortLib to allow
GPIO bit bang to emulate UART TX pin.
Signed-off-by: Maurice Ma <maurice.ma@intel.com>
This allows to load and execute ELF32 or ELF64 format payloads
regardless of Ia32 or X64 SBL operation modes.
Signed-off-by: Aiden Park <aiden.park@intel.com>
This patch runs basic check during EXT FS initialization
by opening root directory to ensure superblock been
validated.
Signed-off-by: Stanley Chang <stanley.chang@intel.com>
This patch changes the return code of SearchDirectory
to EFI_NOT_FOUND when a file to search cannot be found
Signed-off-by: Stanley Chang <stanley.chang@intel.com>
When the bus master decoding was disabled by default in PCI bus, the
device driver should try to enable it on its own. However, eMMC
driver does not have the enabling code. It caused the eMMC access
failure.
It fixed#1153.
Signed-off-by: Maurice Ma <maurice.ma@intel.com>
In the Ext23Lib support for symbolic links was recently enabled
but there was a limitation imposed to use the CFG data boot
option filepath limit of 16 bytes which does not need to be also
be imposed on symbolic link paths. This will allow symbolic link
paths to be up to 260 characters long.
Signed-off-by: James Gutbub <james.gutbub@intel.com>
With recent code change of disabling all PCI bus master
by default, NVMe may not work in some platform (e.g., Qemu).
This patch set/clear bus master during NVMe init/deinit.
Signed-off-by: Stanley Chang <stanley.chang@intel.com>
Some of the boot option file paths used when
booting with OS Loader payload are failing
because the Ext23Lib does not support symbolic
soft links (e.g. ln -s <file> <link>). This
patch adds support for loading the soft link
succesfully.
Signed-off-by: James Gutbub <james.gutbub@intel.com>
On some build environment, NASM will fail to compile Thrun32To64.nasm.
It is because of "BITS 64" usage in WIN32. This patch removed the BITS
64 usage and used opcode prefix instead to resolve this issue.
Signed-off-by: Maurice Ma <maurice.ma@intel.com>
This patch added thunk support from 32bit to 64bit. It allows SBL
to call 64bit API entry from 32 bit compatible mode. It is useful
when the payload mode is different from SBL mode.
Signed-off-by: Maurice Ma <maurice.ma@intel.com>
This patch will enable CLANG toolchain build on Linux and Windows.
Currently CLANG toolchain build still needs Visual Studio to provide
nmake utility in Windows.
To build with CLANG, please add build option "-t clang". It assume
CLANG is installed at default path. It has been tested with SBL
QEMU x86 build.
Signed-off-by: Maurice Ma <maurice.ma@intel.com>
Current MTRR lib assumes the MTRR number is always 10. Instead,
this patch follows the IA manual to get the actual MTRR number
through MTRR capability register.
Signed-off-by: Maurice Ma <maurice.ma@intel.com>
This patch fixes the multiple build issues which are observed
when ENABLE_SOURCE_DEBUG config is set to 1.
Signed-off-by: Praveen Hp <praveen.hodagatta.pranesh@intel.com>
It was reported that some platform had MP waking up issue after
switching to using X2APIC library. By comparing the library, found
X2APIC removed 2nd IPI sending in the flow. This 2nd IPI is
required per IA specification. The patch added it back.
Tests have been done and confirmed it fixed the issues seen on
thos platforms.
Signed-off-by: Maurice Ma <maurice.ma@intel.com>
This patch added X2APIC support. It is to enable the case when
APIC ID is greater than 255. This patch only handle core wakeup
portion. Platform still needs to handle ACPI related changes for
X2APIC.
X2APIC lib is backward compatible with XAPIC lib. So there is no
need to use XAPIC lib anymore.
Signed-off-by: Maurice Ma <maurice.ma@intel.com>
This will fix invalid PDP/PDE generation with PAE 2MB Pages,
and high bit calculation at PayloadEntry additionally.
Signed-off-by: Aiden Park <aiden.park@intel.com>
In 32 bit SBL, when PCI PMEM64 exists, the OsLoader will hang
during boot in CreateIdentityMappingPageTables(). The function
is inteneded to be used in X64 mode only, and cannot handle
32bit well. So OsLoader should not call it for 32 bit build.
This patch also zeroed the allcated memory to ensure the unused
entries are all 0.
Signed-off-by: Maurice Ma <maurice.ma@intel.com>
Current Execute32BitCode() passes in 64bit arguments into stack.
It should use 32bit arguments instead according to 32bit calling
convention. This patch fixed this issue.
Signed-off-by: Maurice Ma <maurice.ma@intel.com>
SBL support to load PreOS and normal OS in a single boot option.
This patch tries to standardize the PreOS support.
The PreOS could be TrustyOS, PreOsChecker or others.
As long as PreOS flag is set in boot option, SBL will load and
boot PreOS before normal OS. If the preOS has specific requirement,
it could be addressed using PreOS image type.
Signed-off-by: Guo Dong <guo.dong@intel.com>
BGRT can be used by bootloader to pass logo to OS. But BGRT can
only support 24bit or 32bit BMP format. If the bootloader uses
other bit format or indexed color format, the image has to be
converted before passing it to BGRT. This patch added support
to convert other BMP image format into 32bit format required by
BGRT.
This has been tested with Windows on Leafhill board. The SBL
logo was dispalyed properly while booting Windows.
Signed-off-by: Maurice Ma <maurice.ma@intel.com>
As per TCG spec, if a Tpm2Startup(TPM_SU_STATE) fails during
S3 resume, a host reset should be done.
When BootGuard is enabled, ACM will notify of this failure via Bit46 in
BootGuardBootStatus register.
Signed-off-by: Sachin Agrawal <sachin.agrawal@intel.com>
Since the EXT library we have in OS Loader
supports 2, 3, and 4 it will help to reduce
confusion for users who have noticed that
only 2 and 3 are currently printed.
Signed-off-by: James Gutbub <james.gutbub@intel.com>
This patch enabled ACPI BGRT support. It is used to pass splash
display information from bootloader to payload and OS.
Signed-off-by: Maurice Ma <maurice.ma@intel.com>
For UEFI Linux boot, a new parameter was added into BOOT_PARAMS.
This patch added this parameter support so that ACPI base can
be passed directly to kernel.
Signed-off-by: Maurice Ma <maurice.ma@intel.com>
Since SBL could be built into either x86 or x64 mode, and the payload
can also be x86 or x64 mode. When mixed modes are used, it is required
to switch to proper mode first before calling into payload entrypoint.
This patch added this check to switch to required mode before calling
into payload entry point.
Signed-off-by: Maurice Ma <maurice.ma@intel.com>
During X64 enabling, there was a pending task to enable 32bit
MultiBoot support. It is not implemented. This patch added the
support to allow X64 SBL to boot a 32bit MB image through thunking.
As part of this patch, the ThunkLib is separated from the FspApiLib
so that it can be shared by other component.
Signed-off-by: Maurice Ma <maurice.ma@intel.com>
Currently SBL library has GetDeviceAddr() to get the device
address based on device type and instance. This patch adds
SetDeviceAddr() to update a given device type and address so
that platform could update the device table dynamically.
Signed-off-by: Guo Dong <guo.dong@intel.com>
This patch fixed GCC x64 Crypto boot issue. The issue was related
to the calling convention. "EFIAPI" was missing for several ASM
provided functions.
It also fixed#834.
Signed-off-by: Maurice Ma <maurice.ma@intel.com>
This patch added SBL python setup script. It can run on either host
or target MicroPython environment. A new PCD PcdEnableSetup is added
to control if Setup feature should be supported by core.
Signed-off-by: Maurice Ma <maurice.ma@intel.com>
A device in boot options can have a BAR greater than 4GB depending on PCI
64Mem/PMem resource policy.
This will allow Payload to build a paging table to cover high MMIO area.
Signed-off-by: Aiden Park <aiden.park@intel.com>
The boot command currently does not allow you
to enter the BootFlags value which is needed
for some boot images.
Also fix a small issue in the FsType selection
code block.
Signed-off-by: James Gutbub <james.gutbub@intel.com>
This patch added new DrawFrameBuffer interface. It will draw the
framebuffer from a VGA like text buffer. Payload can use this
to sync its own text buffer onto framebuffer screen. It aslo added
extend ASCII char support so that some table char can be displayed.
Signed-off-by: Maurice Ma <maurice.ma@intel.com>
This patch added new function to build a full set of the CFGDATA set
from the memory for current platform. It is useful for exporting
current platform CFGDATA for further processing.
Signed-off-by: Maurice Ma <maurice.ma@intel.com>