summaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2021-07-09.azurepipelines: Remove FINISHED and FAILED statesMichael D Kinney1-20/+0
Remove 10 second delay workarounds for issues observed when Mergify was originally enabled. These issues are no longer present when GitHub branch protections are used for status checks. Cc: Sean Brogan <sean.brogan@microsoft.com> Cc: Bret Barkelew <Bret.Barkelew@microsoft.com> Cc: Liming Gao <gaoliming@byosoft.com.cn> Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com> Reviewed-by: Bret Barkelew <bret.barkelew@microsoft.com> Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn>
2021-07-09.mergify: Simplify Mergify rules using GitHub status checksMichael D Kinney1-59/+12
* Enable Mergify queue feature to support auto rebase when 'push' label is set and gauarntee that all EDK II CI checks are run before merging in changes with linear history. * Use status checks configured in GitHub branch protections * Allow non EDK II Maintainers to create a PR Requires an EDK II Maintainer to accept the change and request merge by adding 'push' label. Only EDK II Maintainers have ability to set/clear labels. * Do not automatically close PRs for personal builds. Cc: Liming Gao <gaoliming@byosoft.com.cn> Cc: Sean Brogan <sean.brogan@microsoft.com> Cc: Bret Barkelew <Bret.Barkelew@microsoft.com> Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com> Acked-by: Bret Barkelew <bret.barkelew@microsoft.com> Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn>
2021-07-09BaseTools/Scripts: Ignore Mergify merge commits in PatchCheck.pyMichael D Kinney1-6/+12
Mergify adds merge commits to a PR when processing PRs using the queue feature with auto rebase. Update PatchCheck.py to ignore commit message issues with these merge commits. These merge commits are not added to the base branch when the PR is merged by Mergify. Cc: Bob Feng <bob.c.feng@intel.com> Cc: Liming Gao <gaoliming@byosoft.com.cn> Cc: Yuwei Chen <yuwei.chen@intel.com> Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com> Reviewed-by: Bret Barkelew <bret.barkelew@microsoft.com> Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn> Reviewed-by: Bob Feng <bob.c.feng@intel.com>
2021-07-09Maintainers.txt: remove Laszlo Ersek's entriesLaszlo Ersek1-4/+0
I'm relinquishing all my roles listed in "Maintainers.txt", for personal reasons. My email address <lersek@redhat.com> remains functional. To my understanding, my employer is working to assign others engineers to the edk2 project (at their discretion). Cc: Andrew Fish <afish@apple.com> Cc: Ard Biesheuvel <ardb+tianocore@kernel.org> Cc: Eric Dong <eric.dong@intel.com> Cc: Jordan Justen <jordan.l.justen@intel.com> Cc: Leif Lindholm <leif@nuviainc.com> Cc: Michael D Kinney <michael.d.kinney@intel.com> Cc: Philippe Mathieu-Daud? <philmd@redhat.com> Cc: Rahul Kumar <rahul1.kumar@intel.com> Cc: Ray Ni <ray.ni@intel.com> Cc: Sami Mujawar <sami.mujawar@arm.com> Signed-off-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Andrew Fish <afish@apple.com> Reviewed-by: Leif Lindholm <leif@nuviainc.com> Reviewed-by: Michael D Kinney <michael.d.kinney@intel.com> Reviewed-by: Philippe Mathieu-Daude <philmd@redhat.com> Reviewed-by: Ard Biesheuvel <ardb@kernel.org> Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn>
2021-07-09Pytool: SpellCheck: Defer path expansion in cspell parametersSean Brogan1-1/+2
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3454 On Linux the shell expands the wildcard paths and causes multiple files to be missed. This change adds additional quotes to defer expansion in order to bring parity in cspell result. Cc: Sean Brogan <sean.brogan@microsoft.com> Cc: Bret Barkelew <Bret.Barkelew@microsoft.com> Cc: Michael D Kinney <michael.d.kinney@intel.com> Cc: Liming Gao <gaoliming@byosoft.com.cn> Signed-off-by: Sean Brogan <sean.brogan@microsoft.com> Signed-off-by: Kun Qin <kuqin12@gmail.com> Reviewed-by: Sean Brogan <sean.brogan@microsoft.com> Reviewed-by: Bret Barkelew <bret.barkelew@microsoft.com> Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn>
2021-07-08IntelFsp2Pkg: PatchFv parseInfFile function modificationS, Ashraf Ali1-5/+13
REF:https://bugzilla.tianocore.org/show_bug.cgi?id=3476 parseInfFile currently reading the EFI_BASE_ADDRESS from INF, once the address found still it's continues to read the complete inf file which is not required. once the EFI_BASE_ADDRESS read from the INF no need to read the INF further. MSFT compiler can generate the map file address 8 or 16 based on which architecture the INF is compiler. currently it's support for IA32, modified the patchfv to support for all. modification of few typo errors in parseModMapFile, getCurr function required verification : Working Fine Signed-off-by: Ashraf Ali S <ashraf.ali.s@intel.com> Cc: Ray Ni <ray.ni@intel.com> Cc: Chasel Chiu <chasel.chiu@intel.com> Cc: Nate DeSimone <nathaniel.l.desimone@intel.com> Cc: Star Zeng <star.zeng@intel.com> Reviewed-by: Chasel Chiu <chasel.chiu@intel.com>
2021-07-07ArmVirtPkg: support Cloud Hypervisor in edk2Jianyong Wu3-1/+624
Cloud Hypervisor is KVM based VMM and is implemented in rust. Just like other VMMs it need UEFI support to let ACPI work. That's why Cloud Hypervisor is introduced here. Cc: Laszlo Ersek <lersek@redhat.com> Cc: Sami Mujawar <sami.mujawar@arm.com> Signed-off-by: Jianyong Wu <jianyong.wu@arm.com> Reviewed-by: Sami Mujawar <sami.mujawar@arm.com>
2021-07-07ArmVirtPkg: Install Acpi tables for Cloud HypervisorJianyong Wu3-0/+212
There is no device like Fw-cfg in Qemu in Cloud Hypervisor, so a specific Acpi handler is introduced here. The handler implemented here is in a very simple way: 1. acquire the RSDP from the PCD variable in the top ".dsc"; 2. get the XSDT address from RSDP structure; 3. get the ACPI tables following the XSDT structure and install them one by one; 4. get DSDT address from FADT and install DSDT table. Cc: Laszlo Ersek <lersek@redhat.com> Cc: Sami Mujawar <sami.mujawar@arm.com> Signed-off-by: Jianyong Wu <jianyong.wu@arm.com> Reviewed-by: Sami Mujawar <sami.mujawar@arm.com>
2021-07-07ArmVirtPkg: Add PlatformHasAcpiDtDxe for Cloud HypervisorJianyong Wu2-0/+121
The ArmVirtPkg\PlatformHasAcpiDtDxe implementation is not common and is specific for Qemu. So add a Cloud Hypervisor specific version that decides whether the firmware should expose an ACPI based or a Device Tree based hardware description to an operating system. Cc: Laszlo Ersek <lersek@redhat.com> Cc: Sami Mujawar <sami.mujawar@arm.com> Signed-off-by: Jianyong Wu <jianyong.wu@arm.com> Reviewed-by: Sami Mujawar <sami.mujawar@arm.com>
2021-07-07MdeModulePkg: Update YAML file to fix CI errorNickle Wang1-1/+4
Add OnigurumaUefiPort.h and OnigurumaUefiPort.c into ECC exception in MdeModulePkg.ci.yaml in order to fix CI error. Signed-off-by: Nickle Wang <nickle.wang@hpe.com> Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn>
2021-07-07MdeModulePkg/RegularExpressionDxe: Fix memory assert in FreePool()Nickle Wang2-13/+20
Memory buffer that is allocated by malloc() and realloc() will be shifted by 8 bytes because Oniguruma keeps its memory signature. This 8 bytes shift is not handled while calling free() to release memory. Add free() function to check Oniguruma signature before release memory because memory buffer is not touched when using calloc(). Signed-off-by: Nickle Wang <nickle.wang@hpe.com> Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn>
2021-07-06UefiCpuPkg/ExceptionLib: Conditionally clear shadow stack token busy bitSheng Wei2-42/+43
When enter SMM exception, there will be a stack switch only if the IST field of the interrupt gate is set. When CET shadow stack feature is enabled, if there is a stack switch between SMM exception and SMM, the shadow stack token busy bit needs to be cleared when return from SMM exception to SMM. In UEFI BIOS, only page fault exception does the stack swith when SMM shack guard feature is enabled. The condition of clear shadow stack token busy bit should be SMM stack guard enabled, CET shadows stack feature enabled and page fault exception. The shadow stack token should be initialized by UINT64. REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3462 Signed-off-by: Sheng Wei <w.sheng@intel.com> Cc: Eric Dong <eric.dong@intel.com> Cc: Ray Ni <ray.ni@intel.com> Cc: Laszlo Ersek <lersek@redhat.com> Cc: Rahul Kumar <rahul1.kumar@intel.com> Cc: Jiewen Yao <jiewen.yao@intel.com> Cc: Qihua Zhuang <qihua.zhuang@intel.com> Cc: Daquan Dong <daquan.dong@intel.com> Cc: Justin Tong <justin.tong@intel.com> Cc: Tom Xu <tom.xu@intel.com> Reviewed-by: Eric Dong <eric.dong@intel.com>
2021-07-06MdeModulePkg/PartitionDxe: Ignore PMBR BootIndicator per UEFI specNeal Gompa1-2/+1
Per UEFI Spec 2.8 (UEFI_Spec_2_8_final.pdf, page 114) 5.2.3 Protective MBR Table 20. Protective MBR Partition Record protecting the entire disk The description for BootIndicator states the following: > Set to 0x00 to indicate a non-bootable partition. If set to any > value other than 0x00 the behavior of this flag on non-UEFI > systems is undefined. Must be ignored by UEFI implementations. Unfortunately, we have been incorrectly assuming that the BootIndicator value must be 0x00, which leads to problems when the 'pmbr_boot' flag is set on a disk containing a GPT (such as with GNU parted). When the flag is set, the value changes to 0x01, causing this check to fail and the system is rendered unbootable despite it being valid from the perspective of the UEFI spec. To resolve this, we drop the check for the BootIndicator so that we stop caring about the value set there, which restores the capability to boot such disks. Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=3474 Cc: Chris Murphy <chrismurphy@fedoraproject.org> Cc: David Duncan <davdunc@amazon.com> Cc: Lazlo Ersek <lersek@redhat.com> Cc: Hao A Wu <hao.a.wu@intel.com> Cc: Ray Ni <ray.ni@intel.com> Cc: Zhichao Gao <zhichao.gao@intel.com> Signed-off-by: Neal Gompa <ngompa@fedoraproject.org> Message-Id: <20210705093603.575707-1-ngompa@fedoraproject.org> Reviewed-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Hao A Wu <hao.a.wu@intel.com>
2021-07-05OvmfPkg/Bhyve: use static PCI32Base addressCorvin Köhne2-3/+5
It's neccessary to allocate a Graphics Stolen Memory area to enable GPU-Passthrough for integrated Intel GPUs. Therefore, use a new memory layout with a static Pci32Baseaddress. Old layout: [... , lowmemlimit] RAM [lowmemlimit, 0xE000 0000] PCI Space New layout: [... , lowmemlimit] RAM [lowmemlimit, gsmbase ] Memory hole (may be absent) [gsmbase , 0xC000 0000] GSM (may be absent) [0xC000 0000, 0xE000 0000] PCI Space Reviewed-by: Peter Grehan <grehan@freebsd.org> Acked-by: Rebecca Cran <rebecca@bsdio.com> Signed-off-by: Corvin Köhne <c.koehne@beckhoff.com> Message-Id: <20210705110842.14088-2-c.koehne@beckhoff.com>
2021-07-05OvmfPkg/Bhyve: add USB supportCorvin Köhne2-0/+17
An USB driver is required to use a keyboard or mouse while installing an OS or while in a bootloader menu like grub when using GPU + USB Passthrough. Reviewed-by: Peter Grehan <grehan@freebsd.org> Acked-by: Rebecca Cran <rebecca@bsdio.com> Signed-off-by: Corvin Köhne <c.koehne@beckhoff.com> Message-Id: <20210705110842.14088-1-c.koehne@beckhoff.com>
2021-07-01UefiPayloadPkg: Fix the build failureGuo Dong2-5/+2
For non-universal payload, HandoffHobTable is used without initialization. This patch fixed this failure. Cc: Benjamin You <benjamin.you@intel.com> Cc: Maurice Ma <maurice.ma@intel.com> Reviewed-by: Maurice Ma <maurice.ma@intel.com> Signed-off-by: Guo Dong <guo.dong@intel.com>
2021-07-01Maintainers.txt: Update Maintainers and reviewers for UefiPayloadPkgGuo Dong1-2/+3
Add Ray Ni as UefiPayloadPkg Maintainer. Update Maurice Ma and Benjamin You as reviewers to continue support UefiPayloadPkg patch review. Cc: Ray Ni <ray.ni@intel.com> Cc: Benjamin You <benjamin.you@intel.com> Cc: Maurice Ma <maurice.ma@intel.com> Cc: Michael D Kinney <michael.d.kinney@intel.com> Reviewed-by: Maurice Ma <maurice.ma@intel.com> Reviewed-by: Benjamin You <benjamin.you@intel.com> Reviewed-by: Ray Ni <ray.ni@intel.com> Signed-off-by: Guo Dong <guo.dong@intel.com>
2021-06-30NetworkPkg: introduce the NETWORK_ISCSI_MD5_ENABLE feature test macroLaszlo Ersek3-1/+23
Introduce the NETWORK_ISCSI_MD5_ENABLE feature test macro for NetworkPkg. When explicitly set to FALSE, remove MD5 from IScsiDxe's CHAP algorithm list. Set NETWORK_ISCSI_MD5_ENABLE to TRUE by default, for compatibility reasons. Not just to minimize the disruption for platforms that currently include IScsiDxe, but also because RFC 7143 mandates MD5 for CHAP, and some vendors' iSCSI targets support MD5 only. With MD5 enabled, IScsiDxe will suggest SHA256, and then fall back to MD5 if the target requests it. With MD5 disabled, IScsiDxe will suggest SHA256, and break off the connection (and session) if the target doesn't support SHA256. Cc: Jiaxin Wu <jiaxin.wu@intel.com> Cc: Maciej Rabeda <maciej.rabeda@linux.intel.com> Cc: Philippe Mathieu-Daudé <philmd@redhat.com> Cc: Siyuan Fu <siyuan.fu@intel.com> Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=3355 Signed-off-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Maciej Rabeda <maciej.rabeda@linux.intel.com> Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> Message-Id: <20210629163337.14120-7-lersek@redhat.com>
2021-06-30NetworkPkg/IScsiDxe: support SHA256 in CHAPLaszlo Ersek2-1/+14
Insert a SHA256 CHAP_HASH structure at the start of "mChapHash". Update ISCSI_CHAP_MAX_DIGEST_SIZE to SHA256_DIGEST_SIZE (32). This enables the initiator and the target to negotiate SHA256 for CHAP, in preference to MD5. Cc: Jiaxin Wu <jiaxin.wu@intel.com> Cc: Maciej Rabeda <maciej.rabeda@linux.intel.com> Cc: Philippe Mathieu-Daudé <philmd@redhat.com> Cc: Siyuan Fu <siyuan.fu@intel.com> Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=3355 Signed-off-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> Reviewed-by: Maciej Rabeda <maciej.rabeda@linux.intel.com> Message-Id: <20210629163337.14120-6-lersek@redhat.com>
2021-06-30NetworkPkg/IScsiDxe: support multiple hash algorithms for CHAPLaszlo Ersek4-23/+207
Introduce the "mChapHash" table, containing the hash algorithms supported for CHAP. Hash algos listed at the beginning of the table are preferred by the initiator. In ISCSI_CHAP_STEP_ONE, send such a CHAP_A value that is the comma-separated, ordered list of algorithm identifiers from "mChapHash". Pre-format this value string at driver startup, in the new function IScsiCHAPInitHashList(). (In IScsiCHAPInitHashList(), also enforce that every hash algo's digest size fit into ISCSI_CHAP_MAX_DIGEST_SIZE, as the latter controls the digest, outgoing challenge, and hex *allocations*.) In ISCSI_CHAP_STEP_TWO, allow the target to select one of the offered hash algorithms, and remember the selection for the later steps. For ISCSI_CHAP_STEP_THREE, hash the challenge from the target with the selected hash algo. In ISCSI_CHAP_STEP_THREE, send the correctly sized digest to the target. If the initiator wants mutual authentication, then generate a challenge with as many bytes as the target's digest will have, in ISCSI_CHAP_STEP_FOUR. In ISCSI_CHAP_STEP_FOUR (i.e., when mutual authentication is required by the initiator), verify the target's response (digest) with the selected algorithm. Clear the selected hash algorithm before every login (remember that in IScsiDxe, every login is a leading login). There is no peer-observable change from this patch, as it only reworks the current MD5 support into the new internal representation. Cc: Jiaxin Wu <jiaxin.wu@intel.com> Cc: Maciej Rabeda <maciej.rabeda@linux.intel.com> Cc: Philippe Mathieu-Daudé <philmd@redhat.com> Cc: Siyuan Fu <siyuan.fu@intel.com> Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=3355 Signed-off-by: Laszlo Ersek <lersek@redhat.com> Message-Id: <20210629163337.14120-5-lersek@redhat.com> Reviewed-by: Maciej Rabeda <maciej.rabeda@linux.intel.com>
2021-06-30NetworkPkg/IScsiDxe: distinguish "maximum" and "selected" CHAP digest sizesLaszlo Ersek2-17/+22
IScsiDxe uses the ISCSI_CHAP_RSP_LEN macro for expressing the size of the digest (16) that it solely supports at this point (MD5). ISCSI_CHAP_RSP_LEN is used for both (a) *allocating* digest-related buffers (binary buffers and hex encodings alike), and (b) *processing* binary digest buffers (comparing them, filling them, reading them). In preparation for adding other hash algorithms, split purpose (a) from purpose (b). For purpose (a) -- buffer allocation --, introduce ISCSI_CHAP_MAX_DIGEST_SIZE. For purpose (b) -- processing --, rely on MD5_DIGEST_SIZE from <BaseCryptLib.h>. Distinguishing these purposes is justified because purpose (b) -- processing -- must depend on the hashing algorithm negotiated between initiator and target, while for purpose (a) -- allocation --, using the maximum supported digest size is suitable. For now, because only MD5 is supported, introduce ISCSI_CHAP_MAX_DIGEST_SIZE *as* MD5_DIGEST_SIZE. Note that the argument for using the digest size as the size of the outgoing challenge (in case mutual authentication is desired by the initiator) remains in place. Because of this, the above two purposes are distinguished for the "ISCSI_CHAP_AUTH_DATA.OutChallenge" field as well. This patch is functionally a no-op, just yet. Cc: Jiaxin Wu <jiaxin.wu@intel.com> Cc: Maciej Rabeda <maciej.rabeda@linux.intel.com> Cc: Philippe Mathieu-Daudé <philmd@redhat.com> Cc: Siyuan Fu <siyuan.fu@intel.com> Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=3355 Signed-off-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> Reviewed-by: Maciej Rabeda <maciej.rabeda@linux.intel.com> Message-Id: <20210629163337.14120-4-lersek@redhat.com>
2021-06-30NetworkPkg/IScsiDxe: add horizontal whitespace to IScsiCHAP filesLaszlo Ersek2-18/+18
In the next patches, we'll need more room for various macro and parameter names. For maintaining the current visual alignments, insert some horizontal whitespace in preparation. "git show -b" produces no output for this patch; the patch introduces no functional changes. Cc: Jiaxin Wu <jiaxin.wu@intel.com> Cc: Maciej Rabeda <maciej.rabeda@linux.intel.com> Cc: Philippe Mathieu-Daudé <philmd@redhat.com> Cc: Siyuan Fu <siyuan.fu@intel.com> Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=3355 Signed-off-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> Reviewed-by: Maciej Rabeda <maciej.rabeda@linux.intel.com> Message-Id: <20210629163337.14120-3-lersek@redhat.com>
2021-06-30NetworkPkg/IScsiDxe: re-set session-level authentication state before loginLaszlo Ersek1-0/+18
RFC 7143 explains that a single iSCSI session may use multiple TCP connections. The first connection established is called the leading connection. The login performed on the leading connection is called the leading login. Before the session is considered full-featured, the leading login must succeed. Further (non-leading) connections can be associated with the session later. (It's unclear to me from RFC 7143 whether the non-leading connections require individual (non-leading) logins as well, but that particular question is irrelevant from the perspective of this patch; see below.) The data model in IScsiDxe exhibits some confusion, regarding connection / session association: - On one hand, the "ISCSI_SESSION.Conns" field is a *set* (it has type LIST_ENTRY), and accordingly, connections can be added to, and removed from, a session, with the IScsiAttatchConnection() and IScsiDetatchConnection() functions. - On the other hand, ISCSI_MAX_CONNS_PER_SESSION has value 1, therefore no session will ever use more than 1 connection at a time (refer to instances of "Session->MaxConnections" in "NetworkPkg/IScsiDxe/IScsiProto.c"). This one-to-many confusion between ISCSI_SESSION and ISCSI_CONNECTION is very visible in the CHAP logic, where the progress of the authentication is maintained *per connection*, in the "ISCSI_CONNECTION.AuthStep" field (with values such as ISCSI_AUTH_INITIAL, ISCSI_CHAP_STEP_ONE, etc), but the *data* for the authentication are maintained *per session*, in the "AuthType" and "AuthData" fields of ISCSI_SESSION. Clearly, this makes no sense if multiple connections are eligible for logging in. Knowing that IScsiDxe uses only one connection per session (put differently: knowing that any connection is a leading connection, and any login is a leading login), there is no functionality bug. But the data model is still broken: "AuthType", "AuthData", and "AuthStep" should be maintained at the *same* level -- be it "session-level" or "(leading) connection-level". Fixing this data model bug is more than what I'm signing up for. However, I do need to add one function, in preparation for multi-hash support: whenever a new login is attempted (put differently: whenever the leading login is re-attempted), which always happens with a fresh connection, the session-level authentication data needs to be rewound to a sane initial state. Introduce the IScsiSessionResetAuthData() function. Call it from the central -- session-level -- IScsiSessionLogin() function, just before the latter calls the -- connection-level -- IScsiConnLogin() function. Right now, do nothing in IScsiSessionResetAuthData(); so functionally speaking, the patch is a no-op. Cc: Jiaxin Wu <jiaxin.wu@intel.com> Cc: Maciej Rabeda <maciej.rabeda@linux.intel.com> Cc: Philippe Mathieu-Daudé <philmd@redhat.com> Cc: Siyuan Fu <siyuan.fu@intel.com> Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=3355 Signed-off-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Maciej Rabeda <maciej.rabeda@linux.intel.com> Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> Message-Id: <20210629163337.14120-2-lersek@redhat.com>
2021-06-30UefiPayloadPkg/PayloadLoader: Remove assertionRay Ni2-2/+0
For R_386_RELATIVE and R_X86_64_RELATIVE, today's logic assumes that the content pointed by the Rela->r_offset is 0 but it's not always TRUE. We observed that linker may set the content to Rela->r_addend. The patch removes the assertion. There is no functionality impact for this patch. Signed-off-by: Ray Ni <ray.ni@intel.com> Cc: Maurice Ma <maurice.ma@intel.com> Reviewed-by: Guo Dong <guo.dong@intel.com> Cc: Benjamin You <benjamin.you@intel.com>
2021-06-30UefiPayloadPkg/PayloadLoader: Fix bug in locating relocation sectionRay Ni2-14/+30
Per ELF spec, the DT_REL/DT_RELA tag in dynamic section stores the virtual address of the relocation section. But today's code logic treats it as the section offset and finds the relocation section whose offset equals to DT_REL/DT_RELA. The logic can work when the section offset equals to the section virtual address. But when the ELF is generated from the link script that reserves a sizeof(pe_header) in the file beginning, the section offset doesn't equal to section virtual address. Such logic can not find the relocation section. The patch fixes this bug. Signed-off-by: Ray Ni <ray.ni@intel.com> Cc: Maurice Ma <maurice.ma@intel.com> Reviewed-by: Guo Dong <guo.dong@intel.com> Cc: Benjamin You <benjamin.you@intel.com>
2021-06-30IntelFsp2Pkg: Add Config Editor tool supportLoo, Tung Lun7-293/+7337
BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=3396 This is a GUI interface that can be used by users who would like to change configuration settings directly from the interface without having to modify the source. This tool depends on Python GUI tool kit Tkinter. It runs on both Windows and Linux. The user needs to load the YAML file along with DLT file for a specific board into the ConfigEditor, change the desired configuration values. Finally, generate a new configuration delta file or a config binary blob for the newly changed values to take effect. These will be the inputs to the merge tool or the stitch tool so that new config changes can be merged and stitched into the final configuration blob. This tool also supports binary update directly and display FSP information. It is also backward compatible for BSF file format. Running Configuration Editor: python ConfigEditor.py Co-authored-by: Maurice Ma <maurice.ma@intel.com> Cc: Maurice Ma <maurice.ma@intel.com> Cc: Nate DeSimone <nathaniel.l.desimone@intel.com> Cc: Star Zeng <star.zeng@intel.com> Cc: Chasel Chiu <chasel.chiu@intel.com> Signed-off-by: Loo Tung Lun <tung.lun.loo@intel.com> Reviewed-by: Chasel Chiu <chasel.chiu@intel.com>
2021-06-30MdePkg : Add IPMI Macro and Structure Defintions to resolve build errorsmanickavasakam karpagavinayagam2-0/+22
Build error reported for missing structures IPMI_SET_BOOT_OPTIONS_RESPONSE, EFI_IPMI_MSG_GET_BMC_EXEC_RSP, macro EFI_FIRMWARE_GET_BMC_EXECUTION_CONTEXT EFI_FIRMWARE_BMC_IN_FULL_RUNTIME/EFI_FIRMWARE_BMC_IN_FORCED_UPDATE_MODE when using edk2-platforms\Features\Intel\OutOfBandManagement\IpmiFeaturePkg Rename EFI_IPMI_MSG_GET_BMC_EXEC_RSPB, EFI_FIRMWARE_GET_BMC_EXECUTION_CONTEXT EFI_FIRMWARE_BMC_IN_FORCED_UPDATE_MODE to IPMI_MSG_GET_BMC_EXEC_RSPB,IPMI_GET_BMC_EXECUTION_CONTEXT IPMI_BMC_IN_FORCED_UPDATE_MODE Signed-off-by: Manickavasakam Karpagavinayagam <manickavasakamk@ami.com> Reviewed-by: Isaac Oram <isaac.w.oram@intel.com> Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn>
2021-06-29OvmfPkg/XenPlatformPei: Relocate shared_info page mappingAnthony PERARD1-1/+1
Unfortunately, Xen isn't ready to deal with mapping at the top of the physical address space, so we relocate the mapping after the LAPIC location. See this thread about the issue with the mapping: - https://lore.kernel.org/xen-devel/f8c4151a-6dac-d87c-ef46-eb35ada07bd9@suse.com/ The PhysicalAddressIdentityMapping() call isn't going to do anything anymore since everything under 4GB is already mapped, but there is no need to remove the call. Cc: Jan Beulich <JBeulich@suse.com> Cc: Andrew Cooper <andrew.cooper3@citrix.com> Signed-off-by: Anthony PERARD <anthony.perard@citrix.com> Message-Id: <20210628132337.46345-1-anthony.perard@citrix.com> Acked-by: Laszlo Ersek <lersek@redhat.com> [lersek@redhat.com: replace "CC:" with "Cc:", to pacify PatchCheck.py]
2021-06-29OvmfPkg/X86QemuLoadImageLib: State fw_cfg dependency in file headerDov Murik2-0/+6
Make it clear that X86QemuLoadImageLib relies on fw_cfg; prepare the ground to add a warning about the incompatibility with boot verification process. Cc: Laszlo Ersek <lersek@redhat.com> Cc: Ard Biesheuvel <ardb+tianocore@kernel.org> Cc: Jordan Justen <jordan.l.justen@intel.com> Cc: James Bottomley <jejb@linux.ibm.com> Cc: Tobin Feldman-Fitzthum <tobin@linux.ibm.com> Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=3457 Signed-off-by: Dov Murik <dovmurik@linux.ibm.com> Reviewed-by: Laszlo Ersek <lersek@redhat.com> Message-Id: <20210628105110.379951-6-dovmurik@linux.ibm.com>
2021-06-29OvmfPkg/GenericQemuLoadImageLib: Read cmdline from QemuKernelLoaderFsDov Murik2-15/+139
Remove the QemuFwCfgLib interface used to read the QEMU cmdline (-append argument) and the initrd size. Instead, use the synthetic filesystem QemuKernelLoaderFs which has three files: "kernel", "initrd", and "cmdline". Cc: Laszlo Ersek <lersek@redhat.com> Cc: Ard Biesheuvel <ardb+tianocore@kernel.org> Cc: Jordan Justen <jordan.l.justen@intel.com> Cc: James Bottomley <jejb@linux.ibm.com> Cc: Tobin Feldman-Fitzthum <tobin@linux.ibm.com> Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=3457 Signed-off-by: Dov Murik <dovmurik@linux.ibm.com> Message-Id: <20210628105110.379951-5-dovmurik@linux.ibm.com> Reviewed-by: Laszlo Ersek <lersek@redhat.com> Tested-by: Laszlo Ersek <lersek@redhat.com>
2021-06-29Revert "OvmfPkg/QemuKernelLoaderFsDxe: don't expose kernel command line"Dov Murik1-3/+8
This reverts commit efc52d67e1573ce174d301b52fa1577d552c8441. Manually fixed conflicts in: OvmfPkg/QemuKernelLoaderFsDxe/QemuKernelLoaderFsDxe.c Note that besides re-exposing the kernel command line as a file in the synthetic filesystem, we also revert back to AllocatePool instead of AllocatePages. Cc: Laszlo Ersek <lersek@redhat.com> Cc: Ard Biesheuvel <ardb+tianocore@kernel.org> Cc: Jordan Justen <jordan.l.justen@intel.com> Cc: James Bottomley <jejb@linux.ibm.com> Cc: Tobin Feldman-Fitzthum <tobin@linux.ibm.com> Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=3457 Signed-off-by: Dov Murik <dovmurik@linux.ibm.com> Reviewed-by: Laszlo Ersek <lersek@redhat.com> Message-Id: <20210628105110.379951-4-dovmurik@linux.ibm.com> Tested-by: Laszlo Ersek <lersek@redhat.com>
2021-06-29OvmfPkg/X86QemuLoadImageLib: plug cmdline blob leak on successDov Murik1-2/+4
When QemuLoadKernelImage() ends successfully, the command-line blob is not freed, even though it is not used elsewhere (its content is already copied to KernelLoadedImage->LoadOptions). The memory leak bug was introduced in commit 7c47d89003a6 ("OvmfPkg: implement QEMU loader library for X86 with legacy fallback", 2020-03-05). Cc: Ard Biesheuvel <ardb+tianocore@kernel.org> Cc: Jordan Justen <jordan.l.justen@intel.com> Cc: James Bottomley <jejb@linux.ibm.com> Cc: Tobin Feldman-Fitzthum <tobin@linux.ibm.com> Reported-by: Laszlo Ersek <lersek@redhat.com> Fixes: 7c47d89003a6f8f7f6f0ce8ca7d3e87c630d14cc Signed-off-by: Dov Murik <dovmurik@linux.ibm.com> Message-Id: <20210628105110.379951-3-dovmurik@linux.ibm.com> Reviewed-by: Laszlo Ersek <lersek@redhat.com> Tested-by: Laszlo Ersek <lersek@redhat.com>
2021-06-29OvmfPkg/GenericQemuLoadImageLib: plug cmdline blob leak on successDov Murik1-2/+4
When QemuLoadKernelImage() ends successfully, the command-line blob is not freed, even though it is not used elsewhere (its content is already copied to KernelLoadedImage->LoadOptions). The memory leak bug was introduced in commit ddd2be6b0026 ("OvmfPkg: provide a generic implementation of QemuLoadImageLib", 2020-03-05). Cc: Ard Biesheuvel <ardb+tianocore@kernel.org> Cc: Jordan Justen <jordan.l.justen@intel.com> Cc: James Bottomley <jejb@linux.ibm.com> Cc: Tobin Feldman-Fitzthum <tobin@linux.ibm.com> Reported-by: Laszlo Ersek <lersek@redhat.com> Fixes: ddd2be6b0026abcd0f819b3915fc80c3de81dd62 Signed-off-by: Dov Murik <dovmurik@linux.ibm.com> Message-Id: <20210628105110.379951-2-dovmurik@linux.ibm.com> Reviewed-by: Laszlo Ersek <lersek@redhat.com> Tested-by: Laszlo Ersek <lersek@redhat.com>
2021-06-29MdePkg: MmConfiguration: Added definition of MM Configuration PPIKun Qin2-0/+65
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3440 MM Configuration PPI was defined in PI Specification since v1.5. This change added definition of such PPI and related GUIDs into MdePkg. Cc: Michael D Kinney <michael.d.kinney@intel.com> Cc: Liming Gao <gaoliming@byosoft.com.cn> Cc: Zhiguang Liu <zhiguang.liu@intel.com> Cc: Michael Kubacki <michael.kubacki@microsoft.com> Signed-off-by: Kun Qin <kuqin12@gmail.com> Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn>
2021-06-29MdePkg: MmConfiguration: Move definition of EFI_MM_RESERVED_MMRAM_REGIONKun Qin2-16/+16
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3440 The definition of EFI_MM_RESERVED_MMRAM_REGION, according to PI Spec 1.5 is also referenced in EFI_PEI_MM_CONFIGURATION_PPI. Defining this structure as is will enforce any potential usage of MM Configuration PPI interface to include <Protocol/MmConfiguration.h>. This change moves this structure definition to PiMultiPhase.h, which is already included by Protocol/MmConfiguration.h through PiMmCis.h. It also paves way for introducing Ppi/MmConfiguration.h with proper dependency. Cc: Michael D Kinney <michael.d.kinney@intel.com> Cc: Liming Gao <gaoliming@byosoft.com.cn> Cc: Zhiguang Liu <zhiguang.liu@intel.com> Cc: Michael Kubacki <michael.kubacki@microsoft.com> Signed-off-by: Kun Qin <kuqin12@gmail.com> Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn>
2021-06-29BaseTools GenFw: Add support for RISCV GOT/PLT relocationsSunil V L1-6/+53
Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=3096 This patch adds support for R_RISCV_CALL_PLT and R_RISCV_GOT_HI20 relocations generated by PIE enabled compiler. This also needed changes to R_RISCV_32 and R_RISCV_64 relocations as explained in https://github.com/riscv/riscv-gnu-toolchain/issues/905#issuecomment-846682710 Testing: 1) Debian GCC 8.3.0 and booted sifive_u and QMEU virt models. 2) Debian 10.2.0 and booted QEMU virt model. 3) riscv-gnu-tool chain 9.2 and booted QEMU virt model. Signed-off-by: Sunil V L <sunilvl@ventanamicro.com> Acked-by: Abner Chang <abner.chang@hpe.com> Reviewed-by: Daniel Schaefer <daniel.schaefer@hpe.com> Tested-by: Daniel Schaefer <daniel.schaefer@hpe.com> Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn> Cc: Bob Feng <bob.c.feng@intel.com> Cc: Liming Gao <gaoliming@byosoft.com.cn> Cc: Yuwei Chen <yuwei.chen@intel.com> Cc: Heinrich Schuchardt <xypron.glpk@gmx.de>
2021-06-25BaseTools: Reset ERRORLEVEL in toolsetup.bat after edk2basetools checkRebecca Cran1-0/+2
When using the in-source BaseTools, edksetup.bat will exit with an ERRORLEVEL of 1 because the line in toolsetup.bat "%PYTHON_COMMAND% -c "import edk2basetools" >NUL 2>NUL" fails. Ensure ERRORLEVEL is set to 0 when edksetup.bat or toolsetup.bat is successfully run. Signed-off-by: Rebecca Cran <rebecca@bsdio.com> Reviewed-by: Bob Feng <bob.c.feng@intel.com> Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn>
2021-06-25BaseTools: Fix spelling of "overwrite" and "overwriting" in toolset.batRebecca Cran1-3/+3
The words "overwrite" and "overwriting" are one word and shouldn't have hyphens. Signed-off-by: Rebecca Cran <rebecca@bsdio.com> Reviewed-by: Bob Feng <bob.c.feng@intel.com> Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn>
2021-06-25BaseTools: Remove check for Split.exe in toolset.batRebecca Cran1-1/+0
Split is now a Python tool, so BaseTools\Bin\Win32\Split.exe no longer exists. Remove the check for it from toolsetup.bat to prevent the erroneous claim that the binary C tools are missing. Signed-off-by: Rebecca Cran <rebecca@bsdio.com> Reviewed-by: Bob Feng <bob.c.feng@intel.com> Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn>
2021-06-24UefiPayloadPkg: consume the BootManagerMenuFile HOBduntan3-2/+57
Consume the BootManagerMenuFile HOB in PlatformBootManagerLib This Lib is in UefiPayloadPkg Cc: Maurice Ma <maurice.ma@intel.com> Cc: Guo Dong <guo.dong@intel.com> Cc: Benjamin You <benjamin.you@intel.com> Reviewed-by: Guo Dong <guo.dong@intel.com> Signed-off-by: DunTan <dun.tan@intel.com>
2021-06-24UefiPayloadPkg: Add new structure for BootManagerMenuFile HOBduntan2-0/+30
Add new structure for BootManagerMenuFile HOB in UefiPayloadPkg Cc: Maurice Ma <maurice.ma@intel.com> Cc: Guo Dong <guo.dong@intel.com> Cc: Benjamin You <benjamin.you@intel.com> Reviewed-by: Guo Dong <guo.dong@intel.com> Signed-off-by: DunTan <dun.tan@intel.com>
2021-06-24UefiPayloadPkg: Add PcdResetOnMemoryTypeInformationChange in UefiPayloadPkgZhiguang Liu1-0/+1
This PCD will be consumed by Universal Payload Cc: Maurice Ma <maurice.ma@intel.com> Cc: Guo Dong <guo.dong@intel.com> Cc: Benjamin You <benjamin.you@intel.com> Reviewed-by: Guo Dong <guo.dong@intel.com> Signed-off-by: Zhiguang Liu <zhiguang.liu@intel.com>
2021-06-24UefiPayloadPkg: Add PcdInstallAcpiSdtProtocol feature in UefiPayloadPkgZhiguang Liu1-0/+2
To install ACPI SDT protocol, define PcdInstallAcpiSdtProtocol as TRUE. Cc: Maurice Ma <maurice.ma@intel.com> Cc: Guo Dong <guo.dong@intel.com> Cc: Benjamin You <benjamin.you@intel.com> Reviewed-by: Guo Dong <guo.dong@intel.com> Signed-off-by: Zhiguang Liu <zhiguang.liu@intel.com>
2021-06-24UefiPayloadPkg: Add macro to enable and disable some driversZhiguang Liu2-1/+14
Add macro EMU_VARIABLE_ENABLE and DISABLE_RESET_SYSTEM to include or exclude some drivers from Payload Cc: Maurice Ma <maurice.ma@intel.com> Cc: Guo Dong <guo.dong@intel.com> Cc: Benjamin You <benjamin.you@intel.com> Reviewed-by: Guo Dong <guo.dong@intel.com> Signed-off-by: Zhiguang Liu <zhiguang.liu@intel.com>
2021-06-24UefiPayloadPkg: Remove assert when reserve MMIO/IO resource for devicesZhiguang Liu1-9/+11
Some boot loader may already reserve MMIO/IO resource for IOAPIC and HPET, so remove the assert when reserve MMIO/IO resource for IOAPIC and HPET Cc: Maurice Ma <maurice.ma@intel.com> Cc: Guo Dong <guo.dong@intel.com> Cc: Benjamin You <benjamin.you@intel.com> Reviewed-by: Guo Dong <guo.dong@intel.com> Signed-off-by: Zhiguang Liu <zhiguang.liu@intel.com>
2021-06-24UefiPayloadPkg: Include UniversalPayLoad modules in UefiPayloadPkg.dscZhiguang Liu2-5/+20
Add a new macro "UNIVERSAL_PAYLOAD" to build Universal Payload. Cc: Maurice Ma <maurice.ma@intel.com> Cc: Guo Dong <guo.dong@intel.com> Cc: Benjamin You <benjamin.you@intel.com> Reviewed-by: Guo Dong <guo.dong@intel.com> Signed-off-by: Zhiguang Liu <zhiguang.liu@intel.com>
2021-06-24UefiPayloadPkg: Fix up UPL Pcd databaseZhiguang Liu6-7/+119
Edk2 bootloader will pass the pei pcd database, and UPL also contain a PCD database. Dxe PCD driver has the assumption that the two PCD database can be catenated and the local token number should be successive。 This patch will manually fix up the UPL PCD database to meet that assumption. Cc: Maurice Ma <maurice.ma@intel.com> Cc: Guo Dong <guo.dong@intel.com> Cc: Benjamin You <benjamin.you@intel.com> Reviewed-by: Guo Dong <guo.dong@intel.com> Signed-off-by: Zhiguang Liu <zhiguang.liu@intel.com>
2021-06-24UefiPayloadPkg: Get and enter DxeCore for Universal PayloadZhiguang Liu5-4/+104
From gUniversalPayloadExtraDataGuid Guid Hob, get the Dxe FV information, and get the Dxe Core from the FV. Also, make sure if there are muliple FV hob, the FV hob pointing to this FV will be the first in the hob list. Cc: Maurice Ma <maurice.ma@intel.com> Cc: Guo Dong <guo.dong@intel.com> Cc: Benjamin You <benjamin.you@intel.com> Reviewed-by: Guo Dong <guo.dong@intel.com> Signed-off-by: Zhiguang Liu <zhiguang.liu@intel.com>
2021-06-24UefiPayloadPkg: Create separate Payload Entry for UniversalPayloadZhiguang Liu2-0/+402
This patch create the UniversalPayload Entry based on the UefiPayload Entry. It implements the logic to find a proper memory range to create the new Hob and migrate the Hobs from Bootloader. To make the change history clear, the logic to get the DxeCore will be in the next patch. Cc: Maurice Ma <maurice.ma@intel.com> Cc: Guo Dong <guo.dong@intel.com> Cc: Benjamin You <benjamin.you@intel.com> Reviewed-by: Guo Dong <guo.dong@intel.com> Signed-off-by: Zhiguang Liu <zhiguang.liu@intel.com>
2021-06-24UefiPayloadPkg: Update the function definition of HobConstructorZhiguang Liu3-25/+22
Update the function defination of HobConstructor to align the Phit Hob structure. Cc: Maurice Ma <maurice.ma@intel.com> Cc: Guo Dong <guo.dong@intel.com> Cc: Benjamin You <benjamin.you@intel.com> Reviewed-by: Guo Dong <guo.dong@intel.com> Signed-off-by: Zhiguang Liu <zhiguang.liu@intel.com>