summaryrefslogtreecommitdiffstats
path: root/MdeModulePkg/Universal
Commit message (Collapse)AuthorAgeFilesLines
...
* MdeModulePkg/Network: Typo fixJiaxin Wu2017-06-142-5/+5
| | | | | | | | | | | warter -> water Maunual -> Manual Cc: Ye Ting <ting.ye@intel.com> Cc: Fu Siyuan <siyuan.fu@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Wu Jiaxin <jiaxin.wu@intel.com> Reviewed-by: Fu Siyuan <siyuan.fu@intel.com>
* MdeModulePkg/UefiPxeBcDxe: Refine the PXE boot displayed informationJiaxin Wu2017-06-053-2/+54
| | | | | | | | | | | | This path is to refine the PXE boot displayed information so as to in line with NetworkPkg/UefiPxeBcDxe driver. Cc: Ye Ting <ting.ye@intel.com> Cc: Fu Siyuan <siyuan.fu@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Wu Jiaxin <jiaxin.wu@intel.com> Reviewed-by: Ye Ting <ting.ye@intel.com> Reviewed-by: Fu Siyuan <siyuan.fu@intel.com>
* MdeModulePkg/UefiPxeBcDxe: Fix the PXE BootMenu selection issueJiaxin Wu2017-06-051-3/+3
| | | | | | | | | | | | | Currently implementation doesn't accept the input during the user is trying to select the PXE BootMenu from option 43. This path is to fix that problem. Cc: Ye Ting <ting.ye@intel.com> Cc: Fu Siyuan <siyuan.fu@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Wu Jiaxin <jiaxin.wu@intel.com> Reviewed-by: Ye Ting <ting.ye@intel.com> Reviewed-by: Fu Siyuan <siyuan.fu@intel.com>
* MdeModulePkg/MnpDxe: Fix EBC build hang issue.Fu Siyuan2017-06-021-2/+2
| | | | | | Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Dandan Bi <dandan.bi@intel.com> Reviewed-by: Fu Siyuan <siyuan.fu@intel.com>
* MdeModulePkg/DebugSupportDxe: Fix XCODE5 build failureMichael Kinney2017-05-241-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | https://bugzilla.tianocore.org/show_bug.cgi?id=572 Update X64 AsmFuncs.S to resolve a build failure using the XCODE5 tool chain. This change updates AsmFuncs.S to match AsmFuncs.asm and AsmFuncs.nasm. The error generated in XCODE5 build is: error: invalid instruction mnemonic 'movzxw' movzxw 8(%rax), %rax ^~~~~~ The correct instruction is movzwq 8(%rax), %rax Cc: Star Zeng <star.zeng@intel.com> Cc: Eric Dong <eric.dong@intel.com> Cc: Andrew Fish <afish@apple.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com> Reviewed-by: Andrew Fish <afish@apple.com> Reviewed-by: Star Zeng <star.zeng@intel.com>
* MdeModulePkg/RegularExpressionDxe: Fix XCODE5 build failureMichael Kinney2017-05-241-1/+1
| | | | | | | | | | | | | | | | https://bugzilla.tianocore.org/show_bug.cgi?id=572 The ErrorMessage local variable in OnigurumaMatch() should be type OnigUChar instead of type CHAR8. This resolves a build failure with the XCODE5 tool chain. Cc: Andrew Fish <afish@apple.com> Cc: Star Zeng <star.zeng@intel.com> Cc: Eric Dong <eric.dong@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com> Reviewed-by: Andrew Fish <afish@apple.com> Reviewed-by: Star Zeng <star.zeng@intel.com>
* MdeModulePkg PCD: Fix TmpTokenSpaceBufferCount not assigned correctlyStar Zeng2017-05-191-0/+1
| | | | | | | | | | | | | | | When DynamicEx PCD is only used in PEI code, but not DXE code, current implementation of DxePcdGetNextTokenSpace does not assign TmpTokenSpaceBufferCount correctly, but leaves it as initial value, then DxePcdGetNextTokenSpace may return incorrect token space guid and status. This patch is to fix this issue. Cc: Liming Gao <liming.gao@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Star Zeng <star.zeng@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
* MdeModulePkg/FormDisplay: Make the LineWidth of option consistentDandan Bi2017-05-111-1/+1
| | | | | | | | | | | | | REF: https://bugzilla.tianocore.org/show_bug.cgi?id=529 LineWidth of option in funcrion UpdateSkipInfoForMenu and DisplayOneMenu are inconsistent. Now fix this issue to avoid incorrect UI display. Cc: Eric Dong <eric.dong@intel.com> Cc: Liming Gao <liming.gao@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Dandan Bi <dandan.bi@intel.com> Reviewed-by: Eric Dong <eric.dong@intel.com>
* MdeModulePkg: Addressing TCP Window Retraction when window scale factor is used.Fu Siyuan2017-05-093-11/+44
| | | | | | | | | | | | | The RFC1323 which defines the TCP window scale option has been obsoleted by RFC7323. This patch is to follow the RFC7323 to address the TCP window retraction problem when a non-zero scale factor is used. The changes has been test in high packet loss rate network by using HTTP boot and iSCSI file read/write. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Fu Siyuan <siyuan.fu@intel.com> Reviewed-by: Wu Jiaxin <jiaxin.wu@intel.com> Reviewed-by: Ye Ting <ting.ye@intel.com>
* MdeModulePkg: Add wnd scale check before shrinking window.Fu Siyuan2017-05-091-5/+24
| | | | | | | | | | | Moving Right window edge to the left on sender side without additional check can lead to the TCP deadlock, when receiver ACKs proper segment, while sender discards it for future ACK. To prevent this add check if usable window (or shrink amount in this case) is bigger then receiver's window scale factor. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Andrey Tepin <atepin@kraftway.ru> Reviewed-by: Fu Siyuan <siyuan.fu@intel.com>
* MdeModulePkg: Fix issue the iSCSI client can not send reset packet correctly.Zhang, Lubo2017-05-021-9/+9
| | | | | | | | | | | | | | | if we already established a iSCSI connection from initiator to target based on IPv4 stack, after using reconnect -r command, we can not rebuild the session with the windows target, since the server thought the session is still exist. This issue is caused by wrong place of acquire ownership of sock lock which lead the iSCSI can not reset the connection correctly. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Zhang Lubo <lubo.zhang@intel.com> Cc: Wu Jiaxin <jiaxin.wu@intel.com> Cc: Ye Ting <ting.ye@intel.com> Cc: Fu Siyuan <siyuan.fu@intel.com> Reviewed-by: Wu Jiaxin <jiaxin.wu@intel.com>
* MdeModulePkg/Ip4Dxe: Refine the IPv4 configuration help infoJiaxin Wu2017-04-252-3/+4
| | | | | | | | | | | | | | Below value indicate whether network address configured successfully or not: Network Device List->MAC->IPv4 Network Configuration->Configured. This patch is to refine its help info. Cc: Ye Ting <ting.ye@intel.com> Cc: Fu Siyuan <siyuan.fu@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Wu Jiaxin <jiaxin.wu@intel.com> Reviewed-by: Ye Ting <ting.ye@intel.com>
* MdeModulePkg/Mtftp4Dxe: Add invalid ServerIp check during MTFTP configurationJiaxin Wu2017-04-211-1/+5
| | | | | | | | | Cc: Ye Ting <ting.ye@intel.com> Cc: Fu Siyuan <siyuan.fu@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Wu Jiaxin <jiaxin.wu@intel.com> Reviewed-by: Ye Ting <ting.ye@intel.com> Reviewed-by: Fu Siyuan <siyuan.fu@intel.com>
* MdeModulePkg/Ip4Dxe: Fix the incorrect RemoveEntryListJiaxin Wu2017-04-211-2/+2
| | | | | | | | | | | Cc: Subramanian Sriram <sriram-s@hpe.com> Cc: Ye Ting <ting.ye@intel.com> Cc: Fu Siyuan <siyuan.fu@intel.com> Cc: Zhang Lubo <lubo.zhang@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Wu Jiaxin <jiaxin.wu@intel.com> Reviewed-by: Zhang Lubo <lubo.zhang@intel.com> Reviewed-by: Sriram Subramanian <sriram-s@hpe.com>
* MdeModulePkg/FirmwarePerformanceDxe: Error Level is not used correctlyJeff Fan2017-04-211-2/+2
| | | | | | | | Cc: Feng Tian <feng.tian@intel.com> Cc: Star Zeng <star.zeng@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jeff Fan <jeff.fan@intel.com> Reviewed-by: Star Zeng <star.zeng@intel.com>
* MdeModulePkg/TerminalDxe: Avoid always append device path to *DevRuiyu Ni2017-04-201-8/+59
| | | | | | | | | | | When TerminalDxe Start() is called multiple times, the old logic unconditionally appended the terminal device path candidates to *Dev (ConInDev/ConOutDev/ErrOutDev), resulting the volatile storage is full. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com> Reviewed-by: Star Zeng <star.zeng@intel.com>
* MdeModulePkg/HiiDB: Avoid incorrect results of multiplicationDandan Bi2017-04-181-12/+12
| | | | | | | | | | | | | | | | | | | | | | | An example: The codes in function Output8bitPixel in Image.c: OffsetY = BITMAP_LEN_8_BIT ((UINT32) Image->Width, Ypos); Both Image->Width and Ypos are of type UINT16. They will be promoted to int (signed) first, and then perform the multiplication defined by macro BITMAP_LEN_8_BIT. If the result of multiplication between Image->Width and Ypos exceeds the range of type int, a potential incorrect results will be assigned to OffsetY. This commit adds explicit UINT32 type cast for 'Image->Width' to avoid possible overflow in the int range. And also fix similar issues in HiiDatabase. Cc: Eric Dong <eric.dong@intel.com> Cc: Liming Gao <liming.gao@intel.com> Cc: Hao Wu <hao.a.wu@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Dandan Bi <dandan.bi@intel.com> Reviewed-by: Hao Wu <hao.a.wu@intel.com>
* MdeModulePkg: Error Level is not used correctlyJeff Fan2017-04-127-18/+18
| | | | | | | Cc: Feng Tian <feng.tian@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jeff Fan <jeff.fan@intel.com> Reviewed-by: Feng Tian <feng.tian@intel.com>
* MdeModulePkg RegularExpressionDxe: Remove GCC -fno-builtin optionLiming Gao2017-04-071-1/+0
| | | | | | | | | | | GCC -fno-builtin option is added into tools_def.template at 90defe7198a42b3157ae5d9b93714f891cf06e57. So, there is no need to set it in module INF file. Cc: Star Zeng <star.zeng@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Liming Gao <liming.gao@intel.com> Reviewed-by: Star Zeng <star.zeng@intel.com>
* MdeModulePkg: Remove unsupported PcdExpression usage in module INFLiming Gao2017-04-062-4/+4
| | | | | | | | | | | | | https://bugzilla.tianocore.org/show_bug.cgi?id=442 PcdExpression used in INF to control PCD and Source is unsupported feature. Current sample usage in module INF brings confuse. Cc: Feng Tian <feng.tian@intel.com> Cc: Star Zeng <star.zeng@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Liming Gao <liming.gao@intel.com> Reviewed-by: Star Zeng <star.zeng@intel.com>
* MdeModulePkg/Network: Fix potential ASSERT if NetIp4IsUnicast is calledJiaxin Wu2017-03-235-12/+16
| | | | | | | | | | | | | Cc: Hegde Nagaraj P <nagaraj-p.hegde@hpe.com> Cc: Subramanian Sriram <sriram-s@hpe.com> Cc: Zhang Lubo <lubo.zhang@intel.com> Cc: Ye Ting <ting.ye@intel.com> Cc: Fu Siyuan <siyuan.fu@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Wu Jiaxin <jiaxin.wu@intel.com> Reviewed-by: Hegde Nagaraj P <nagaraj-p.hegde@hpe.com> Reviewed-by: Ye Ting <ting.ye@intel.com> Reviewed-by: Sriram Subramanian <sriram-s@hpe.com>
* MdeModulePkg/BootGraphicsResourceTableDxe: don't allocate below 4 GBArd Biesheuvel2017-03-211-38/+3
| | | | | | | | | | | | | | | The BGRT table has an 8 byte field for the memory address of the image data, and yet the driver explicitly allocates below 4 GB. This results in an ASSERT() on systems that do not have any memory below 4 GB to begin with. Since neither the PI, the UEFI or the ACPI spec contain any mention of why this data should reside below 4 GB, replace the allocation call with an ordinary AllocatePages() call. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Liming Gao <liming.gao@intel.com>
* MdeModulePkg/AcpiTableDxe: consider version mask when removing tablesArd Biesheuvel2017-03-211-2/+5
| | | | | | | | | | | | | | | | | | | Invocations of EFI_ACPI_TABLE_PROTOCOL::UninstallAcpiTable() may result in a crash when the value of PcdAcpiExposedTableVersions does not include EFI_ACPI_TABLE_VERSION_1_0B. The reason is that EFI_ACPI_TABLE_PROTOCOL::InstallAcpiTable() will only populate the Rsdt1/Rsdt3 pointers when EFI_ACPI_TABLE_VERSION_1_0B is set, whereas EFI_ACPI_TABLE_PROTOCOL::UninstallAcpiTable() will invoke PublishTables with EFI_ACPI_TABLE_VERSION_1_0B alawys set, resulting in a NULL pointer dereference of the Rsdt1/Rsdt3 pointers. So take PcdAcpiExposedTableVersions into account for UninstallAcpiTable as well. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Star Zeng <star.zeng@intel.com>
* MdeModulePkg/RamDiskDxe: fix C string literal catenation in info messagesLaszlo Ersek2017-03-201-2/+2
| | | | | | | | | | | | | | | | | | | | | | RamDiskDxe installs the RamDiskAcpiCheck() Ready To Boot callback function. If EFI_ACPI_TABLE_PROTOCOL and/or EFI_ACPI_SDT_PROTOCOL are not found, then informational messages are logged, and the RAM disks are not published to the (nonexistent) NFIT table. The logic is fine, but the info messages are not concatenated correctly from multiple string literals -- the second parts are passed as (unused) arguments to DEBUG(). Fix the typos. Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org> Cc: Feng Tian <feng.tian@intel.com> Cc: Hao Wu <hao.a.wu@intel.com> Cc: Leif Lindholm <leif.lindholm@linaro.org> Cc: Star Zeng <star.zeng@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Feng Tian <feng.tian@intel.com> Reviewed-by: Hao Wu <hao.a.wu@intel.com> Reviewed-by: Star Zeng <star.zeng@intel.com>
* MdeModulePkg/AcpiTableDxe: Not make FADT.{DSDT,X_DSDT} mutual exclusionStar Zeng2017-03-171-54/+34
| | | | | | | | | | | | | | | | | | | 198a46d768fb90d2f9b16e26451b4814e7469eaf improved the DSDT and X_DSDT fields mutual exclusion by checking FADT revision, but that breaks some OS that has assumption to only consume X_DSDT field even the DSDT address is < 4G. To have better compatibility, this patch is to update the code to not make FADT.{DSDT,X_DSDT} mutual exclusion, but always set both DSDT and X_DSDT fields in the FADT when the DSDT address is < 4G. Cc: Laszlo Ersek <lersek@redhat.com> Cc: Jeff Fan <jeff.fan@intel.com> Cc: Jiewen Yao <jiewen.yao@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Star Zeng <star.zeng@intel.com> Reviewed-by: Laszlo Ersek <lersek@redhat.com> Tested-by: Jeff Fan <jeff.fan@intel.com>
* MdeModulePkg/ConPlatform: Support GOP created as PCI's grandsonRuiyu Ni2017-03-173-41/+9
| | | | | | | | | | | | | | | | | | | The original logic assumes GOP hande is son of PCI handle but it is not always true. Below wordings are from UEFI Spec: If a graphics device supports multiple frame buffers, then handles for the frame buffers must be created first, and then the handles for the video output devices can be created as children of the frame buffer handles. So the GOP handle could be grandson of the PCI handle. EfiBootManagerGetGopDevicePath(VideoController) is used to fix this bug. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com> Reviewed-by: Jeff Fan <jeff.fan@intel.com>
* MdeModulePkg: Fix service binding issue in TCP4 and Ip4 dxe.Zhang Lubo2017-03-177-77/+96
| | | | | | | | | | | | | | | | | | | | | | | | | v2: Handle error case in SockCreateChild and fix typo issue when we destroy the socket Sock and its associated protocol control block, we need to first close the parent protocol, then remove the protocol from childHandle and last to free any data structures that allocated in CreateChild. But currently, we free the socket data (Socket ConfigureState) before removing the protocol form the childhandle. So if the up layer want to send the tcp reset packet in it's driver binding stop function, it will failed. The IpInstance destroy state is redundant and may cause ip transmit failed if up layer want to send ip packet. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Zhang Lubo <lubo.zhang@intel.com> Cc: Wu Jiaxin <jiaxin.wu@intel.com> Cc: Ye Ting <ting.ye@intel.com> Cc: Fu Siyuan <siyuan.fu@intel.com> Reviewed-by: Ye Ting <ting.ye@intel.com> Reviewed-by: Fu Siyuan <siyuan.fu@intel.com> Reviewed-by: Wu Jiaxin <jiaxin.wu@intel.com>
* MdeModulePkg/Ip4Dxe: Add Ip/Netmask pair check for Ip4Config2Jiaxin Wu2017-03-175-71/+94
| | | | | | | | | | | | | | | | | | | v2: * Add the check in Ip4Config2SetDefaultIf to avoid the DHCP configuration case. Ip4config2 doesn't check the validity of Ip/Netmask pair, which leads to the invalid combination of Ip and Netmask setting. This patch is to resolve the issue. Cc: Hegde Nagaraj P <nagaraj-p.hegde@hpe.com> Cc: Subramanian Sriram <sriram-s@hpe.com> Cc: Ye Ting <ting.ye@intel.com> Cc: Fu Siyuan <siyuan.fu@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Wu Jiaxin <jiaxin.wu@intel.com> Reviewed-by: Sriram Subramanian <sriram-s@hpe.com> Reviewed-by: Hegde Nagaraj P <nagaraj-p.hegde@hpe.com>
* MdeModulePkg PCD: Allow SkuId to be changed only onceStar Zeng2017-03-162-8/+47
| | | | | | | | | | | | | | | | | | | | | | Current PI spec has no clear description about whether the SkuId could be changed multiple times or not during one boot. If the SkuId could be changed multiple times during one boot, different modules may get inconsistent PCD values. And DynamicHii PCD maps to UEFI variable, once one DynamicHii PCD(UEFI variable) is set for one SkuId, then the PCD value will be always from UEFI variable but not PCD database, even the SkuId is set to other value. This patch is to update PCD drivers to allow SkuId to be changed only once during one boot. Cc: Liming Gao <liming.gao@intel.com> Cc: Michael Kinney <michael.d.kinney@intel.com> Cc: Feng Tian <feng.tian@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Star Zeng <star.zeng@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
* MdeModulePkg/AcpiTableDxe: improve FADT.{DSDT,X_DSDT} mutual exclusionLaszlo Ersek2017-03-091-3/+59
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The ACPI specification, up to and including revision 5.1 Errata A, allows the DSDT and X_DSDT fields to be both set in the FADT. (Obviously, this only makes sense if the DSDT address is representable in 4 bytes.) Starting with 5.1 Errata B, specifically for Mantis 1393 <https://mantis.uefi.org/mantis/view.php?id=1393>, the spec requires at most one of DSDT and X_DSDT to be set to a nonzero value. MdeModulePkg/AcpiTableDxe handles this mutual exclusion somewhat inconsistently. - If the caller of EFI_ACPI_TABLE_PROTOCOL.InstallAcpiTable() installs the tables in "DSDT, FADT" order, then we enforce the exclusion between the DSDT and X_DSDT fields: DSDT under 4GB FADT.DSDT FADT.X_DSDT [VARIANT B] -------------- --------- ----------- yes set clear no clear set This behavior conforms to 5.1 Errata B. (And it's not required by earlier versions of the spec.) - If the caller passes in the tables in "FADT, DSDT" relative order, then we do not enforce the exclusion: DSDT under 4GB FADT.DSDT FADT.X_DSDT [VARIANT A] -------------- --------- ----------- yes set set no clear set This satisfies 5.1 Errata A and earlier, but breaks 5.1 Errata B and later. Unify the handling of both relative orders. In particular, check the major and minor version numbers in the FADT. If the FADT version is strictly before 5.1, then implement [VARIANT A]. If the FADT version is equal to or larger than 5.1, then implement [VARIANT B]. We make three observations: - We can't check the FADT table version precisely against "5.1 Errata B"; erratum levels are not captured in the table. We err in the safe direction, namely we enforce the exclusion for "5.1" and "5.1 Errata A". - The same applies to "6.0" versus "6.0 Errata A". Because we cannot distinguish these two, we consider "6.0" to be "equal to or larger than 5.1", and apply [VARIANT B], enforcing the exclusion. - While a blanket [VARIANT B] would be simpler, there is a significant benefit to [VARIANT A], under the spec versions that permit it: compatibility with a wider range of OSPMs (typically, older ones). For example, Igor reported about a "DELL R430 system with rev4 FADT where DSDT and X_DSDT are pointing to the same address". Michael also reported about several systems that exhibit the same. Regression tested with the following KVM guests (QEMU built at ata0def594286d, "Merge remote-tracking branch 'remotes/bonzini/tags/for-upstream' into staging", 2017-01-30): - OVMF: boot and S3 suspend/resume - Ia32, Q35, SMM - Fedlet 20141209 - Ia32X64, Q35, SMM - Fedora 22 - Windows 7 - Windows 8.1 - Windows 10 - Windows Server 2008 R2 - Windows Server 2012 R2 - Windows Server 2016 Tech Preview 4 - X64, I440FX, no SMM - Fedora 24 - RHEL-6.7 - RHEL-7.2-ish - ArmVirtQemu: boot test with virtio-gpu - AARCH64 - Fedora 24 - RHELSA-7.3 - openSUSE Tumbleweed (4.8.4-based) This change is connected to ASWG ticket <https://mantis.uefi.org/mantis/view.php?id=1757>, which is now closed/fixed. Cc: Al Stone <ahs3@redhat.com> Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org> Cc: Feng Tian <feng.tian@intel.com> Cc: Igor Mammedov <imammedo@redhat.com> Cc: Jiewen Yao <jiewen.yao@intel.com> Cc: Leo Duran <leo.duran@amd.com> Cc: Michael Tsirkin <mtsirkin@redhat.com> Cc: Phil Dennis-Jordan <phil@philjordan.eu> Cc: Star Zeng <star.zeng@intel.com> Reported-by: Phil Dennis-Jordan <phil@philjordan.eu> Suggested-by: Igor Mammedov <imammedo@redhat.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Phil Dennis-Jordan <phil@philjordan.eu> Reviewed-by: Jiewen Yao <jiewen.yao@intel.com> Reviewed-by: Star Zeng <star.zeng@intel.com>
* MdeModulePkg/AcpiTableDxe: condense whitespace around FADT.{DSDT,X_DSDT}Laszlo Ersek2017-03-091-14/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch incurs no functional changes, it just removes some whitespace, and also makes sure we always assign AcpiTableInstance->Fadt3->Dsdt first, and AcpiTableInstance->Fadt3->XDsdt second. The goal is to separate the syntactic changes from the functional changes implemented by the next patch. Cc: Al Stone <ahs3@redhat.com> Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org> Cc: Feng Tian <feng.tian@intel.com> Cc: Igor Mammedov <imammedo@redhat.com> Cc: Jiewen Yao <jiewen.yao@intel.com> Cc: Leo Duran <leo.duran@amd.com> Cc: Michael Tsirkin <mtsirkin@redhat.com> Cc: Phil Dennis-Jordan <phil@philjordan.eu> Cc: Star Zeng <star.zeng@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Thomas Huth <thuth@redhat.com> Reviewed-by: Feng Tian <feng.tian@intel.com> Reviewed-by: Jiewen Yao <jiewen.yao@intel.com> Reviewed-by: Star Zeng <star.zeng@intel.com>
* MdeModulePkg: Refine casting expression result to bigger sizeHao Wu2017-03-0612-41/+41
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There are cases that the operands of an expression are all with rank less than UINT64/INT64 and the result of the expression is explicitly cast to UINT64/INT64 to fit the target size. An example will be: UINT32 a,b; // a and b can be any unsigned int type with rank less than UINT64, like // UINT8, UINT16, etc. UINT64 c; c = (UINT64) (a + b); Some static code checkers may warn that the expression result might overflow within the rank of "int" (integer promotions) and the result is then cast to a bigger size. The commit refines codes by the following rules: 1). When the expression is possible to overflow the range of unsigned int/ int: c = (UINT64)a + b; 2). When the expression will not overflow within the rank of "int", remove the explicit type casts: c = a + b; 3). When the expression will be cast to pointer of possible greater size: UINT32 a,b; VOID *c; c = (VOID *)(UINTN)(a + b); --> c = (VOID *)((UINTN)a + b); 4). When one side of a comparison expression contains only operands with rank less than UINT32: UINT8 a; UINT16 b; UINTN c; if ((UINTN)(a + b) > c) {...} --> if (((UINT32)a + b) > c) {...} For rule 4), if we remove the 'UINTN' type cast like: if (a + b > c) {...} The VS compiler will complain with warning C4018 (signed/unsigned mismatch, level 3 warning) due to promoting 'a + b' to type 'int'. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Hao Wu <hao.a.wu@intel.com> Reviewed-by: Feng Tian <feng.tian@intel.com>
* MdeModulePkg: Refine type cast for pointer subtractionHao Wu2017-03-064-11/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | For pointer subtraction, the result is of type "ptrdiff_t". According to the C11 standard (Committee Draft - April 12, 2011): "When two pointers are subtracted, both shall point to elements of the same array object, or one past the last element of the array object; the result is the difference of the subscripts of the two array elements. The size of the result is implementation-defined, and its type (a signed integer type) is ptrdiff_t defined in the <stddef.h> header. If the result is not representable in an object of that type, the behavior is undefined." In our codes, there are cases that the pointer subtraction is not performed by pointers to elements of the same array object. This might lead to potential issues, since the behavior is undefined according to C11 standard. Also, since the size of type "ptrdiff_t" is implementation-defined. Some static code checkers may warn that the pointer subtraction might underflow first and then being cast to a bigger size. For example: UINT8 *Ptr1, *Ptr2; UINTN PtrDiff; ... PtrDiff = (UINTN) (Ptr1 - Ptr2); The commit will refine the pointer subtraction expressions by casting each pointer to UINTN first and then perform the subtraction: PtrDiff = (UINTN) Ptr1 - (UINTN) Ptr2; Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Hao Wu <hao.a.wu@intel.com> Acked-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Feng Tian <feng.tian@intel.com>
* MdeModulePkg: Variable: Update DBT PCR[7] measureZhang, Chao B2017-03-061-2/+11
| | | | | | | | | | | | | | Measure DBT into PCR[7] when it is updated between initial measure if present and not empty. by following TCG PC Client PFP 00.49 Previous patch for PCR[7] DBT part is overrode. dc9bd6ed281fcba5358f3004632bdbda968be1e5 Cc: Star Zeng <star.zeng@intel.com> Cc: Yao Jiewen <jiewen.yao@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Chao Zhang <chao.b.zhang@intel.com> Reviewed-by: Star Zeng <star.zeng@intel.com> Reviewed-by: Yao Jiewen <jiewen.yao@intel.com>
* MdeModulePkg/PrintDxe: Handle the deprecation of [A|U]ValueToStringHao Wu2017-03-021-2/+90
| | | | | | | | | | | | | | | To handle the deprecation of PrintLib APIs UnicodeValueToString and AsciiValueToString by subsequent commits, the commit refines the logic for the implemetation of the UnicodeValueToString and AsciiValueToString services in EFI_PRINT2_PROTOCOL. When the macro DISABLE_NEW_DEPRECATED_INTERFACES is defined (indicating the deprecation of the PrintLib APIs), the above two services will ASSERT and will return zero to reflect not being supported. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Hao Wu <hao.a.wu@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
* MdeModulePkg: Replace [Ascii|Unicode]ValueToStringHao Wu2017-03-029-39/+167
| | | | | | | | | | It is the follow up of commits 51f0ceb..9e32e97 to replace AsciiValueToString/UnicodeValueToString with AsciiValueToStringS/UnicodeValueToStringS. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Hao Wu <hao.a.wu@intel.com> Reviewed-by: Star Zeng <star.zeng@intel.com>
* MdeModulePkg/Universal/Acpi/BootScriptExecutorDxe: Add support for PCD ↵Leo Duran2017-03-014-6/+23
| | | | | | | | | | | | | | | | | | | | | | PcdPteMemoryEncryptionAddressOrMask This PCD holds the address mask for page table entries when memory encryption is enabled on AMD processors supporting the Secure Encrypted Virtualization (SEV) feature. This module updates the under-4GB page tables configured by the S3-Resume code in UefiCpuPkg/Universal/Acpi/S3Resume2Pei. The mask is saved at module start (ScriptExecute.c), and applied when tables are expanded on-demand by page-faults above 4GB's (SetIdtEntry.c). CC: Jeff Fan <jeff.fan@intel.com> Cc: Feng Tian <feng.tian@intel.com> Cc: Star Zeng <star.zeng@intel.com> Cc: Laszlo Ersek <lersek@redhat.com> Cc: Brijesh Singh <brijesh.singh@amd.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Leo Duran <leo.duran@amd.com> Reviewed-by: Star Zeng <star.zeng@intel.com>
* MdeModulePkg/Universal/CapsulePei: Add support for PCD ↵Leo Duran2017-03-014-11/+37
| | | | | | | | | | | | | | | | | | | PcdPteMemoryEncryptionAddressOrMask This PCD holds the address mask for page table entries when memory encryption is enabled on AMD processors supporting the Secure Encrypted Virtualization (SEV) feature. The mask is applied when 4GB tables are created (UefiCapsule.c), and when the tables are expanded on-demand by page-faults above 4GB's (X64Entry.c). Cc: Feng Tian <feng.tian@intel.com> Cc: Star Zeng <star.zeng@intel.com> Cc: Laszlo Ersek <lersek@redhat.com> Cc: Brijesh Singh <brijesh.singh@amd.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Leo Duran <leo.duran@amd.com> Reviewed-by: Star Zeng <star.zeng@intel.com>
* MdeModulePkg/EbcDxe: use EfiBootServicesCode memory for thunksArd Biesheuvel2017-02-286-4/+41
| | | | | | | | | | | | | | | | | | | | The EBC driver emits thunks for native to EBC calls, which are short instructions sequences that bridge the gap between the native execution environment and the EBC virtual machine. Since these thunks are allocated using MemoryAllocationLib::AllocatePool(), they are emitted into EfiBootServicesData regions, which does not reflect the nature of these thunks accurately, and interferes with strict memory protection policies that map data regions non-executable. So instead, create a new helper EbcAllocatePoolForThunk() that invokes the AllocatePool() boot service directly to allocate EfiBootServicesCode pool memory explicitly, and wire up this helper for the various architecture specific thunk generation routines. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
* MdeModulePkg/Ip4Dxe: Ignore duplicated DNS address checkJiaxin Wu2017-02-271-10/+0
| | | | | | | | | | | | | | | | | Having duplicated DNS server IPs specified is not an ideal configuration, but not an error condition. This patch is to remove the duplicated DNS address check to allow the same DNS address setting in SetData(). Cc: Hegde Nagaraj P <nagaraj-p.hegde@hpe.com> Cc: Subramanian Sriram <sriram-s@hpe.com> Cc: Ye Ting <ting.ye@intel.com> Cc: Fu Siyuan <siyuan.fu@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Wu Jiaxin <jiaxin.wu@intel.com> Reviewed-by: Subramanian Sriram <sriram-s@hpe.com> Reviewed-by: Hegde Nagaraj P <nagaraj-p.hegde@hpe.com> Tested-by: Hegde Nagaraj P <nagaraj-p.hegde@hpe.com>
* MdeModulePkg: Update the Ethernet interface name.Zhang Lubo2017-02-231-1/+1
| | | | | | | | | | | | | | | Update the interface name from ethA ethB to eth10, eth11 etc if port number more than 9. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Zhang Lubo <lubo.zhang@intel.com> Cc: Sriram Subramanian <sriram-s@hpe.com> Cc: Ye Ting <ting.ye@intel.com> Cc: Fu Siyuan <siyuan.fu@intel.com> Cc: Wu Jiaxin <jiaxin.wu@intel.com> Reviewed-by: Sriram Subramanian <sriram-s@hpe.com> Reviewed-by: Wu Jiaxin <jiaxin.wu@intel.com> Reviewed-by: Fu Siyuan <siyuan.fu@intel.com>
* MdeModulePkg/HiiDatabase: clean the value before setting default stringDandan Bi2017-02-211-2/+15
| | | | | | | | | | | | | | For string op-code, the default string may not reach the maximum size, so when generating <AltResp> string, we should clean the value before setting the default string. https://bugzilla.tianocore.org/show_bug.cgi?id=375 Cc: Eric Dong <eric.dong@intel.com> Cc: Liming Gao <liming.gao@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Dandan Bi <dandan.bi@intel.com> Reviewed-by: Eric Dong <eric.dong@intel.com>
* MdeMoudlePkg/DisplayEngine: Fix incorrect index used in array "InputText"Dandan Bi2017-02-211-15/+18
| | | | | | | | | | | | | | | | When set value to the array "InputText", the index was used incorrectly. And the array "InputText" is not initialized. These will cause some value in the array is random, so it will be shown incorrectly sometimes. This patch is to fix this issue. https://bugzilla.tianocore.org/show_bug.cgi?id=358 Cc: Eric Dong <eric.dong@intel.com> Cc: Liming Gao <liming.gao@intel.com> Cc: Wang Cloud <winggundum82@163.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Dandan Bi <dandan.bi@intel.com> Reviewed-by: Eric Dong <eric.dong@intel.com>
* MdeModulePkg: Add the EFI_PRINT2S_PROTOCOLHao Wu2017-02-213-10/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add the EFI_PRINT2S_PROTOCOL as a safe version of the EFI_PRINT2_PROTOCOL, the EFI_PRINT2S_PROTOCOL replaces the following 2 services in EFI_PRINT2_PROTOCOL: UNICODE_VALUE_TO_STRING ASCII_VALUE_TO_STRING with: UNICODE_VALUE_TO_STRING_S ASCII_VALUE_TO_STRING_S The 2 new services perform checks to the input parameters and will return relative status to reflect the check result. Return RETURN_INVALID_PARAMETER when: 1). The input Buffer is NULL. 2). The input BufferSize is greater than (PcdMaximumUnicodeStringLength * sizeof (CHAR16) + 1) for UnicodeValueToStringS or greater than PcdMaximumAsciiStringLength for AsciiValueToStringS. 3). The input Flags is not set properly. 4). The input Width is not smaller than MAXIMUM_VALUE_CHARACTERS. Return RETURN_BUFFER_TOO_SMALL when: 1). The input BufferSize cannot hold the converted value. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Hao Wu <hao.a.wu@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
* MdeModulePkg:Generate the correct operational state of the interface.Zhang Lubo2017-02-201-5/+6
| | | | | | | | | | | | | | Currently, When there are more than 9 Ethernet ports available, 'ifconfig -l' is not listing all the ports, only show the ports 0 to 9. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Zhang Lubo <lubo.zhang@intel.com> Cc: Santhapur Naveen <naveens@amiindia.co.in> Cc: Ye Ting <ting.ye@intel.com> Cc: Fu Siyuan <siyuan.fu@intel.com> Cc: Wu Jiaxin <jiaxin.wu@intel.com> Reviewed-by: Ye Ting <ting.ye@intel.com> Reviewed-by: Wu Jiaxin <jiaxin.wu@intel.com>
* MdeModulePkg: Fix some typos of "according"Liming Gao2017-02-085-7/+7
| | | | | | | | | | | | | | | | Cc: Feng Tian <feng.tian@intel.com> Cc: Star Zeng <star.zeng@intel.com> Cc: Siyuan Fu <siyuan.fu@intel.com> Cc: Jiaxin Wu <jiaxin.wu@intel.com> Cc: Liming Gao <liming.gao@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Rebecca Cran <rebecca@bluestop.org> Reviewed-by: Liming Gao <liming.gao@intel.com> Reviewed-by: Star Zeng <star.zeng@intel.com> Reviewed-by: Feng Tian <feng.tian@intel.com> Reviewed-by: He Junjie <junjie.he@intel.com> Reviewed-by: Fu Siyuan <siyuan.fu@intel.com> Reviewed-by: Wu Jiaxin <jiaxin.wu@intel.com>
* MdeModulePkg: VariableDxe: Use UEFI_VARIABLE_DATAZhang, Chao B2017-01-251-4/+3
| | | | | | | | | | | | | Use UEFI_VARIABLE_DATA data structure according to TCG PC-Client PFP Spec 00.21. http://www.trustedcomputinggroup.org/wp-content/uploads/PC-ClientSpecific_Platform_Profile_for_TPM_2p0_Systems_v21.pdf Cc: Star Zeng <star.zeng@intel.com> Cc: Yao Jiewen <jiewen.yao@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Chao Zhang <chao.b.zhang@intel.com> Reviewed-by: Star Zeng <star.zeng@intel.com> Reviewed-by: Yao Jiewen <jiewen.yao@intel.com>
* MdeModulePkg: Variable: Update PCR[7] measure for new TCG specZhang, Chao B2017-01-225-9/+128
| | | | | | | | | | | | | Measure DBT into PCR[7] when it is updated between initial measure and ExitBootService. Measure "SecureBoot" change after PK update. Spec version : TCG PC Client PFP 00.37. http://www.trustedcomputinggroup.org/wp-content/uploads/PC-ClientSpecific_Platform_Profile_for_TPM_2p0_Systems_v21.pdf Cc: Star Zeng <star.zeng@intel.com> Cc: Yao Jiewen <jiewen.yao@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Chao Zhang <chao.b.zhang@intel.com> Reviewed-by: Star Zeng <star.zeng@intel.com> Reviewed-by: Yao Jiewen <jiewen.yao@intel.com>
* MdeModulePkg: Use EfiEventEmptyFunction from UefiLibStar Zeng2017-01-204-73/+7
| | | | | | | | | | | | | | | Use EfiEventEmptyFunction from UefiLib and remove the duplication of event empty function. REF: https://bugzilla.tianocore.org/show_bug.cgi?id=298 Cc: Feng Tian <feng.tian@intel.com> Cc: Ruiyu Ni <ruiyu.ni@intel.com> Cc: Liming Gao <liming.gao@intel.com> Cc: Michael Kinney <michael.d.kinney@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Star Zeng <star.zeng@intel.com> Reviewed-by: Feng Tian <feng.tian@intel.com>
* MdeModulePkg: Remove superfluous return statementsThomas Huth2017-01-201-3/+0
| | | | | | | | | If the code eventually returns "Status" anyway, it does not make sense to explicitly return "Status" in case of an error, too. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Thomas Huth <thuth@redhat.com> Reviewed-by: Star Zeng <star.zeng@intel.com>