Update device path parser to detect device path with Proxy URI
Implementation based on UEFI Specification v2.11 Section 24.7.3.1
Signed-off-by: Saloni Kasbekar <saloni.kasbekar@intel.com>
Update library to handle HTTP Boot device paths with Proxy URI
Implementation based on UEFI Specification v2.11 Section 24.7.3.1
Signed-off-by: Saloni Kasbekar <saloni.kasbekar@intel.com>
Build boot option with HII provided ProxyUri by utilizing URI
validation path in HII callback for ProxyUri.
Implementation based on UEFI Specification v2.11 Section 24.7.3.1 to
use device path with ProxyURI included
Signed-off-by: Saloni Kasbekar <saloni.kasbekar@intel.com>
1. In EfiHttpRequest():
a) Decision to use HTTPS in HTTP CONNECT is based on Proxy URL.
b) Support PUT/POST with no headers when connected to proxy.
2. In HttpConnectTcp4/6():
a) Add new argument to provide new TLS session establishment indication
(TlsConfigure).
a) Create HTTP connection only when not connected to proxy.
b) Do not create new HTTP connection when client is connected to proxy.
3. In HttpInitSession(), pass TlsConfigure to HttpConnectTcp4 calls.
4. In TlsConfigureSession(), when connected to proxy, use recorded
endpoint's host name for TLS VerifyHost.
Implementation based on UEFI Specification v2.11 section 24.7.10 to
use HTTP CONNECT method to connect to Proxy Server and use it to
forward the HEAD/GET request to Endpoint Server's BootURI.
Signed-off-by: Saloni Kasbekar <saloni.kasbekar@intel.com>
1. Store information in HttpInstance.
a) Proxy URL from last HTTP CONNECT request (ProxyUrl) and its length
(ProxyUrlLen).
b) State of connection to proxy server (ProxyConnected) - TRUE after
HTTP CONNECT success.
c) Host name extracted from endpoint URL (EndPointHostName).
2. Modified EfiHttpRequest() flow to handle HTTP CONNECT request.
a) Treating request's URL as "endpoint URL". In case of HTTP CONNECT
request, directing it to Proxy URL with Host set to "endpoint URL".
3. Added PrintLib instance to cover AsciiSPrint() call.
Implementation based on UEFI Specification v2.11
- Section 24.7.10 to use HTTP CONNECT method to connect to Proxy
Server and use it to forward the HEAD/GET request to Endpoint
Server's BootURI.
- Section 29.6.6 to use EFI_HTTP_CONNECT_REQUEST_DATA structure
for HttpMethodConnect usage in EFI_HTTP_PROTOCOL.Request()
Signed-off-by: Saloni Kasbekar <saloni.kasbekar@intel.com>
edk2's PRM Data Buffer Signature is 'PRMD', however
PRM spec 1.0 section 4.2.1 Static Data Buffer indicates
that the signature should be 'PRMS'.
This commit aligns edk2's signature definition with the spec.
Signed-off-by: Oliver Smith-Denny <osde@microsoft.com>
This is regarding PRM modules that are describing MMIO ranges.
When PrmConfigDxe is calling GetMemorySpaceDescriptor() with
a memory range that is visible to the boot processor but has
not been added to the memory map GetMemorySpaceDescriptor()
will return EFI_SUCCESS and then return a memory descriptor
indicating that the region is non-existent. This causes
SetRuntimeMemoryRangeAttributes() to believe that the region
has already been added to the memory map and will eventually
cause an ASSERT.
This PR allows for SetRuntimeMemoryRangeAttributes() to treat
a non-existent MMIO range the same as a range that triggered
a EFI_NOT_FOUND error response from GetMemorySpaceDescriptor().
Signed-off-by: Oliver Smith-Denny <osde@microsoft.com>
In some failure legs of BuildMadtTable (), we could end up in
FreeMadtTableResources () with (*Table == NULL). That's a valid error
state and should be tolerated by FreeMadtTableResources () instead of
ASSERTing.
Signed-off-by: Jake Garver <jake@nvidia.com>
Reviewed-by: Jeff Brasen <jbrasen@nvidia.com>
Reviewed-by: Jeshua Smith <jeshuas@nvidia.com>
The CREATE_CM_OBJECT_ID() and CREATE_TABLE_GEN_ID() macros shift an enum
by 31 bits. As enums are signed integers, this generates a portability
finding from cppcheck. To resolve the finding, we'll cast the enum values
to the type expected as output from the macro.
Signed-off-by: Jake Garver <jake@nvidia.com>
Reviewed-by: Girish Mahadevan <gmahadevan@nvidia.com>
VS2019/VS2022 ARM/AARCH64 is not a widely used toolchain, for one
thing edk2 can't be built with it, it will break. Downstream
platforms rarely use it and if they do, they must have heavy edits
in order to support building edk2. In particular, edk2 does not
have support for the assembly files that this toolchain uses fully.
As a result, the corresponding StackCheckLib does not have the assembly
file needed to satisfy the definitions the compiler expects.
Unfortunately, the VS ARM/AARCH64 compiler has a different ABI than
the IA32/X64 VS toolchain for stack cookies, so this also needs more
investigation.
For now, disable stack cookie checking in VS ARM/AARCH64 as this does
not affect many platforms. However, it does allow for the use case
reported in the bug mentioning this, which is building a shell and
attempting to boot to it.
When VS ARM/AARCH64 support is revisited in edk2 (or if there is a
clean way to add stack cookie support without the full support), this
will be revisted.
Signed-off-by: Oliver Smith-Denny <osde@microsoft.com>
Add /wd4200 to all visual studio builds of C tools in BaseTools.
This disables warnings for use of flexible array members that
are allowed in edk2 include files. Some tools use include files
from MdePkg that use flexible array members.
This matches the warning disables used to build structured PCD in
BaseTools/Source/Python/Workspace/DscBuildData.py where flexible
array members are more widely used.
Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
Commit c6f47e6 removed BUILDRULEFAMILY for CLANGDWARF. Adding
CLANGDWARF back as a BUILDRULEFAMILY to match CLANGPDB.
Add CLANGDWARF specific build rules - based on GCC, and remove steps
not required for CLANGDWARF.
Remove following irrelevant steps and logs:
...
"objcopy not needed ..."
"--strip-unneded ..."
"--add-gnu-debuglink ..."
...
Signed-off-by: Vishal Oliyil Kunnil <quic_vishalo@quicinc.com>
PR #6408 introduced a regression by removing /WHOLEARCHIVE
from VS20xx DLINK_FLAGS when building host based unit tests.
PR #5098 added /WHOLEARCHIVE to resolve issues when building
host based unit tests with GoogleTest.
Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
As per IPMI spec, fru string can be maximum of 16 bytes length
and fru length field can take 5 bits (to hold values up to 16 -
10000b).
Current implementation allocates only 4 bits for Fru String Length
and this is causing an error when 16 bytes length fru string needs
to be copied as the first 4 bits in 0x10 is 0.
Fixed the structure IPMI_SDR_RECORD_DEV_ID_STR_TYPE_LENGTH, by
allocating 5 bits for Length field as per the spec instead of 4.
Signed-off-by: Thejaswani Putta <tputta@nvidia.com>
Create a new PlatformBuild.py that can be called by stuart_build.
UniversalPayloadBuild.py is consumed by new script to maintain backward
compatibility and eliminate duplicate build steps.
Supported builds:
1. UEFI package build: directly call BaseTools build for EFI bin
2. UPL ELF/FIT build: call UniversalPayloadBuild.py
3. (new) UPL ELF - stuart build: follow stuart build steps to call
PlatformBuild.py (edk2toolext is mandatory)
Signed-off-by: Gua Guo <gua.guo@intel.com>
Does not apply stale labels to code first issues and pull requests
since those need to stay open until spec changes are published and
that might be a long time.
Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com>
The EDK II Code First process is being revised to align with GitHub.
The actual process changes will be made to the process page on the
TianoCore wiki:
https://github.com/tianocore/tianocore.github.io/wiki/EDK-II-Code-First-Process
These changes:
- Remove the "code first" checkbox from existing forms.
- Add a "code first" issue form that is used to submit issues
tracking code first changes.
The primary template filled in for code first changes is included
with no change from the prior template.
Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com>
Update the CryptoPkg to support CLANGPDB and CLANGDWARF from
both Windows and Linux host environments.
* Add PcdOpensslLibAssemblySourceStyleNasm to select the correct
optimized assembly source style for OpensslLib for IA32/X64.
NASM style is for MSFT and CLANGPDB. GAS style is for GCC.
Use this PCD in OpensslLibAccel.inf and OpensslLibFullAccel.inf
to select between .nasm and .S files.
* Add intrinsic functions required by CLANG IA32/X64 builds.
* __ashlti3
* __lshrdi3
* Disable warning -Wno-error=unused-function for CLANG build
compatibility
* Set -D OPENSSL_NO_INLINE_ASM for CLANG build compatibility
* Update TestBaseCryptLib to split out the implementation of
main() into its own C file that is only use for host-based
unit tests. This is due to CLANGPDB for host environments
injecting a __main() call that can only be resolved in host
based builds that link against host libraries.
* Update Configure.py to update IA32/X64 [Sources] sections
with feature flag expressions using the new PCD
PcdOpensslLibAssemblySourceStyleNasm.
Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
Add new option "--add_cc_flag" to append CC compilation flags when build
Payload. With this option, user can append specified build options in
build script.
Usage example to add more CC flags:
python UefiPayloadPkg/UniversalPayloadBuild.py -t GCC5 -b DEBUG --Fit \
--add_cc_flag=-mno-sse --add_cc_flag=-mno-mmx
Signed-off-by: Ajan Zhong <ajan.zhong@newfw.com>
Add new macro HAND_OFF_FDT_ENABLE to control status of PcdHandOffFdtEnable.
With this macro enabled in build script, PcdHandOffFdtEnable can be enabled
without editing in souce code.
Default vale of HAND_OFF_FDT_ENABLE is FALSE.
Signed-off-by: Ajan Zhong <ajan.zhong@newfw.com>
EFI_USB_HC_PROTOCOL was never defined in a released UEFI specification,
so drop use of it in ShellPkg in preparation of deleting the definitions
based on something allegedly supported in confidential EFI 1.10.
Signed-off-by: Leif Lindholm <leif.lindholm@oss.qualcomm.com>
Protocol/UsbHostController.h described an ancient protocol never part of
a public specification ... and was in fact not needed. So drop the
reference.
Also drop some text from a function documentation header incorrectly
implying use of the UsbHcProtocol.
Signed-off-by: Leif Lindholm <leif.lindholm@oss.qualcomm.com>
EFI_USB_HC_PROTOCOL was never defined in a released UEFI specification,
so drop use of it in UsbBusDxe in preparation of deleting the definitions
based on something allegedly supported in confidential EFI 1.10.
Signed-off-by: Leif Lindholm <leif.lindholm@oss.qualcomm.com>
In the case that the total provided to the `_show_progress()`
function is zero, do not show a progress bar to prevent aborts
`ZeroDivisionError` when calculating the progress percentage.
Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com>
gUiAppFileGuid, which is used to register EFI Firmware Config as a boot
option, has the same value as UiApp guid.
This would trigger a duplicate guid error from the CI pipeline, but
because these two guids are necessary, this commit adds a duplicate
exception.
Signed-off-by: Luigi Leonardi <leonardi@redhat.com>
The existing code was full of abbreviated function/variable names.
Let's nip that in the bud before we add more code to this library.
Update the current only upstream user: ArmStandaloneMmCoreEntryPoint.
Signed-off-by: Leif Lindholm <leif.lindholm@oss.qualcomm.com>
OvmfFindLoadOption behaves like EfiBootManagerFindLoadOption, it searches for
an entry in the array: an entry is found if the two paths are equal.
This removes possible duplicates in the boot entries: two entries with
the same path and different attributes are not detected as equal by
EfiBootManagerFindLoadOption.
In this case, the old entry is deleted and replaced by the new one.
Signed-off-by: Luigi Leonardi <leonardi@redhat.com>
gUiAppFileGuid, which is used to register EFI Firmware Config as a boot option,
has the same value as UiApp guid.
This would trigger a duplicate guid error from the CI pipeline, but because these
two guids are necessary, this commit adds a duplicate exception.
Signed-off-by: Luigi Leonardi <leonardi@redhat.com>
Introduce gUiAppFileGuid: it has the same value of UiApp guid defined in
the .inf file. This is used to register UiApp as a boot entry in the
BootManagerMenu.
This registration is done in PlatformBootManagerBeforeConsole because
it must be done before the hotkeys are registered. This is because
in a system with hotkeys still bound to UiApp, but with firmware disabled,
you can still boot into the latter by hitting ESC or F2 during boot.
UiApp can be enabled/disabled using fw_cfg option FirmwareSetupSupport
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Luigi Leonardi <leonardi@redhat.com>
Setting the LOAD_OPTION_CATEGORY_APP flag for EFI Shell prevents the boot
loader from using it as a fallback if all other entries fail to boot.
With a boot manager menu available, it can be annoying to enter the EFI Shell
directly, because from the menu, the user can try to boot again (e.g.
temporary network problem) or enter the shell/firmware config only if
necessary.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Luigi Leonardi <leonardi@redhat.com>
This is part of the effort to enable/disable firmware configuration (UiApp)
from the QEMU CLI.
Because the UiApp can be disabled at runtime and it's currently the default
BootManagerMenu, change the default from UiApp to BootManagerMenuApp.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Luigi Leonardi <leonardi@redhat.com>
Add BootManagerMenuApp to all OvmfPkg dependencies.
To make UiApp optional, switch from UiApp to BootManagerMenuApp
as default BootManagerMenu.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Luigi Leonardi <leonardi@redhat.com>
Add sleep() function to BaseCryptLibMbedTls library in
Timerwrapper.c
Encountering an unresolved external symbol error for sleep while
using the BaseCryptLibMbedTls library in RuntimeDxe
Signed-off-by: Hema Anmisha <hema.anmisha.kalavakolanu@intel.com>
When the terminal driver is active, currently terminals available through
SetMode function are limited to mode 0 (80x25) despite multiple modes are
configured as MaxMode value (e.g. 3 modes in mTerminalConsoleModeData
list). Improve the function to support multiple modes based on the value.
Additionally add more modes that match with the GraphicsConsoleDxe driver.
This update is expected to help the symptom that the Setup or Shell screen
becomes smaller due to the text mode.
Signed-off-by: Phil Noh <Phil.Noh@amd.com>
Install a fresh python virtual environment every time to ensure
correct permissions and compatibility of the packages.
This is more robust than relying on being able to upgrade
an existing one.
Signed-off-by: Oliver Steffen <osteffen@redhat.com>
Prevent an issue where `memcpy()` instrinsic is being used after
recent MSVC linker update in windows-2022 VM image from 14.31.31103
to 14.32.31326.
Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com>