summaryrefslogtreecommitdiffstats
path: root/MdeModulePkg/Universal
Commit message (Collapse)AuthorAgeFilesLines
* MdeModulePkg: VariableSmmRuntimeDxe: Added request unblock memory interfaceKun Qin2021-03-052-0/+43
| | | | | | | | | | | | | | | | This changes added usage of MmUnblockMemoryLib to explicitly request runtime cache regions(and its indicators) to be accessible from MM environment when PcdEnableVariableRuntimeCache is enabled. It will bring in compatibility with architectures that supports full memory blockage inside MM. Cc: Jian J Wang <jian.j.wang@intel.com> Cc: Hao A Wu <hao.a.wu@intel.com> Cc: Liming Gao <gaoliming@byosoft.com.cn> Signed-off-by: Kun Qin <kun.q@outlook.com> Reviewed-by: Hao A Wu <hao.a.wu@intel.com> Message-Id: <MWHPR06MB31026EA41F28F2CE12B68574F3969@MWHPR06MB3102.namprd06.prod.outlook.com>
* MdeModulePkg/VariableStandaloneMm: Set PcdFlashNvStorageVariableBase to PcdIlias Apalodimas2021-02-231-2/+2
| | | | | | | | | | | | | | | | | | | | | | Instead of running StMM in SPM, OP-TEE creates a new secure partition, which emulates SPM and isolates StMM from the rest of the Trusted Applications (TAs). We can then compile StMM as an FD image and run it in OP-TEE. With the addition of a new RPMB driver, we can leverage OP-TEE and store variables to an RPMB device. Since EDK2 upper layers expect byte addressable code, for the RPMB to work, we need to allocate memory and sync it with the hardware on read/writes. Since DynamicPCDs are not supported in that context we can only use PatchablePCDs. So let's switch them to Pcd instead of FixedPcd and accomodate the new driver. While at it, move the rest of the variables under Pcd section, instead of FixedPcd -- this is in line with how the variables are defined in the other Variable modules. Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Sami Mujawar <sami.mujawar@arm.com> Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn> Acked-by: Ard Biesheuvel <ardb@kernel.org>
* MdeModulePkg/TerminalDxe: Terminal fifo buffer overflow.gechao2021-02-031-1/+1
| | | | | | | | | | | | | | | | | | | Fix the bug of terminal fifo buffer overflow with UINT8 type. typedef struct { UINT8 Head; UINT8 Tail; UINT8 Data[RAW_FIFO_MAX_NUMBER + 1]; } RAW_DATA_FIFO; RAW_FIFO_MAX_NUMBER is 256. the data buffer size is 257 (Index from 0 to 256), but the max value of the index, Head or Tail (UINT8), is 255. That means the last data of the data buffer would be always empty if we use Head/Tail to output/input the data correctly. And because of the incorrect buffer size the FIFO full check "((Tail + 1) % (RAW_FIFO_MAX_NUMBER + 1)) == Head" would never meet. Signed-off-by: gechao <gechao@greatwall.com.cn> Reviewed-by: Zhichao Gao <zhichao.gao@intel.com>
* MdeModulePkg: ReportStatusCodeRouter: Support StandaloneMm RSC RouterKun Qin2021-02-016-55/+178
| | | | | | | | | | | | | | | | This change added support of RSC router under StandaloneMm. It replaces SMM version ReportStatusCode protocol definitions with MM version. This patch also switched to use gMmst instead of gSmst. Lastly, it abstracts standalone and traditional MM driver entrypoints into separate files to allow maximal common implementations. Cc: Jian J Wang <jian.j.wang@intel.com> Cc: Hao A Wu <hao.a.wu@intel.com> Cc: Dandan Bi <dandan.bi@intel.com> Cc: Liming Gao <gaoliming@byosoft.com.cn> Signed-off-by: Kun Qin <kun.q@outlook.com> Reviewed-by: Hao A Wu <hao.a.wu@intel.com>
* MdeModulePkg: FirmwarePerformanceDataTable: Added StandaloneMm supportKun Qin2021-02-016-46/+279
| | | | | | | | | | | | | | | This change added support of FPDT driver under StandaloneMm. It replaces SMM version ReportStatusCode protocol with MM version. This patch also abstracts standalone and traditional MM interfaces into separate files to support each corresponding function prototypes and implementations. Cc: Jian J Wang <jian.j.wang@intel.com> Cc: Hao A Wu <hao.a.wu@intel.com> Cc: Dandan Bi <dandan.bi@intel.com> Cc: Liming Gao <gaoliming@byosoft.com.cn> Signed-off-by: Kun Qin <kun.q@outlook.com> Reviewed-by: Hao A Wu <hao.a.wu@intel.com>
* MdeModulePkg: StatusCodeHandler: StatusCodeHandler driver in StandaloneMmKun Qin2021-02-018-45/+179
| | | | | | | | | | | | | | | | This change added support of StandaloneMm for StatusCodeHandler. It adds a new instance of StatusCodeHandler of MM_STANDALONE type, and abstracts the driver entrypoint into separate files, replaced gSmst with gMmst, and switched to MM version of RscHandlerProtocol. Cc: Jian J Wang <jian.j.wang@intel.com> Cc: Hao A Wu <hao.a.wu@intel.com> Cc: Dandan Bi <dandan.bi@intel.com> Cc: Liming Gao <gaoliming@byosoft.com.cn> Cc: Jiewen Yao <jiewen.yao@intel.com> Signed-off-by: Kun Qin <kun.q@outlook.com> Reviewed-by: Hao A Wu <hao.a.wu@intel.com>
* MdeModulePkg/ConSplitter: Change StdErr color to EFI_LIGHTGRAYSamer El-Haj-Mahmoud2021-01-061-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | ConSplitter is using EFI_LIGHTGRAY foreground color for ConOut and EFI_MAGENTA for StdErr consoles. This is impacting the DebugLib output on that same serial console (e.g. DebugLibSerialPort) after gEfiStandardErrorDeviceGuid is installed on that port. The impact also extends to Linux serial console output in OVMF because it inherits the color setting from the firmware. This is inconsistent and annoying, with MAGENTA being barely legible on a black background. Let's change StdErr default color to LIGHTGRAY for consistency and readability. This results in the same color being used for all consoles sharing the same serial port (ConOut, StdErr, DebugLib, OS console). Platforms wishing to distinguish the colors of consoles can do so in their own Platform BDS initialization. Cc: Jian J Wang <jian.j.wang@intel.com> Cc: Hao A Wu <hao.a.wu@intel.com> Cc: Zhichao Gao <zhichao.gao@intel.com> Cc: Ray Ni <ray.ni@intel.com> Cc: Ard Biesheuvel <Ard.Biesheuvel@arm.com> Signed-off-by: Samer El-Haj-Mahmoud <Samer.El-Haj-Mahmoud@arm.com> Reviewed-by: Zhichao Gao <zhichao.gao@intel.com> Reviewed-by: Pete Batard <pete@akeo.ie> Tested-by: Pete Batard <pete@akeo.ie> (On an RPi 4 platform where this was another annoyance)
* MdeModulePkg/Graphics: Fix spelling mistakesSamer El-Haj-Mahmoud2021-01-063-43/+43
| | | | | | | | | | | | | | Fix various spelling mistakes in GraphicsConsoleDxe, ConsPlitter, and SimpleTextOut header Cc: Jian J Wang <jian.j.wang@intel.com> Cc: Hao A Wu <hao.a.wu@intel.com> Cc: Zhichao Gao <zhichao.gao@intel.com> Cc: Ray Ni <ray.ni@intel.com> Cc: Ard Biesheuvel <Ard.Biesheuvel@arm.com> Cc: Pete Batard <pete@akeo.ie> Signed-off-by: Samer El-Haj-Mahmoud <Samer.El-Haj-Mahmoud@arm.com> Reviewed-by: Zhichao Gao <zhichao.gao@intel.com>
* MdeModulePkg/GraphicsConsoleDxe: Change default CursorVisible to FALSESamer El-Haj-Mahmoud2021-01-061-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | REF: https://github.com/pftf/RPi4/issues/115 GraphicsConsoleDxe defaults the ConOut Mode.CursorVisible to TRUE. However, the driver never draws the cursor during init. This results in the first call to disable the cursor (using ConOut->EnableCursor(FALSE)) to actually draw the cursor on the screen, as the logic in FlushCursor depends on the Mode.CursorVisible state to determine if it should draw or erase the cursor. Fix by changing the default CursorVisible in this driver to FALSE. Cc: Jian J Wang <jian.j.wang@intel.com> Cc: Hao A Wu <hao.a.wu@intel.com> Cc: Zhichao Gao <zhichao.gao@intel.com> Cc: Ray Ni <ray.ni@intel.com> Cc: Ard Biesheuvel <Ard.Biesheuvel@arm.com> Cc: Pete Batard <pete@akeo.ie> Signed-off-by: Samer El-Haj-Mahmoud <Samer.El-Haj-Mahmoud@arm.com> Reviewed-by: Zhichao Gao <zhichao.gao@intel.com> Reviewed-by: Pete Batard <pete@akeo.ie> Tested-by: Pete Batard <pete@akeo.ie> (On an RPi4 platform where we had this annoyance of an unwanted cursor displaying on top of the platform logo)
* MdeModulePkg/Universal/StatusCodeHandler: Fix a bug about log lostTan, Ming2020-12-223-17/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3126 1. If use PeiDxeDebugLibReportStatusCode as DebugLib, then some logs after ExitBootService() will be lost. 2. The root cause: 2.1 The original code will register an unregister function of gEfiEventExitBootServicesGuid, this unregister function will call EFI_RSC_HANDLER_PROTOCOL->Unregister and does not support log through serial port. 2.2 And some other drivers also register call back funtions of gEfiEventExitBootServicesGuid. 2.3 Then after the unregister function is called, other call back functions can't out log if them use RSC as DebugLib. 3. The DxeMain will report status code EFI_SW_BS_PC_EXIT_BOOT_SERVICES after notify all the call back functions of gEfiEventExitBootServicesGuid. 4. Solution: the StatusCodeHandlerRuntimeDxe.c will not register an unregister function of gEfiEventExitBootServicesGuid, but unregister it after receive the status code of EFI_SW_BS_PC_EXIT_BOOT_SERVICES. Cc: Dandan Bi <dandan.bi@intel.com> Cc: Liming Gao <gaoliming@byosoft.com.cn> Signed-off-by: Ming Tan <ming.tan@intel.com> Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn> Reviewed-by: Dandan Bi <dandan.bi@intel.com>
* MdeModulePkg/Variable/RuntimeDxe: Add Variable Lock Protocol Unit TestsMichael D Kinney2020-12-152-0/+601
| | | | | | | | | | | | | | | | https://bugzilla.tianocore.org/show_bug.cgi?id=3111 Add host based unit tests for the multiple lock case using Variable Lock Protocol, Variable Policy Protocol, and mixes of Variable Lock Protocol and Variable Policy Protocol. Cc: Michael D Kinney <michael.d.kinney@intel.com> Cc: Hao A Wu <hao.a.wu@intel.com> Cc: Liming Gao <gaoliming@byosoft.com.cn> Signed-off-by: Bret Barkelew <Bret.Barkelew@microsoft.com> Reviewed-by: Hao A Wu <hao.a.wu@intel.com> Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn> Reviewed-by: Michael D Kinney <michael.d.kinney@intel.com>
* MdeModulePkg/Variable/RuntimeDxe: Restore Variable Lock Protocol behaviorBret Barkelew2020-12-151-36/+59
| | | | | | | | | | | | | | | | | | | | | | | https://bugzilla.tianocore.org/show_bug.cgi?id=3111 The VariableLock shim currently fails if called twice because the underlying Variable Policy engine returns an error if a policy is set on an existing variable. This breaks existing code which expect it to silently pass if a variable is locked multiple times (because it should "be locked"). Refactor the shim to confirm that the variable is indeed locked and then change the error to EFI_SUCCESS and generate a DEBUG_ERROR message so the duplicate lock can be reported in a debug log and removed. Cc: Michael D Kinney <michael.d.kinney@intel.com> Cc: Hao A Wu <hao.a.wu@intel.com> Cc: Liming Gao <gaoliming@byosoft.com.cn> Signed-off-by: Bret Barkelew <Bret.Barkelew@microsoft.com> Reviewed-by: Hao A Wu <hao.a.wu@intel.com> Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn> Reviewed-by: Michael D Kinney <michael.d.kinney@intel.com>
* MdeModulePkg: Fix SetMem parameter in OnigurumaUefiPortBaraneedharan Anbazhagan2020-12-141-1/+1
| | | | | | | | | | Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=3085 Coding error in converting memset call to SetMem - Length and Value is not swapped on calling SetMem Signed-off-by: Baraneedharan Anbazhagan <anbazhagan@hp.com> Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn>
* MdeModulePkg: Drop VarLock from RuntimeDxe variable driverBret Barkelew2020-11-175-48/+75
| | | | | | | | | | | | | | | | | https://bugzilla.tianocore.org/show_bug.cgi?id=2522 Now that everything should be moved to VariablePolicy, drop support for the deprecated VarLock SMI interface and associated functions from variable RuntimeDxe. Cc: Jian J Wang <jian.j.wang@intel.com> Cc: Hao A Wu <hao.a.wu@intel.com> Cc: Liming Gao <liming.gao@intel.com> Cc: Bret Barkelew <brbarkel@microsoft.com> Signed-off-by: Bret Barkelew <brbarkel@microsoft.com> Reviewed-by: Dandan Bi <dandan.bi@intel.com> Acked-by: Jian J Wang <jian.j.wang@intel.com>
* MdeModulePkg: Change TCG MOR variables to use VariablePolicyBret Barkelew2020-11-174-25/+82
| | | | | | | | | | | | | | | https://bugzilla.tianocore.org/show_bug.cgi?id=2522 These were previously using VarLock, which is being deprecated. Cc: Jian J Wang <jian.j.wang@intel.com> Cc: Hao A Wu <hao.a.wu@intel.com> Cc: Liming Gao <liming.gao@intel.com> Cc: Bret Barkelew <brbarkel@microsoft.com> Signed-off-by: Bret Barkelew <brbarkel@microsoft.com> Reviewed-by: Dandan Bi <dandan.bi@intel.com> Acked-by: Jian J Wang <jian.j.wang@intel.com>
* MdeModulePkg: Allow VariablePolicy state to delete protected variablesBret Barkelew2020-11-172-0/+12
| | | | | | | | | | | | | | | | | | | | https://bugzilla.tianocore.org/show_bug.cgi?id=2522 TcgMorLockSmm provides special protections for the TCG MOR variables. This will check IsVariablePolicyEnabled() before enforcing them to allow variable deletion when policy engine is disabled. Only allows deletion, not modification. Cc: Jian J Wang <jian.j.wang@intel.com> Cc: Hao A Wu <hao.a.wu@intel.com> Cc: Liming Gao <liming.gao@intel.com> Cc: Bret Barkelew <brbarkel@microsoft.com> Signed-off-by: Bret Barkelew <brbarkel@microsoft.com> Reviewed-by: Dandan Bi <dandan.bi@intel.com> Acked-by: Jian J Wang <jian.j.wang@intel.com>
* MdeModulePkg: Connect VariablePolicy business logic to VariableServicesBret Barkelew2020-11-177-0/+670
| | | | | | | | | | | | | | | | | | | | https://bugzilla.tianocore.org/show_bug.cgi?id=2522 VariablePolicy is an updated interface to replace VarLock and VarCheckProtocol. Add connective code to publish the VariablePolicy protocol and wire it to either the SMM communication interface or directly into the VariablePolicyLib business logic. Cc: Jian J Wang <jian.j.wang@intel.com> Cc: Hao A Wu <hao.a.wu@intel.com> Cc: Liming Gao <liming.gao@intel.com> Cc: Bret Barkelew <brbarkel@microsoft.com> Signed-off-by: Bret Barkelew <brbarkel@microsoft.com> Reviewed-by: Dandan Bi <dandan.bi@intel.com> Acked-by: Jian J Wang <jian.j.wang@intel.com> Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn>
* MdeModulePkg DisplayEngineDxe: Correct the local variable name.gechao2020-11-121-8/+8
| | | | | Signed-off-by: gechao <gechao@greatwall.com.cn> Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn>
* MdeModulePkg/DriverSampleDxe: Add HII sample optionsAbner Chang2020-11-113-1/+48
| | | | | | | | | | | | | | | Add x-uefi-ns keyword REST_STYLE HII option and non x-uefi keyword REST_STYLE HII option. Signed-off-by: Abner Chang <abner.chang@hpe.com> Cc: Jiaxin Wu <jiaxin.wu@intel.com> Cc: Siyuan Fu <siyuan.fu@intel.com> Cc: Fan Wang <fan.wang@intel.com> Cc: Jiewen Yao <jiewen.yao@intel.com> Cc: Dandan Bi <dandan.bi@intel.com> Cc: Eric Dong <eric.dong@intel.com> Cc: Nickle Wang <nickle.wang@hpe.com> Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn>
* MdeModulePkg/AcpiTableDxe: use pool allocation for RSDP if possibleArd Biesheuvel2020-10-301-9/+24
| | | | | | | | | | Use a pool allocation for the RSDP ACPI root pointer structure if no memory limit is in effect that forces us to use page based allocation, which may be wasteful if they get rounded up to 64 KB as is the case on AArch64. Signed-off-by: Ard Biesheuvel <ard.biesheuvel@arm.com> Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn>
* MdeModulePkg/AcpiTableDxe: use pool allocation for RSDT/XSDT if possibleArd Biesheuvel2020-10-301-46/+72
| | | | | | | | | | If no memory allocation limit is in effect for ACPI tables, prefer pool allocations over page allocations, to avoid wasting memory on systems where page based allocations are rounded up to 64 KB, such as AArch64. Signed-off-by: Ard Biesheuvel <ard.biesheuvel@arm.com> Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn>
* MdeModulePkg/AcpiTableDxe: use pool allocations when possibleArd Biesheuvel2020-10-303-28/+66
| | | | | | | | | | | | | | | | On AArch64 systems, page based allocations for memory types that are relevant to the OS are rounded up to 64 KB multiples. This wastes some space in the ACPI table memory allocator, since it uses page based allocations in order to be able to place the ACPI tables low in memory. Since the latter requirement does not exist on AArch64, switch to pool allocations for all ACPI tables except the root tables if the active allocation policy permits them to be anywhere in memory. The root tables will be handled in a subsequent patch. Signed-off-by: Ard Biesheuvel <ard.biesheuvel@arm.com> Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn>
* Revert "MdeModulePkg/PartitionDxe: Fix the incorrect LBA size in child ..."Zhichao Gao2020-10-201-3/+9
| | | | | | | | | | | | | | | | | | | | This reverts commit e0eacd7daa6f2e59de2b35a5dfe8bb4c38821e31. REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3012 The patch to fix LBA size would cause a regression that make the partition of CD image with media type other than NO_EMULATOR unobserved. The patch used to fix the CD image's MBR table issue. The CD MBR table would always be ignored because it would be handled by the Eltorito partition handler first and never go into the MBR handler. So directly revert it. Cc: Ray Ni <ray.ni@intel.com> Cc: Hao A Wu <hao.a.wu@intel.com> Signed-off-by: Zhichao Gao <zhichao.gao@intel.com> Reviewed-by: Ray Ni <ray.ni@intel.com> Tested-by: Gary Lin <glin@suse.com>
* MdeModulePkg: Remove code wrapped by DISABLE_NEW_DEPRECATED_INTERFACESZhang, Shenglei2020-10-131-31/+6
| | | | | | | | | | | REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2777 Code wrapped by DISABLE_NEW_DEPRECATED_INTERFACES is deprecated. So remove it. Cc: Jian J Wang <jian.j.wang@intel.com> Cc: Hao A Wu <hao.a.wu@intel.com> Signed-off-by: Shenglei Zhang <shenglei.zhang@intel.com> Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn>
* MdeModulePkg/HiiDatabase: Do not modify CONST stringJeff Brasen2020-10-071-5/+7
| | | | | | | | Update function behavior to not modify the incoming string that is marked as CONST in the prototype. Signed-off-by: Jeff Brasen <jbrasen@nvidia.com> Reviewed-by: Dandan Bi <dandan.bi@intel.com>
* MdeModulePkg: Fix spelling mistake for occurredMichael D Kinney2020-08-1910-14/+14
| | | | | | | | | | REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2361 Cc: Jian J Wang <jian.j.wang@intel.com> Cc: Hao A Wu <hao.a.wu@intel.com> Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com> Reviewed-by: Guomin Jiang <guomin.jiang@intel.com> Reviewed-by: Hao A Wu <hao.a.wu@intel.com>
* MdeModulePkg/PartitionDxe: Fix the incorrect LBA size in child handerZhichao Gao2020-08-131-9/+3
| | | | | | | | | | | | | | | | | | | | | REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2843 PartitionInstallChildHandle's parameters Start and End is counted by the BlockSize, but in the implementation it uses the parent device's BlockSize to calculate the new Start, End and LastBlock. It would cause the driver report incorrect block scope and the file system would fail to be found with right block scope. So correct it to the right value. Cc: Jian J Wang <jian.j.wang@intel.com> Cc: Hao A Wu <hao.a.wu@intel.com> Cc: Ray Ni <ray.ni@intel.com> Cc: Gary Lin <glin@suse.com> Cc: Andrew Fish <afish@apple.com> Signed-off-by: Zhichao Gao <zhichao.gao@intel.com> Reviewed-by: Ray Ni <ray.ni@intel.com> Reviewed-by: Hao A Wu <hao.a.wu@intel.com> Tested-by: Gary Lin <glin@suse.com>
* MdeModulePkg/PartitionDxe: Revert changes for the special MBRZhichao Gao2020-08-131-31/+6
| | | | | | | | | | | | | | | | | | | | REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2823 Revert "MdeModulePkg/PartitionDxe: Skip the MBR that add for CD-ROM" Follow the spec definition, the ISO 9660 (and UDF) would be checked before the MBR. So it is not required to skip such MBR talbe that contian the entire block device. Cc: Jian J Wang <jian.j.wang@intel.com> Cc: Hao A Wu <hao.a.wu@intel.com> Cc: Ray Ni <ray.ni@intel.com> Cc: Gary Lin <glin@suse.com> Cc: Andrew Fish <afish@apple.com> Signed-off-by: Zhichao Gao <zhichao.gao@intel.com> Reviewed-by: Ray Ni <ray.ni@intel.com> Reviewed-by: Hao A Wu <hao.a.wu@intel.com> Tested-by: Gary Lin <glin@suse.com>
* MdeModulePkg/PartitionDxe: Put the UDF check ahead of MBRZhichao Gao2020-08-131-1/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2823 Refer to UEFI spec 2.8, Section 13.3.2, a block device should be scanned as below order: 1. GPT 2. ISO 9660 (El Torito) (UDF should aslo be here) 3. MBR 4. no partition found Note: UDF is using the same boot method as CD, so put it in the same priority with ISO 9660. This would also solve the issue that ISO image with MBR would be treat as MBR device instead of CD/DVD. That would make the behavior of the image boot different: If the CD/DVD's MBR be handled correctly, it would be enumerated as a bootable device with MBR path and FAT filesystem. Some Linux Distributions boot from such path (FAT with MBR path for ISO) would come into the grub console instead of the installation selection. With this change, the CD/DVD would always be enumerated with CD path. And it would always boot to the installation selection. Cc: Jian J Wang <jian.j.wang@intel.com> Cc: Hao A Wu <hao.a.wu@intel.com> Cc: Ray Ni <ray.ni@intel.com> Cc: Gary Lin <glin@suse.com> Cc: Andrew Fish <afish@apple.com> Signed-off-by: Zhichao Gao <zhichao.gao@intel.com> Reviewed-by: Ray Ni <ray.ni@intel.com> Reviewed-by: Hao A Wu <hao.a.wu@intel.com> Tested-by: Gary Lin <glin@suse.com>
* MdeModulePkg/BdsDxe: Fix spelling mistakeMichael D Kinney2020-08-031-1/+1
| | | | | | | | | REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2355 Cc: Zhichao Gao <zhichao.gao@intel.com> Cc: Ray Ni <ray.ni@intel.com> Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com> Reviewed-by: Zhichao Gao <zhichao.gao@intel.com>
* MdeModulePkg/EbcDxe: Fix spelling mistakeMichael D Kinney2020-08-031-1/+1
| | | | | | | | | REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2360 Cc: Jian J Wang <jian.j.wang@intel.com> Cc: Hao A Wu <hao.a.wu@intel.com> Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com> Reviewed-by: Hao A Wu <hao.a.wu@intel.com>
* MdeModulePkg/DisplayEngine: Add Debug message to show mismatch menu infoDandan Bi2020-07-161-0/+125
| | | | | | | | | | | | | | | REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2326 Currently when meet mismatch case for one-of and ordered-list menu, just show a popup window to indicate mismatch, no more info for debugging. This patch is to add more debug message about mismatch menu info which is helpful to debug. Cc: Liming Gao <liming.gao@intel.com> Cc: Eric Dong <eric.dong@intel.com> Cc: Laszlo Ersek <lersek@redhat.com> Signed-off-by: Dandan Bi <dandan.bi@intel.com> Reviewed-by: Eric Dong <eric.dong@intel.com>
* MdeModulePkg/PartitionDxe: Add already start check for child hanldesZhichao Gao2020-07-151-0/+9
| | | | | | | | | | | | | | | | | | | | | REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2823 The partition binding driver would run serval times during BDS. If the partition support MBR, it would pass the first connection in MBR partition child handler. The second connect for the same device would return already started which would be treated as not found. And it would continue to run next partition child handler check. That is incorrect behavior to do next check if one of the routine functions is passed. It may cause one device installed serval partition child handle on it. So treat the EFI_ALREADY_STARTED as EFI_SUCCESS to avoid incorrect next partition child handle check. Cc: Hao A Wu <hao.a.wu@intel.com> Cc: Ray Ni <ray.ni@intel.com> Signed-off-by: Zhichao Gao <zhichao.gao@intel.com> Reviewed-by: Hao A Wu <hao.a.wu@intel.com> Reviewed-by: Ray Ni <ray.ni@intel.com>
* MdeModulePkg/PartitionDxe: Skip the MBR that add for CD-ROMZhichao Gao2020-07-151-6/+31
| | | | | | | | | | | | | | | | | | | | | | | | REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2823 Refer to http://manpages.ubuntu.com/manpages/bionic/man8/mkudffs.8.html. Some Linux ISOs may have the MBR table for compatibility reasons for Windows. The MBR tale would contain the partition entry with start LBA0 and whole media size. There are two methods to check the filesystem in the CD-ROM: 1. MBR partition check (Windows) 2. Whole disk check (MAC OS) UEFI doesn't have the MBR check for UDF and Eltorito. But it may pass the MBR check for such table and fail to detect the filesystem of UDF. Skip the MBR check if the MBR is added for Windows compatiblity so that the partition driver can continue UDF and ElTorito check. Cc: Hao A Wu <hao.a.wu@intel.com> Cc: Ray Ni <ray.ni@intel.com> Signed-off-by: Zhichao Gao <zhichao.gao@intel.com> Reviewed-by: Ray Ni <ray.ni@intel.com>
* MdeModulePkg/PartitionDxe: Correct the MBR last block valueZhichao Gao2020-07-151-5/+8
| | | | | | | | | | | | | | | | | | REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2823 PartitionValidMbr function's second parameter should be the last sector of the device. For MBR partition, the block size is sector size, i.e. 512 bytes. The original value is media block last LBA which is counted by the media block size. And media block size is not always 512 bytes, it may be larger which would cause the MBR boundary check incorrect. The boundary check is based on the partition entry start LBA and size of LBA which are both counted by the sector number (512 bytes). Cc: Hao A Wu <hao.a.wu@intel.com> Cc: Ray Ni <ray.ni@intel.com> Signed-off-by: Zhichao Gao <zhichao.gao@intel.com> Reviewed-by: Ray Ni <ray.ni@intel.com>
* MdeModulePkg/Variable/RuntimeDxe: Fix return status from Reclaim()Michael D Kinney2020-07-141-12/+18
| | | | | | | | | | | | | | | | | | | | | REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2844 Update Reclaim() to return the error status from the reclaim operation and not the status of SynchronizeRuntimeVariableCache() that can be EFI_SUCCESS even through the status from reclaim is an error. Without this change, the return status from SetVariable() can be EFI_SUCCESS even though the variable was not actually set. This occurs if the variable store is full and a Reclaim() is invoked to free up space and even after all possible space is freed, there is still not enough room for the variable being set. This condition should return EFI_OUT_OF_RESOURCES. Cc: Hao A Wu <hao.a.wu@intel.com> Cc: Liming Gao <liming.gao@intel.com> Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com> Reviewed-by: Hao A Wu <hao.a.wu@intel.com> Reviewed-by: Jian J Wang <jian.j.wang@intel.com>
* MdeModulePkg.dec: Change PCDs for status code.Tan, Ming2020-06-186-28/+22
| | | | | | | | | | | | | | | REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2786 In order to support enable/disable report status code through memory or serial dynamic, change the following PCDs from [PcdsFeatureFlag] to [PcdsFixedAtBuild, PcdsPatchableInModule, PcdsDynamic, PcdsDynamicEx]: PcdStatusCodeUseSerial PcdStatusCodeUseMemory The original plaforms can use PcdsFixedAtBuild in .dsc files to save size. Reviewed-by: Jian J Wang <jian.j.wang@intel.com> Cc: Hao A Wu <hao.a.wu@intel.com> Signed-off-by: Ming Tan <ming.tan@intel.com>
* MdeModulePkg/StatusCodeHandler: do not output \n\r for string dataTan, Ming2020-06-173-3/+3
| | | | | | | | | | | REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2787 When output string data through serial port, will not ouput \n\r now. Caller can output several data in one line, and output \n\r when needed. Signed-off-by: Ming Tan <ming.tan@intel.com> Reviewed-by: Jian J Wang <jian.j.wang@intel.com> Reviewed-by: Eric Dong <eric.dong@intel.com>
* MdeModulePkg/SetupBrowserDxe: Do not reconnect driver with form-updateWalon Li2020-06-102-1/+9
| | | | | | | | | | | | | | | | REF:https://bugzilla.tianocore.org/show_bug.cgi?id=2701 Recording to the spec, the reconnect is activated upon exiting of the formset or the browser. Exiting is by user but form-browser internal logic. That means the reconnection is only happened when user press ESC or _EXIT action to exit form. Driver callback may update HII form dynamically so form-browser needs to refresh its internal data. It's not exiting formset for user exactly and they didn't know what happened. So use a flag to record that and do not reconnect driver if updated by callback. Signed-off-by: Walon Li <walon.li@hpe.com> Reviewed-by: Dandan Bi <dandan.bi@intel.com>
* MdeModulePkg/RegularExpressionDxe: Optimize the code infrastructureShenglei Zhang2020-05-144-49/+12
| | | | | | | | | | | | OnigurumaIntrinsics.c is now not used. So the implement of function 'memcpy' is now not., which causes build failure with CLANG9 and XCODE. I remove OnigurumaIntrinsics.c and move the necessary function implement to OnigurumaUefiPort.c/h. Cc: Jian J Wang <jian.j.wang@intel.com> Cc: Hao A Wu <hao.a.wu@intel.com> Signed-off-by: Shenglei Zhang <shenglei.zhang@intel.com> Reviewed-by: Jian J Wang <jian.j.wang@intel.com>
* MdeModulePkg/VariableSmmRuntimeDxe: switch to MM communicate 2Ard Biesheuvel2020-05-122-20/+23
| | | | | | | | | Switch to the new MM communicate 2 protocol which supports both traditional and standalone MM. Signed-off-by: Ard Biesheuvel <ard.biesheuvel@arm.com> Reviewed-by: Liming Gao <liming.gao@intel.com> Reviewed-by: Sami Mujawar <sami.mujawar@arm.com>
* MdeModulePkg/FaultTolerantWriteSmmDxe: switch to MM communicate 2Ard Biesheuvel2020-05-124-15/+18
| | | | | | | | | Switch to the new MM communicate 2 protocol which supports both traditional and standalone MM. Signed-off-by: Ard Biesheuvel <ard.biesheuvel@arm.com> Reviewed-by: Liming Gao <liming.gao@intel.com> Reviewed-by: Sami Mujawar <sami.mujawar@arm.com>
* MdeModulePkg/CapsuleRuntimeDxe: Add RISCV64 architectureAbner Chang2020-05-071-4/+5
| | | | | | | | | | | | | | | | Add RISC-V in INF for building CapsuleRuntimeDxe RISCV64 image. REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2672 Signed-off-by: Abner Chang <abner.chang@hpe.com> Co-authored-by: Gilbert Chen <gilbert.chen@hpe.com> Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org> Acked-by: Hao A Wu <hao.a.wu@intel.com> Cc: Hao A Wu <hao.a.wu@intel.com> Cc: Liming Gao <liming.gao@intel.com> Cc: Leif Lindholm <leif.lindholm@linaro.org> Cc: Gilbert Chen <gilbert.chen@hpe.com>
* MdeModulePkg/SecurityStubDxe: Mark the File parameter as OPTIONALGuomin Jiang2020-04-221-1/+1
| | | | | | | | | | | | | | REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2652 According to the description, the File is optional and can be NULL Signed-off-by: Guomin Jiang <guomin.jiang@intel.com> Cc: Jian J Wang <jian.j.wang@intel.com> Cc: Hao A Wu <hao.a.wu@intel.com> Cc: Dandan Bi <dandan.bi@intel.com> Cc: Liming Gao <liming.gao@intel.com> Reviewed-by: Jian J Wang <jian.j.wang@intel.com>
* MdeModulePkg/RamDiskDxe: Use BaseLib linked list iteration macrosMichael Kubacki2020-04-214-21/+11
| | | | | | | | | | | | | | | | | | REF:https://bugzilla.tianocore.org/show_bug.cgi?id=1959 Replaces usage of the linked list iteration macros defined in RamDiskImpl.h with the common definition in BaseLib.h. Cc: Dandan Bi <dandan.bi@intel.com> Cc: Hao A Wu <hao.a.wu@intel.com> Cc: Jian J Wang <jian.j.wang@intel.com> Cc: Liming Gao <liming.gao@intel.com> Cc: Ray Ni <ray.ni@intel.com> Cc: Sean Brogan <sean.brogan@microsoft.com> Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com> Reviewed-by: Hao A Wu <hao.a.wu@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com> Reviewed-by: Bret Barkelew <bret.barkelew@microsoft.com>
* MdeModulePkg/ReportStatusCodeRouter: Update RSC Data on reallocationMichael Kubacki2020-04-211-0/+1
| | | | | | | | | | | | | | | | | | REF:https://bugzilla.tianocore.org/show_bug.cgi?id=2670 The RSC router data buffer may be reallocated when the buffer is nearing exhaustion (7/8 portion of the buffer used). While several pointers are updated to point to the newly allocated buffer, the RscData is not updated. This commit updates the RSC data pointer to the same offset in the reallocated data buffer. Cc: Hao A Wu <hao.a.wu@intel.com> Cc: Jian J Wang <jian.j.wang@intel.com> Cc: Kun Qin <Kun.Qin@microsoft.com> Cc: Liming Gao <liming.gao@intel.com> Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com> Reviewed-by: Dandan Bi <dandan.bi@intel.com>
* MdeModulePkg/ReportStatusCodeRouter: Take HeaderSize into ConsiderationMichael Kubacki2020-04-211-2/+2
| | | | | | | | | | | | | | | | REF:https://bugzilla.tianocore.org/show_bug.cgi?id=2669 Updates ReportDispatcher() to take the size in the HeaderSize field in a EFI_STATUS_CODE_DATA element into account when walking the data buffer. This size will cause the header size to differ from the compiled sizeof header. Cc: Hao A Wu <hao.a.wu@intel.com> Cc: Jian J Wang <jian.j.wang@intel.com> Cc: Kun Qin <Kun.Qin@microsoft.com> Cc: Liming Gao <liming.gao@intel.com> Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com> Reviewed-by: Dandan Bi <dandan.bi@intel.com>
* MdeModulePkg/ReportStatusCodeRouter: Revert end pointer on out of resourcesMichael Kubacki2020-04-211-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | REF:https://bugzilla.tianocore.org/show_bug.cgi?id=2665 ReportDispatcher() is called by a software module to report a status code. The interface is generic and can be called frequently throughout the boot under various conditions. A certain set of conditions can cause the currently implemented algorithm for resource exhaustion to fail. A sample scenario: 1. ReportStatusCode() is called at a TPL higher than one of the registered status code listeners making the call to the listener deferred until TPL is lowered. 2. Additional calls to ReportStatusCode() occur, so the data buffer continues to expand. 3. A call to ReportStatusCode() is made from within a memory allocation call (e.g. CoreAllocatePoolPages ()) which is protected from re- entrancy with mPoolMemoryLock. This will cause the ReallocatePool() call in ReportDispatcher() to fail. Because the end pointer was already moved to account for the data size, the end pointer is now moved beyond the buffer and invalid. This commit saves the original end pointer value into a local variable called "FailSafeEndPointer" which tracks a safe end pointer to revert to in the case the allocated buffer size (CallbackEntry->EndPointer - CallbackEntry->StatusCodeDataBuffer) is still not large enough for the data. Cc: Hao A Wu <hao.a.wu@intel.com> Cc: Jian J Wang <jian.j.wang@intel.com> Cc: Kun Qin <Kun.Qin@microsoft.com> Cc: Liming Gao <liming.gao@intel.com> Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com> Reviewed-by: Dandan Bi <dandan.bi@intel.com>
* MdeModulePkg/ReportStatusCodeRouter: Clear RSC Data buffer if Data is NULLMichael Kubacki2020-04-211-0/+4
| | | | | | | | | | | | | | | | REF:https://bugzilla.tianocore.org/show_bug.cgi?id=1969 ReportDispatcher() may be invoked with a NULL Data argument. When TPL is less than TPL_HIGH_LEVEL and Data is NULL, the EFI_STATUS_CODE_DATA structure inside RscData should be cleared so listeners will not receive data from a previous operation. Cc: Hao A Wu <hao.a.wu@intel.com> Cc: Jian J Wang <jian.j.wang@intel.com> Cc: Kun Qin <Kun.Qin@microsoft.com> Cc: Liming Gao <liming.gao@intel.com> Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com> Reviewed-by: Dandan Bi <dandan.bi@intel.com>
* MdeModulePkg/RegularExpressionDxe: Make oniguruma a submodule in edk2.Shenglei Zhang2020-04-1348-75747/+232
| | | | | | | | | | | | Use submodule way to access oniguruma. And upgrade oniguruma version from v6.9.3 to v6.9.4_mark1. REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2073 Cc: Jian J Wang <jian.j.wang@intel.com> Cc: Hao A Wu <hao.a.wu@intel.com> Cc: Liming Gao <liming.gao@intel.com> Signed-off-by: Shenglei Zhang <shenglei.zhang@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>