summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* EmbeddedPkg/AndroidBoot: boot android kernel from storageJun Nie2017-08-208-0/+779
| | | | | | | | | | | | | | Add an android kernel loader that could load kernel from storage device. This android boot image BDS add addtitional cmdline/dtb/ramfs support besides kernel that is introduced by Android boot header. This patch is derived from Haojian's code as below link. https://patches.linaro.org/patch/94683/ Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jun Nie <jun.nie@linaro.org> Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
* MdeModulePkg/ScsiBusDxe: don't produce ScsiIo for nonexistent LUNs, part 2Laszlo Ersek2017-08-191-2/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The SPC-4 says about INQUIRY, > In response to an INQUIRY command received by an incorrect logical unit, > the SCSI target device shall return the INQUIRY data with the peripheral > qualifier set to the value defined in 6.4.2. The INQUIRY command shall > return CHECK CONDITION status only when the device server is unable to > return the requested INQUIRY data. When a device server takes the second branch, and returns CHECK CONDITION for a nonexistent LUN, the InquiryData structure in the DiscoverScsiDevice() function remains filled with the original zeros. DiscoverScsiDevice() then sees zero in both Peripheral_Qualifier and Peripheral_Type, and therefore ScsiBusDxe produces a ScsiIo protocol instance with device type zero, for the nonexistent LUN. Device type zero is EFI_SCSI_TYPE_DISK. Thus ScsiDiskDxe binds the bogus ScsiIo protocol interface, and produces a similarly bogus BlockIo interface on top. This ripples up to BDS, where UefiBootManagerLib can auto-generate bogus UEFI boot options for the nonexistent LUNs. This has been encountered with QEMU, after commit ded6ddc5a7b9 ("scsi: clarify sense codes for LUN0 emulation", 2017-08-04). QEMU now answers INQUIRY commands that were directed to nonexistent LUNs with: > DiscoverScsiDevice:1361: Lun=2 HostAdapterStatus=0 TargetStatus=2 > SenseDataLength=18 InquiryDataLength=96 > Sense { > Sense 000000 70 00 05 00 00 00 00 0A 00 00 00 00 25 00 00 00 > Sense 000010 00 00 > Sense } > Inquiry { > Inquiry 000000 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 > Inquiry 000010 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 > Inquiry 000020 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 > Inquiry 000030 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 > Inquiry 000040 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 > Inquiry 000050 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 > Inquiry } The interesting fields are: - HostAdapterStatus=0 (OK), - TargetStatus=2 (CHECK CONDITION), - Sense/Error_Code=0x70 (Current error, Fixed description) - Sense/Sense_Key=0x05 (ILLEGAL REQUEST) According to SPC-4 "Table 41 -- Sense key descriptions (part 2 of 2)", ILLEGAL REQUEST is justified when "the command was addressed to an incorrect logical unit number". Thus, recognize this kind of answer for nonexistent LUNs. ( Checking the status fields and the sense data is justified anyway, according to the documentation of ScsiInquiryCommand(): > @retval EFI_SUCCESS The command was executed > successfully. See > HostAdapterStatus, > TargetStatus, SenseDataLength, > and SenseData in that order for > additional status information. ) Cc: Eric Dong <eric.dong@intel.com> Cc: Feng Tian <feng.tian@intel.com> Cc: Hannes Reinecke <hare@suse.com> Cc: Paolo Bonzini <pbonzini@redhat.com> Cc: Star Zeng <star.zeng@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Star Zeng <star.zeng@intel.com>
* MdeModulePkg/ScsiBusDxe: remove redundant "else" after "break" statementLaszlo Ersek2017-08-191-3/+4
| | | | | | | | | | | | | | | The code after the "if" statement is only reachable if the first branch with the "break" is not taken. Therefore we can move the "else" branch after the "if" statement, simplifying the code. Cc: Eric Dong <eric.dong@intel.com> Cc: Feng Tian <feng.tian@intel.com> Cc: Hannes Reinecke <hare@suse.com> Cc: Paolo Bonzini <pbonzini@redhat.com> Cc: Star Zeng <star.zeng@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Star Zeng <star.zeng@intel.com>
* MdeModulePkg/ScsiBusDxe: don't produce ScsiIo for nonexistent LUNs, part 1Laszlo Ersek2017-08-191-9/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The SPC-4 spec says about the INQUIRY data, in "Table 138 -- Peripheral qualifier": > Qualifier = 011b The device server is not capable of supporting a > peripheral device on this logical unit. For this > peripheral qualifier the peripheral device type shall > be set to 1Fh. All other peripheral device type values > are reserved for this peripheral qualifier. Accordingly, the DiscoverScsiDevice() function returns FALSE if Peripheral_Qualifier is 3 decimal, but Peripheral_Type differs from 1Fh. This is a valid sanity check -- such combinations are reserved. When Peripheral_Qualifier is 3, and Peripheral_Type is 1Fh, then DiscoverScsiDevice() returns TRUE. While this combination is not reserved, returning TRUE for it is incorrect: Peripheral_Type 1Fh stands for "Unknown or no device type", and this combination is returned in particular when the INQUIRY command was directed to a nonexistent LUN. Quoting the spec: > In response to an INQUIRY command received by an incorrect logical unit, > the SCSI target device shall return the INQUIRY data with the peripheral > qualifier set to the value defined in 6.4.2. [...] > > [...] > > The PERIPHERAL QUALIFIER field and PERIPHERAL DEVICE TYPE field identify > the peripheral device connected to the logical unit. If the SCSI target > device is not capable of supporting a peripheral device connected to > this logical unit, the device server shall set these fields to 7Fh > (i.e., PERIPHERAL QUALIFIER field set to 011b and PERIPHERAL DEVICE TYPE > field set to 1Fh). The consequence of this bug is that for each nonexistent Target/LUN pair, we produce a useless ScsiIo protocol interface. The internal "ScsiIoDevice->ScsiDeviceType" field will be set to 0x1f, and it will be returned to higher-level SCSI drivers when they call ScsiIo->GetDeviceType(). Given that 0x1f means "Unknown or no device type", no higher-level driver can ever support it, so these ScsiIo protocol interfaces are useless. The fix is to return FALSE for the (Peripheral_Qualifier=3, Peripheral_Type=0x1f) combination. With that however we reject the whole Peripheral_Qualifier=3 space (justifiedly -- see the definition above), which lets us simplify the code. Cc: Eric Dong <eric.dong@intel.com> Cc: Feng Tian <feng.tian@intel.com> Cc: Hannes Reinecke <hare@suse.com> Cc: Paolo Bonzini <pbonzini@redhat.com> Cc: Star Zeng <star.zeng@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Star Zeng <star.zeng@intel.com>
* UefiCpuPkg/PiSmmCpuDxeSmm: Add CPUID MCA support checkMichael D Kinney2017-08-171-2/+14
| | | | | | | | | | | | | https://bugzilla.tianocore.org/show_bug.cgi?id=674 Add CPUID check to see if the CPU supports the Machine Check Architecture before accessing the Machine Check Architecture related MSRs. Cc: Eric Dong <eric.dong@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Michael Kinney <michael.d.kinney@intel.com> Reviewed-by: Eric Dong <eric.dong@intel.com>
* ArmPkg/ArmDmaLib: use double buffering only for bus master writeArd Biesheuvel2017-08-171-19/+36
| | | | | | | | | | | | | | | | | | | | | | | | | The ArmPkg implementation of DmaLib uses double buffering to ensure that any attempt to perform non-coherent DMA on unaligned buffers cannot corrupt adjacent unrelated data which happens to share cachelines with the data we are exchanging with the device. Such corruption can only occur on bus master write, in which case we have to invalidate the caches to ensure the CPU will see the data written to memory by the device. In the bus master read case, we can simply clean and invalidate at the same time, which may purge unrelated adjacent data from the caches, but will not corrupt its contents. Also, this double buffer does not necessarily have to be allocated from uncached memory: by the same reasoning, we can perform cache invalidation on an ordinary pool allocation as long as we take the same alignment constraints into account. So update our code accordingly: remove double buffering from the bus master read path, and switch to a pool allocation for the double buffer. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
* ArmVirtPkg/FdtPL011SerialPortLib: call PL011UartLib in all SerialPortLib APIsLaszlo Ersek2017-08-171-3/+35
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | With the SerialDxe change in commit 4cf3f37c87ba ("MdeModulePkg SerialDxe: Process timeout consistently in SerialRead", 2017-07-18), setting EFI_SERIAL_INPUT_BUFFER_EMPTY in the "Control" output parameter, in the GetControl() SerialPortLib function, is no longer a "small optimization". Namely, due to the SerialDxe change, the GetOneKeyFromSerial() call in TerminalDxe's TerminalConInTimerHandler() can take very long if the input queue is empty, even if GetOneKeyFromSerial()'s return value causes the loop to be exited right after, in the first iteration. This issue causes a boot hang in ArmVirtQemu: with the input queue empty, TerminalConInTimerHandler() takes so long to return that, by the time it returns, there's another execution queued already (due to the associated timer event being signaled meanwhile). The boot process is stuck in the timer event handler. Therefore even the first GetOneKeyFromSerial() iteration must be prevented in TerminalConInTimerHandler() if the input queue is empty, and that requires implementing GetControl() for real. Implement the SetAttributes(), SetControl() and GetControl() APIs (of SerialPortExtLib origin) in FdtPL011SerialPortLib with calls to matching PL011UartLib functions. This follows the example of "ArmPlatformPkg/Library/PL011SerialPortLib" and also matches Star's original idea under [1]. The patch can be considered a continuation of commit ad7f6bc2e116 ("ArmVirtPkg: Use SerialDxe in MdeModulePkg instead of EmbeddedPkg", 2015-11-26), based on the mailing list threads [1] [2] [3]. [1] http://mid.mail-archive.com/1447752930-32880-12-git-send-email-star.zeng@intel.com [2] http://mid.mail-archive.com/1448243067-1880-12-git-send-email-star.zeng@intel.com [3] http://mid.mail-archive.com/b748580c-cb51-32c9-acf9-780841ef15da@redhat.com Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org> Cc: Brijesh Singh <brijesh.singh@amd.com> Cc: Heyi Guo <guoheyi@huawei.com> Cc: Star Zeng <star.zeng@intel.com> Originally-suggested-by: Star Zeng <star.zeng@intel.com> Reported-by: Brijesh Singh <brijesh.singh@amd.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Tested-by: Brijesh Singh <brijesh.singh@amd.com> Reviewed-by: Star Zeng <star.zeng@intel.com>
* OvmfPkg/build.sh: select the GCC49 toolchain settings for gcc-7.*Laszlo Ersek2017-08-171-1/+1
| | | | | | | | | | | | | | | | | | | When UefiCpuPkg/MpInitLib is built for X64 with gcc-7, using the DEBUG build target and the GCC5 toolchain settings, a C-language assignment is miscompiled such that the initial AP startup hangs in CpuMpPei (X64) or CpuDxe (Ia32X64). See <https://bugzilla.tianocore.org/show_bug.cgi?id=671> for a detailed analysis of the symptoms, and for mailing list links. This issue has been reported several times (one example is <https://bugzilla.tianocore.org/show_bug.cgi?id=657>). Until we (or the upstream gcc developers) figure out how to dissuade gcc-7 from the miscompilation, pick the GCC49 toolchain in "build.sh" for gcc-7.*. Cc: Alex Williamson <alex.williamson@redhat.com> Cc: Jordan Justen <jordan.l.justen@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
* Maintainers.txt: Update the maintainer for SourceLevelDebugPkgHao Wu2017-08-171-1/+0
| | | | | | Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Hao Wu <hao.a.wu@intel.com> Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com>
* IntelSiliconPkg/IntelVTdDxe: Update function commentsBi, Dandan2017-08-172-0/+3
| | | | | | | | | | | In commit 4ad5f597153c7cb20a968236c2c7d6ff01994350, the parameters of some functions have been updated, but miss to update the comments accordingly. This patch is to update the function comments. Cc: Jiewen Yao <jiewen.yao@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Dandan Bi <dandan.bi@intel.com> Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
* QuarkSocPkg/QNCSmmDispatcher: Fix use after free issue #2Marvin H?user2017-08-161-2/+2
| | | | | | | | | | | | | As part of commit 5f82e02, ActiveRecordInDb was introduced as a copy of RecordInDb as latter may be freed by the callback function. This commit replaces an access of RecordInDb after the callback function has been executed with an access to ActiveRecordInDb. Cc: Michael D Kinney <michael.d.kinney@intel.com> Cc: Kelly Steele <kelly.steele@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Marvin Haeuser <Marvin.Haeuser@outlook.com> Reviewed-by: Michael D Kinney <michael.d.kinney@intel.com>
* UefiCpuPkg RegisterCpuFeaturesLib: Fix buffer pointer error usage.Eric Dong2017-08-171-8/+8
| | | | | | | | | | | | | | | | | Current code allocate buffer for the pointer which later get value from PCD database. but current code error use "=" for this case. Use AllocateCopyPool instead to fix it. V2 enhanced to directly use AllocateCopyPool to get the PCD value. V3 enhanced to avoid using local temp variable. V4 enhanced to keep the functions to get the pcd values. Cc: Ruiyu Ni <ruiyu.ni@intel.com> Cc: Shao Ming <ming.shao@intel.com> Cc: Kinney Michael D <michael.d.kinney@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Eric Dong <eric.dong@intel.com> Reviewed-by: Kinney Michael D <michael.d.kinney@intel.com>
* NetworkPkg/Ip6Dxe: Fix the bug when checking the DataSizeJiaxin Wu2017-08-171-1/+1
| | | | | | | | | | | | During setting the DnsServer, the DataSize check is incorrect. This patch is to fix the issue. 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>
* Maintainers.txt: Add Package Reviewer roleJordan Justen2017-08-161-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | Although everyone is encouraged to review patches and add their Reviewed-by reply for a patch, with the Package Reviewer role we identify additional community members that will be Cc'd for patches made to a package. A distinction between a Package Maintainer and Reviewer is that Maintainers will always have source control push access to the package whereas Reviewers will not. (The Reviewer may have push access if they are also Package Maintainer for another package.) Currently we have an limit of 2 Package Maintainers per package, but the Package Maintainers for each package decide how to manage the Package Reviewer list. Cc: Andrew Fish <afish@apple.com> Cc: Leif Lindholm <leif.lindholm@linaro.org> Cc: Michael D Kinney <michael.d.kinney@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Jordan Justen <jordan.l.justen@intel.com> Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org> Reviewed-by: Michael D Kinney <michael.d.kinney@intel.com> Reviewed-by: Andrew Fish <afish@apple.com>
* Maintainers.txt: Update Package Maintainer descriptionJordan Justen2017-08-161-1/+2
| | | | | | | | | | | | | | Add note that the Package Maintainer is responsible for reviewing and pushing package changes to source control. Cc: Andrew Fish <afish@apple.com> Cc: Leif Lindholm <leif.lindholm@linaro.org> Cc: Michael D Kinney <michael.d.kinney@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Jordan Justen <jordan.l.justen@intel.com> Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org> Reviewed-by: Michael D Kinney <michael.d.kinney@intel.com> Reviewed-by: Andrew Fish <afish@apple.com>
* Maintainers.txt: List Tianocore StewardsJordan Justen2017-08-161-0/+6
| | | | | | | | | | | Cc: Andrew Fish <afish@apple.com> Cc: Leif Lindholm <leif.lindholm@linaro.org> Cc: Michael D Kinney <michael.d.kinney@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Jordan Justen <jordan.l.justen@intel.com> Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org> Reviewed-by: Michael D Kinney <michael.d.kinney@intel.com> Reviewed-by: Andrew Fish <afish@apple.com>
* edk2: Fix typo in Contributions.txtStar Zeng2017-08-161-1/+1
| | | | | | | | | | | V2: Use "license" instead of "BSD License" V1: Use "FreeBSD" instead of "BSD" Cc: Michael D Kinney <michael.d.kinney@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Star Zeng <star.zeng@intel.com> Reviewed-by: Michael D Kinney <michael.d.kinney@intel.com>
* MdePkg/BaseLib: Update internal LinkedList verifications.Marvin.Haeuser@outlook.com2017-08-161-58/+49
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 1) Replace InternalBaseLibIsNodeInList() with InternalBaseLibIsListValid(). - The verification whether Node is within the doubly-linked List is now done by IsNodeInList(). - Whether the list is valid is returned. 2) The comments within InsertHeadList() and InsertTailList() stated that it is checked whether Entry is not part of the doubly-linked list. This was not done as argument 3 of InternalBaseLibIsNodeInList() indicated whether the check is done, not whether to check if the node is or is not in the list. This has been fixed by using IsNodeInList() for the ASSERTs. V2: - Fix IsListEmpty() to ASSERT when the passed list is invalid. - Introduce the VERIFY_IS_NODE_IN_LIST() macro to only verify whether the passed node is part of the list when PcdVerifyNodeInList is TRUE. V3: - Introduce the ASSERT_VERIFY_NODE_IN_VALID_LIST() macro which, depending on the value of PcdVerifyNodeInList, verifies whether SecondEntry is or is not part of the same doubly-linked list as FirstEntry and unconditionally verifies whether the doubly-linked list FirstEntry is part of is valid. This prevents InternalBaseLibIsListValid() from being called twice when a function ASSERTs via the result of IsNodeInList(), as it calls InternalBaseLibIsListValid() already. - Remove the VERIFY_IS_NODE_IN_LIST() macro in favor of ASSERT_VERIFY_NODE_IN_VALID_LIST(). Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Marvin Haeuser <Marvin.Haeuser@outlook.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
* MdePkg/BaseLib: Add IsNodeInList() function.Marvin.Haeuser@outlook.com2017-08-163-29/+92
| | | | | | | | | | | | | | | | | This patch adds IsNodeInList() to BaseLib, which verifies the given Node is part of the doubly-linked List provided. V2: - Rename "List" to "FirstEntry" and "Node" to "SecondEntry" to clarify that "FirstEntry" does not need to be the doubly-linked list's head node. V3: - Remove ASSERTs from IsNodeInList() which are present in InternalBaseLibIsListValid(). Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Marvin Haeuser <Marvin.Haeuser@outlook.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
* ShellPkg: Update header file including styleSong, BinX2017-08-165-5/+5
| | | | | | | | | | - Update header file including style to avoid MSDN C4464 warning Cc: Jaben Carsey <jaben.carsey@intel.com> Cc: Ruiyu Ni <ruiyu.ni@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Bell Song <binx.song@intel.com> Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com>
* MdeModulePkg: Delete useless case codeSong, BinX2017-08-162-21/+0
| | | | | | | | | | | - Delete useless case code to fix /WHOLEARCHIVE build error with VS2015 tool chain Cc: Star Zeng <star.zeng@intel.com> Cc: Eric Dong <eric.dong@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Bell Song <binx.song@intel.com> Reviewed-by: Star Zeng <star.zeng@intel.com>
* MdeModulePkg: Delete never touched codeSong, BinX2017-08-162-4/+2
| | | | | | | | | | - Delete never touched code Cc: Star Zeng <star.zeng@intel.com> Cc: Eric Dong <eric.dong@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Bell Song <binx.song@intel.com> Reviewed-by: Star Zeng <star.zeng@intel.com>
* UefiCpuPkg/BaseUefiCpuLib.inf: Remove unnecessary library class.Eric Dong2017-08-161-5/+1
| | | | | | | | | | | UefiCpuLib inf file reference itself in [LibraryClasses] section, this is not necessary. This patch remove it. Cc: Ruiyu Ni <ruiyu.ni@intel.com> Cc: Ming Shao <ming.shao@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Eric Dong <eric.dong@intel.com> Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com>
* UefiCpuPkg RegisterCpuFeaturesLib: Enhance debug messages.Eric Dong2017-08-161-4/+4
| | | | | | | | | | | Current debug message when enable/disable CPU feature not correct. This patch enhances it to make it more accurate. Cc: Ruiyu Ni <ruiyu.ni@intel.com> Cc: Shao, Ming <ming.shao@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Eric Dong <eric.dong@intel.com> Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com>
* UefiCpuPkg UefiCpupkg.uni: Add new pcds comments.Eric Dong2017-08-161-0/+30
| | | | | | | | | | | Add prompt/help string for pcd PcdCpuProcTraceOutputScheme and PcdCpuProcTraceMemSize in UefiCpuPkg.uni file. Cc: Liming Gao <liming.gao@intel.com> Cc: Ruiyu Ni <ruiyu.ni@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Eric Dong <eric.dong@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
* UefiCpuPkg: Add comments for PCDs definition.Eric Dong2017-08-161-2/+26
| | | | | | | | | | | | Add valid/default values for PCD PcdCpuProcTraceMemSize and PcdCpuProcTraceOutputScheme in the comment part. Cc: Liming Gao <liming.gao@intel.com> Cc: Ruiyu Ni <ruiyu.ni@intel.com> Cc: Michael D Kinney <michael.d.kinney@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Eric Dong <eric.dong@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
* OvmfPkg/Protocol/VirtioDevice: fix comment styleBrijesh Singh2017-08-151-3/+11
| | | | | | | | | | | | | Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org> Cc: Jordan Justen <jordan.l.justen@intel.com> Cc: Tom Lendacky <thomas.lendacky@amd.com> Cc: Laszlo Ersek <lersek@redhat.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Brijesh Singh <brijesh.singh@amd.com> [lersek@redhat.com: clarify subject line] [lersek@redhat.com: adjust the set of comments updated by the patch] Reviewed-by: Laszlo Ersek <lersek@redhat.com> Regression-tested-by: Laszlo Ersek <lersek@redhat.com>
* OvmfPkg/VirtioMmioDeviceLib: add missing IN and OUT decorationBrijesh Singh2017-08-152-28/+28
| | | | | | | | | | | Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org> Cc: Jordan Justen <jordan.l.justen@intel.com> Cc: Tom Lendacky <thomas.lendacky@amd.com> Cc: Laszlo Ersek <lersek@redhat.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Brijesh Singh <brijesh.singh@amd.com> Reviewed-by: Laszlo Ersek <lersek@redhat.com> Regression-tested-by: Laszlo Ersek <lersek@redhat.com>
* OvmfPkg/VirtioPciDeviceDxe: add missing IN and OUT decorationBrijesh Singh2017-08-152-24/+24
| | | | | | | | | | | Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org> Cc: Jordan Justen <jordan.l.justen@intel.com> Cc: Tom Lendacky <thomas.lendacky@amd.com> Cc: Laszlo Ersek <lersek@redhat.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Brijesh Singh <brijesh.singh@amd.com> Reviewed-by: Laszlo Ersek <lersek@redhat.com> Regression-tested-by: Laszlo Ersek <lersek@redhat.com>
* OvmfPkg/Virtio10Dxe: supply missing BUS_MASTER attributeBrijesh Singh2017-08-151-1/+1
| | | | | | | | | | | | | | | | | Virtio devices read and write guest RAM (they don't just decode their IO and/or MMIO BARs), which translates to "bus master". Suggested-by: Laszlo Ersek <lersek@redhat.com> Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org> Cc: Jordan Justen <jordan.l.justen@intel.com> Cc: Tom Lendacky <thomas.lendacky@amd.com> Cc: Laszlo Ersek <lersek@redhat.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Brijesh Singh <brijesh.singh@amd.com> [lersek@redhat.com: expand commit message body] [lersek@redhat.com: remove superfluous whitespace in assignment] Reviewed-by: Laszlo Ersek <lersek@redhat.com> Regression-tested-by: Laszlo Ersek <lersek@redhat.com>
* OvmfPkg/VirtioPciDeviceDxe: supply missing BUS_MASTER attributeBrijesh Singh2017-08-151-3/+7
| | | | | | | | | | | | | | | | | Virtio devices read and write guest RAM (they don't just decode their IO and/or MMIO BARs), which translates to "bus master". Suggested-by: Laszlo Ersek <lersek@redhat.com> Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org> Cc: Jordan Justen <jordan.l.justen@intel.com> Cc: Tom Lendacky <thomas.lendacky@amd.com> Cc: Laszlo Ersek <lersek@redhat.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Brijesh Singh <brijesh.singh@amd.com> [lersek@redhat.com: expand commit message body] [lersek@redhat.com: fix up line breaking style (original code too)] Reviewed-by: Laszlo Ersek <lersek@redhat.com> Regression-tested-by: Laszlo Ersek <lersek@redhat.com>
* Nt32/PlatformBootManagerLib: Enable STD_ERROR on all consolesMichael D Kinney2017-08-151-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | Add STD_ERROR flag to all output consoles that the Nt32 platform supports so all messages sent to the standard error console device(s) are visible by default. The Boot Maintenance Manager can be used to manually disable standard error output to specific console devices. UEFI Applications and UEFI Drivers are recommended to be built with DEBUG() and ASSERT() messages sent to the standard error device using MdePkg/Library/UefiDebugLibStdErr. Prior to this change, a user would have to use the Boot Maintenance Manager to configure a standard error console device to make these messages visible. Cc: Ruiyu Ni <ruiyu.ni@intel.com> Cc: Hao Wu <hao.a.wu@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Michael Kinney <michael.d.kinney@intel.com> Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com> Reviewed-by: Sunny Wang <sunnywang@hpe.com> Tested-by: Sunny Wang <sunnywang@hpe.com>
* UefiCpuPkg MpInitLib: Save/restore original WakeupBuffer for DxeMpLibStar Zeng2017-08-154-168/+109
| | | | | | | | | | | | | | | | | | | | | Current code always allocates/frees < 1MB WakeupBuffer for DxeMpLib until ExitBootService, but the allocation may be failed at late phase of the boot. This patch is to always save/restore original WakeupBuffer for DxeMpLib, it is aligned with the solution for PeiMpLib at 9293d6e42e677e4a38e055258c0993ad8a9df14e, then AllocateResetVector() and FreeResetVector() will be common and moved to MpLib.c. Only difference is GetWakeupBuffer() that will be in PeiMpLib or DxeMpLib respectively. Cc: Liming Gao <liming.gao@intel.com> Cc: Ruiyu Ni <ruiyu.ni@intel.com> Cc: Eric Dong <eric.dong@intel.com> Cc: Jeff Fan <jeff.fan@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>
* IntelSiliconPkg/IntelVTdDxe: Improve performance.Jiewen Yao2017-08-147-216/+189
| | | | | | | | | | | | | | | This patch is to improve IOMMU performance. All WBINVD is removed due to performance issue. CLFLUSH by WriteBackDataCacheRange() is used to only flush the context table or second level page table if they are changed. This patch also removed some unused functions. Cc: Star Zeng <star.zeng@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jiewen Yao <jiewen.yao@intel.com> Reviewed-by: Star Zeng <star.zeng@intel.com>
* IntelSiliconPkg/dsc: Add CacheMaintenanceLib.Jiewen Yao2017-08-141-0/+1
| | | | | | | | | It will be used by IntelVTdDxe. Cc: Star Zeng <star.zeng@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jiewen Yao <jiewen.yao@intel.com> Reviewed-by: Star Zeng <star.zeng@intel.com>
* ShellPkg UefiDpLib: Init CustomCumulativeData.MinDurStar Zeng2017-08-141-1/+1
| | | | | | | | | | | | | Init CustomCumulativeData.MinDur to PERF_MAXDUR, otherwise the MinDur displayed for custom cumulative data will be always 0, but not the real shortest duration. Cc: Liming Gao <liming.gao@intel.com> Cc: Ruiyu Ni <ruiyu.ni@intel.com> Cc: Cinnamon Shia <cinnamon.shia@hpe.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>
* PerformancePkg DP: Init CustomCumulativeData.MinDurStar Zeng2017-08-141-1/+1
| | | | | | | | | | | | Init CustomCumulativeData.MinDur to PERF_MAXDUR, otherwise the MinDur displayed for custom cumulative data will be always 0, but not the real shortest duration. Cc: Liming Gao <liming.gao@intel.com> Cc: Cinnamon Shia <cinnamon.shia@hpe.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 DxeCore: Enhance "ConvertPages: Incompatible memory types"Star Zeng2017-08-141-2/+7
| | | | | | | | | | | | | | | | | | | | When double free pages by FreePages() or allocate allocated pages by AllocatePages() with AllocateAddress type, the code will print debug message "ConvertPages: Incompatible memory types", but the debug message is not very obvious for the error paths by FreePages() or AllocatePages(). Refer https://lists.01.org/pipermail/edk2-devel/2017-August/013075.html for the discussion. This patch is to enhance the debug message for the error paths by FreePages() or AllocatePages. Cc: Liming Gao <liming.gao@intel.com> Cc: Andrew Fish <afish@apple.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 DxeCore: Fix double free pages on LoadImage failure pathStar Zeng2017-08-141-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | https://bugzilla.tianocore.org/show_bug.cgi?id=667 reported there is double free pages on LoadImage failure path. CoreLoadPeImage() ... return EFI_SUCCESS; Done: // // Free memory. // if (DstBufAlocated) { CoreFreePages (Image->ImageContext.ImageAddress, Image->NumberOfPages); } ... CoreUnloadAndCloseImage() ... if ((Image->ImageBasePage != 0) && FreePage) { CoreFreePages (Image->ImageBasePage, Image->NumberOfPages); } ... This patch is to follow the suggestion at https://lists.01.org/pipermail/edk2-devel/2017-August/013112.html to set Image->ImageContext.ImageAddress and Image->ImageBasePage to 0 after the free in CoreLoadPeImage(). Cc: Liming Gao <liming.gao@intel.com> Cc: Andrew Fish <afish@apple.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>
* BaseTools: Fix Segmentation fault: 11 when build AppPkg with XCODE5Andrew Fish2017-08-141-1/+11
| | | | | | | | | | | | | | it is a bug in mtoc setting the size of the debug directory entry to the size of the .debug section, not the size of the EFI_IMAGE_DEBUG_DIRECTORY_ENTRY. It was causing a loop to iterate and get bogus EFI_IMAGE_DEBUG_DIRECTORY_ENTRY data and pass that to memset() and boom. Cc: Liming Gao <liming.gao@intel.com> Cc: Michael D Kinney <michael.d.kinney@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Andrew Fish <afish@apple.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
* NetworkPkg/HttpBootDxe: Update device path node to include DNS informationJiaxin Wu2017-08-143-24/+121
| | | | | | | | 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/UefiBootManagerLib: Support DNS device path descriptionJiaxin Wu2017-08-141-2/+11
| | | | | | | | | | | This patch is to update UEFI Boot manager to support DNS device path for HTTP(S) network boot. 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>
* MdePkg/UefiDevicePathLib: Add DevPathFromTextDns and DevPathToTextDns librariesJiaxin Wu2017-08-142-0/+139
| | | | | | | | | | | | | | | V3: * Fix the bug in DevPathFromTextDns() V2: * Add no IP instance case check. 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> Reviewed-by: Ye Ting <ting.ye@intel.com>
* MdePkg/DevicePath.h: Add DNS Device Path definitionJiaxin Wu2017-08-141-0/+18
| | | | | | | | | | This patch adds the DNS device path node definition. 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/EmmcDxe: Make sure no extra data is erased by EraseBlocksHao Wu2017-08-141-4/+152
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | V3 changes: Add debug messages for new return path when successfully erase the specified blocks. Refine logic for calculating the size for writing zeros to device. V2 changes: The Trim command is not supported on all eMMC devices. For those devices that do not support such command, add codes to handle the scenario. Commit message: The current implementation of the Erase Block Protocol service EraseBlocks() uses the erase command. According to spec eMMC Electrical Standard 5.1, Section 6.6.9: The erasable unit of the eMMC is the "Erase Group"; Erase group is measured in write blocks that are the basic writable units of the Device. ... When the Erase is executed it will apply to all write blocks within an erase group. However, code logic in function EmmcEraseBlocks() does not check whether the blocks to be erased form complete erase groups. Missing such checks will lead to erasing extra data on the device. This commit will: a. If the device support the Trim command, use the Trim command to perform the erase operations for eMMC devices. According to the spec: Unlike the Erase command, the Trim function applies the erase operation to write blocks instead of erase groups. b. If the device does not support the Trim command, use the Erase command to erase the data in the erase groups. And write zeros to those blocks that cannot form a complete erase group. 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>
* NetworkPkg/HttpDxe: Handle the HttpVersionUnsupported in the HttpConfigDataJiaxin Wu2017-08-141-0/+4
| | | | | | | | | | | v2: * Refine the patch by changing the '==' to '>='. Cc: Ye Ting <ting.ye@intel.com> Cc: Jin Eric <eric.jin@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>
* BaseTools: Support TabSpace between section tag in DEC fileYanyan Zhang2017-08-131-1/+1
| | | | | | | | | | | | | | Per DEC spec, multiple section tag use <TS> to separate, and it can support Tab, so this patch fix the bug to use Tab. <TabSpace> ::= {<Tab>} {<Space>} <TS> ::= <TabSpace>* Cc: Liming Gao <liming.gao@intel.com> Cc: Yonghong Zhu <yonghong.zhu@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Yanyan Zhang <yanyanx.zhang@intel.com> Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>
* BaseTools: Don't need to add extra quotes when UI string from fileBin Wang2017-08-121-2/+1
| | | | | | | | | | | when the UI string is read from files, we don't need to add the extra quotes. Otherwise, it will cause UI name has this extra quotes. Cc: Liming Gao <liming.gao@intel.com> Cc: Yonghong Zhu <yonghong.zhu@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Bin Wang <binx.a.wang@intel.com> Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>
* BaseTools/UPT: Support Multiple InstallationHess Chen2017-08-128-102/+145
| | | | | | | | | Add a new feature to UPT to support installing multiple DIST packages in one time. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Hess Chen <hesheng.chen@intel.com> Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>
* BaseTools/Scripts: Add sample makefile for use with RunMakefile.pyMichael D Kinney2017-08-111-0/+43
| | | | | | | | | | | | | | | | | https://bugzilla.tianocore.org/show_bug.cgi?id=670 Add sample makefile that can be used to test RunMakefile.py script and can also be used as a template to start a new PREBUILD/POSTBUILD makefile. This makefile contains TAB characters instead of spaces on purpose to maximize compatibility with make utilities. Cc: Liming Gao <liming.gao@intel.com> Cc: Yonghong Zhu <yonghong.zhu@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Michael Kinney <michael.d.kinney@intel.com> Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>