summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* UnitTestFrameworkPkg: Add RISC-V architecture for RISC-V EDK2 CI.Abner Chang2020-04-031-1/+2
| | | | | | | | | | | | | | | | | Add RISC-V architecture to UnitTestFrameworkPkg for RISC-V EDK2 CI. BZ:2562: https://bugzilla.tianocore.org/show_bug.cgi?id=2562 Signed-off-by: Abner Chang <abner.chang@hpe.com> Reviewed-by: Bret Barkelew <bret.barkelew@microsoft.com> Cc: Michael D Kinney <michael.d.kinney@intel.com> Cc: Sean Brogan <sean.brogan@microsoft.com> Cc: Bret Barkelew <Bret.Barkelew@microsoft.com> Cc: Leif Lindholm <leif@nuviainc.com> Cc: Gilbert Chen <gilbert.chen@hpe.com> Cc: Daniel Schaefer <daniel.schaefer@hpe.com>
* ShellPkg: Shell package changes for RISC-V EDK2 CI.Abner Chang2020-04-031-1/+2
| | | | | | | | | | | | | | | | Add RISC-V architecture to ShellPkg for EDK2 CI testing. BZ:2562: https://bugzilla.tianocore.org/show_bug.cgi?id=2562 Signed-off-by: Abner Chang <abner.chang@hpe.com> Acked-by: Zhichao Gao <zhichao.gao@intel.com> Cc: Ray Ni <ray.ni@intel.com> Cc: Zhichao Gao <zhichao.gao@intel.com> Cc: Leif Lindholm <leif@nuviainc.com> Cc: Gilbert Chen <gilbert.chen@hpe.com> Cc: Daniel Schaefer <daniel.schaefer@hpe.com>
* SecurityPkg: Security package changes for RISC-V EDK2 CI.Abner Chang2020-04-031-2/+2
| | | | | | | | | | | | | | | | | Add RISC-V architecture to SecurityPkg for EDK2 CI testing. BZ:2562: https://bugzilla.tianocore.org/show_bug.cgi?id=2562 Signed-off-by: Abner Chang <abner.chang@hpe.com> Reviewed-by: Jiewen Yao <jiewen.yao@intel.com> Cc: Jiewen Yao <jiewen.yao@intel.com> Cc: Jian J Wang <jian.j.wang@intel.com> Cc: Chao Zhang <chao.b.zhang@intel.com> Cc: Leif Lindholm <leif@nuviainc.com> Cc: Gilbert Chen <gilbert.chen@hpe.com> Cc: Daniel Schaefer <daniel.schaefer@hpe.com>
* MdePkg/Include: Add RISC-V related definitions EDK2 CI.Abner Chang2020-04-031-0/+7
| | | | | | | | | | | | | | | | HTTP/PXE boot RISC-V related definitions for EDK2 CI. BZ:2562: https://bugzilla.tianocore.org/show_bug.cgi?id=2562 Signed-off-by: Abner Chang <abner.chang@hpe.com> Reviewed-by: Maciej Rabeda <maciej.rabeda@linux.intel.com> Cc: Michael D Kinney <michael.d.kinney@intel.com> Cc: Liming Gao <liming.gao@intel.com> Cc: Leif Lindholm <leif@nuviainc.com> Cc: Gilbert Chen <gilbert.chen@hpe.com> Cc: Daniel Schaefer <daniel.schaefer@hpe.com>
* CryptoPkg: Add RISC-V architecture for EDK2 CI.Abner Chang2020-04-0311-10/+27
| | | | | | | | | | | | | | | | Add RISC-V architecture for EDK2 CI testing. BZ:2562: https://bugzilla.tianocore.org/show_bug.cgi?id=2562 Signed-off-by: Abner Chang <abner.chang@hpe.com> Co-authored-by: Daniel Schaefer <daniel.schaefer@hpe.com> Reviewed-by: Xiaoyu Lu <xiaoyux.lu@intel.com> Cc: Jian J Wang <jian.j.wang@intel.com> Cc: Xiaoyu Lu <xiaoyux.lu@intel.com> Cc: Leif Lindholm <leif@nuviainc.com> Cc: Gilbert Chen <gilbert.chen@hpe.com>
* NetworkPkg/HttpBootDxe: Add RISC-V architecture for EDK2 CI.Abner Chang2020-04-031-0/+3
| | | | | | | | | | | | | | | | Add RISC-V architecture for EDK2 CI testing. BZ:2562: https://bugzilla.tianocore.org/show_bug.cgi?id=2562 Signed-off-by: Abner Chang <abner.chang@hpe.com> Reviewed-by: Maciej Rabeda <maciej.rabeda@linux.intel.com> Cc: Jiaxin Wu <jiaxin.wu@intel.com> Cc: Siyuan Fu <siyuan.fu@intel.com> Cc: Leif Lindholm <leif@nuviainc.com> Cc: Gilbert Chen <gilbert.chen@hpe.com> Cc: Daniel Schaefer <daniel.schaefer@hpe.com>
* NetworkPkg: Add RISC-V architecture for EDK2 CI.Abner Chang2020-04-031-2/+2
| | | | | | | | | | | | | | | | Add RISC-V architecture for EDK2 CI testing. BZ:2562: https://bugzilla.tianocore.org/show_bug.cgi?id=2562 Signed-off-by: Abner Chang <abner.chang@hpe.com> Reviewed-by: Maciej Rabeda <maciej.rabeda@linux.intel.com> Cc: Jiaxin Wu <jiaxin.wu@intel.com> Cc: Siyuan Fu <siyuan.fu@intel.com> Cc: Leif Lindholm <leif@nuviainc.com> Cc: Gilbert Chen <gilbert.chen@hpe.com> Cc: Daniel Schaefer <daniel.schaefer@hpe.com>
* FmpDevicePkg: Add RISC-V architecture for EDK2 CI.Abner Chang2020-04-031-1/+2
| | | | | | | | | | | | | | | | Add RISC-V architecture for EDK2 CI testing. BZ:2562: https://bugzilla.tianocore.org/show_bug.cgi?id=2562 Signed-off-by: Abner Chang <abner.chang@hpe.com> Reviewed-by: Liming Gao <liming.gao@intel.com> Cc: Liming Gao <liming.gao@intel.com> Cc: Michael D Kinney <michael.d.kinney@intel.com> Cc: Leif Lindholm <leif@nuviainc.com> Cc: Gilbert Chen <gilbert.chen@hpe.com> Cc: Daniel Schaefer <daniel.schaefer@hpe.com>
* FatPkg: Add RISC-V architecture for EDK2 CI.Abner Chang2020-04-031-1/+2
| | | | | | | | | | | | | | | BZ:2562: https://bugzilla.tianocore.org/show_bug.cgi?id=2562 Add RISC-V architecture for EDK2 CI testing. Signed-off-by: Abner Chang <abner.chang@hpe.com> Reviewed-by: Ray Ni <ray.ni@intel.com> Cc: Ray Ni <ray.ni@intel.com> Cc: Leif Lindholm <leif@nuviainc.com> Cc: Gilbert Chen <gilbert.chen@hpe.com> Cc: Daniel Schaefer <daniel.schaefer@hpe.com>
* ArmPkg/ArmMmuLib: drop unused TT_ATTR_INDX_INVALID CPP macroArd Biesheuvel2020-04-021-3/+0
| | | | | | | | | | | TT_ATTR_INDX_INVALID is #define'd but never used so drop it. Note that this leaves a CPP macro of the same name in CpuDxe, but there, it is actually being used, and although the name suggests that this value is somehow defined by the architecture, this is really not the case and it only has meaning within the scope of CpuDxe's implementation. Signed-off-by: Ard Biesheuvel <ard.biesheuvel@arm.com> Reviewed-by: Leif Lindholm <leif@nuviainc.com>
* ArmPkg/ArmMmuLib: get rid of GetRootTranslationTableInfo()Ard Biesheuvel2020-04-021-16/+6
| | | | | | | | | Only a single call to GetRootTranslationTableInfo() remains, which only provides the root table level. So let's create a new static helper function that returns just this value, and use it instead. Signed-off-by: Ard Biesheuvel <ard.biesheuvel@arm.com> Reviewed-by: Leif Lindholm <leif@nuviainc.com>
* ArmPkg/ArmMmuLib: drop pointless LookupAddresstoRootTable() routineArd Biesheuvel2020-04-021-34/+15
| | | | | | | | | | | | | | LookupAddresstoRootTable() uses a loop to go over its MaxAddress argument, essentially to do a log2() and determine how many bits are needed to represent it. Since the argument is the result of a shift-left expression, there is some room for improvement here, and we can simply use the bit count directly to calculate the value of T0SZ. At the same time, we can omit calling GetRootTranslationTableInfo() to determine the number of root table entries, and add a new helper that applies the trivial calculation directly. Signed-off-by: Ard Biesheuvel <ard.biesheuvel@arm.com> Reviewed-by: Leif Lindholm <leif@nuviainc.com>
* ArmPkg/CpuDxe: move PageAttributeToGcdAttribute() out of ArmMmuLibArd Biesheuvel2020-04-023-50/+46
| | | | | | | | | The routine PageAttributeToGcdAttribute() is exported by ArmMmuLib but only ever used in the implementation of CpuDxe. So let's move the function there and make it STATIC. Signed-off-by: Ard Biesheuvel <ard.biesheuvel@arm.com> Reviewed-by: Leif Lindholm <leif@nuviainc.com>
* ArmPkg/CpuDxe: use private copy of GetRootTranslationTableInfo()Ard Biesheuvel2020-04-022-7/+15
| | | | | | | | | | | | | | | | | Before getting rid of GetRootTranslationTableInfo() and the related LookupAddresstoRootTable() in AARCH64's version of ArmMmuLib, add a version of the former to CpuDxe, which will be its only remaining user. While at it, simplify it a bit, since in the CpuDxe cases, both OUT arguments are always provided. Note that this removes the declaration of GetRootTranslationTableInfo() as well, but this is a declaration that is private to CpuDxe, and it really doesn't belong here in the first place. Since ArmMmuLib's version of GetRootTranslationTableInfo() is going to be replaced shortly anyway, don't bother moving this .h declaration elsewhere. Signed-off-by: Ard Biesheuvel <ard.biesheuvel@arm.com> Reviewed-by: Leif Lindholm <leif@nuviainc.com>
* NetworkPkg/Ip6Dxe: Fix ASSERT logic in Ip6ProcessRouterAdvertise()Maciej Rabeda2020-04-021-3/+3
| | | | | | | | | | | | | | | REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2655 This patch fixes reversed logic of recently added ASSERTs which should ensure that Ip6IsNDOptionValid() implementation properly reacts to invalid packets. Cc: Jiaxin Wu <jiaxin.wu@intel.com> Cc: Siyuan Fu <siyuan.fu@intel.com> Signed-off-by: Maciej Rabeda <maciej.rabeda@linux.intel.com> Reviewed-by: Siyuan Fu <siyuan.fu@intel.com> Tested-by: Laszlo Ersek <lersek@redhat.com> Fixes: 9c20342eed70ec99ec50cd73cb81804299f05403
* OvmfPkg/PvScsiDxe: Refactor setup of rings to separate functionLiran Alon2020-04-011-51/+58
| | | | | | | | | | | | | | | | | | | | | Previous to this change, PvScsiFreeRings() was not undoing all operations that was done by PvScsiInitRings(). This is because PvScsiInitRings() was both preparing rings (Allocate memory and map it for device DMA) and setup the rings against device by issueing a device command. While PvScsiFreeRings() only unmaps the rings and free their memory. Driver do not have a functional error as it makes sure to reset device before every call site to PvScsiFreeRings(). However, this is not intuitive. Therefore, prefer to refactor the setup of the ring against device to a separate function than PvScsiInitRings(). Signed-off-by: Liran Alon <liran.alon@oracle.com> Message-Id: <20200331225637.123318-1-liran.alon@oracle.com> [lersek@redhat.com: rename FreeDMACommBuffer label to FreeDmaCommBuffer] Reviewed-by: Laszlo Ersek <lersek@redhat.com>
* OvmfPkg/PvScsiDxe: Fix VS2019 build error because of implicit castLiran Alon2020-04-011-1/+5
| | | | | | | | | | | | | | | | | | | | | | | Sean reported that VS2019 build produce the following build error: INFO - PvScsi.c INFO - Generating code INFO - d:\a\1\s\OvmfPkg\PvScsiDxe\PvScsi.c(459): error C2220: the following warning is treated as an error INFO - d:\a\1\s\OvmfPkg\PvScsiDxe\PvScsi.c(459): warning C4244: '=': conversion from 'const UINT16' to 'UINT8', possible loss of data This result from an implicit cast from PVSCSI Response->ScsiStatus (Which is UINT16) to Packet->TargetResponse (Which is UINT8). Fix this issue by adding an appropriate explicit cast and verify with assert that this truncation do not result in loss of data. Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=2651 Reported-by: Sean Brogan <sean.brogan@microsoft.com> Signed-off-by: Liran Alon <liran.alon@oracle.com> Message-Id: <20200331110452.51992-1-liran.alon@oracle.com> Reviewed-by: Laszlo Ersek <lersek@redhat.com> [lersek@redhat.com: rewrap VS2019 diags in commit msg for PatchCheck.py]
* Maintainers.txt: Add Liran and Nikita as OvmfPkg/PvScsiDxe reviewersLiran Alon2020-04-011-0/+5
| | | | | | | | | | | | | | | | | Laszlo suggested that as I have contributed the OvmfPkg PVSCSI driver, I will also register myself as a reviewer in Maintainers.txt. In addition, as Nikita have assisted the development of the PVSCSI driver and have developed another similar OvmfPkg SCSI driver, add him as a reviewer to PVSCSI driver as-well. Cc: Nikita Leshenko <nikita.leshchenko@oracle.com> Suggested-by: Laszlo Ersek <lersek@redhat.com> Signed-off-by: Liran Alon <liran.alon@oracle.com> Message-Id: <20200331110244.51409-1-liran.alon@oracle.com> Reviewed-by: Nikita Leshenko <nikita.leshchenko@oracle.com> [lersek@redhat.com: fixup "F:" pattern by appending slash character] Reviewed-by: Laszlo Ersek <lersek@redhat.com>
* NetworkPkg/UefiPxeBcDxe: handle competing DHCP servers (more) gracefullyLaszlo Ersek2020-04-011-2/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When DHCP is misconfigured on a network segment, such that two DHCP servers attempt to reply to requests (and therefore race with each other), the edk2 PXE client can confuse itself. In PxeBcDhcp4BootInfo() / PxeBcDhcp6BootInfo(), the client may refer to a DHCP reply packet as an "earlier" packet from the "same" DHCP server, when in reality both packets are unrelated, and arrive from different DHCP servers. While the edk2 PXE client can do nothing to fix this, it should at least not ASSERT() -- ASSERT() is for catching programming errors (violations of invariants that are under the control of the programmer). ASSERT()s should in particular not refer to external data (such as network packets). What's more, in RELEASE builds, we get NULL pointer references. Check the problem conditions with actual "if"s, and return EFI_PROTOCOL_ERROR. This will trickle out to PxeBcLoadBootFile(), and be reported as "PXE-E99: Unexpected network error". Cc: Jiaxin Wu <jiaxin.wu@intel.com> Cc: Maciej Rabeda <maciej.rabeda@linux.intel.com> Cc: Philippe Mathieu-Daudé <philmd@redhat.com> Cc: Siyuan Fu <siyuan.fu@intel.com> Signed-off-by: Laszlo Ersek <lersek@redhat.com> Message-Id: <20200331004749.16128-1-lersek@redhat.com> Reviewed-by: Siyuan Fu <siyuan.fu@intel.com> Reviewed-by: Maciej Rabeda <maciej.rabeda@linux.intel.com>
* OvmfPkg: Fix SMM/RT driver section alignment for XCODE5/CLANGPDBVitaly Cheptsov2020-04-014-8/+18
| | | | | | | | | | | | | | | | REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2642 This patch resolves the problem of using memory protection attributes when OVMF firmware is compiled with XCODE5 and CLANGPDB. Cc: Andrew Fish <afish@apple.com> Cc: Laszlo Ersek <lersek@redhat.com> Cc: Marvin Häuser <mhaeuser@outlook.de> Signed-off-by: Vitaly Cheptsov <vit9696@protonmail.com> Message-Id: <20200329132158.35259-2-cheptsov@ispras.ru> Acked-by: Laszlo Ersek <lersek@redhat.com> [lersek@redhat.com: fix whitespace issues reported by git-am] [lersek@redhat.com: replace "CC:" tags with "Cc:" ones for PatchCheck.py]
* ShellPkg: Fix 'ping' command Ip4 receive flow.Maciej Rabeda2020-04-011-4/+5
| | | | | | | | | | | | | | | | | REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2032 'ping' command's receive flow utilizes a single Rx token which it attempts to reuse before recycling the previously received packet. This causes a situation where under ICMP traffic, Ping6OnEchoReplyReceived() function will receive an already recycled packet with EFI_SUCCESS token status and finally dereference invalid pointers from RxData structure. Cc: Ray Ni <ray.ni@intel.com> Cc: Zhichao Gao <zhichao.gao@intel.com> Signed-off-by: Maciej Rabeda <maciej.rabeda@linux.intel.com> Reviewed-by: Siyuan Fu <siyuan.fu@intel.com> Acked-by: Zhichao Gao <zhichao.gao@intel.com>
* DynamicTablesPkg: SRAT: Fix uninitialized memory usageSami Mujawar2020-03-311-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | On enabling the /analyse option the VS2017 compiler reports: warning C6001: Using uninitialized memory. This warning is reported for the Status variable in AddGenericInitiatorAffinity() as it is not initialised to a default value. This condition is only valid if GenInitAffCount is equal to 0. Since GenInitAffCount is already checked in BuildSratTable() this condition can never happen. The value of the Status variable is returned in failure cases from appropriate locations in AddGenericInitiatorAffinity(). The only case where Status value is being used un-initialised is the return statement at the end of AddGenericInitiatorAffinity(). Therefore, to fix this issue EFI_SUCCESS can be safely returned instead of returning the Status variable at the end of the function. Signed-off-by: Sami Mujawar <sami.mujawar@arm.com> Reviewed-by: Alexei Fedorov <Alexei.Fedorov@arm.com>
* DynamicTablesPkg: SRAT: Fix entry pointsSami Mujawar2020-03-311-4/+4
| | | | | | | | | | | | | | VS2017 reports 'warning C4028: formal parameter 2 different from declaration' for the library constructor and destructor interfaces for the SRAT Generator modules. Remove the CONST qualifier for the ImageHandle and the SystemTable pointer in the library constructor and destructor to make it compatible with the formal declaration. Signed-off-by: Sami Mujawar <sami.mujawar@arm.com> Reviewed-by: Alexei Fedorov <Alexei.Fedorov@arm.com> Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
* Maintainers: switch to my Arm email addressArd Biesheuvel2020-03-311-8/+8
| | | | | | | | | | | | | | | I no longer work for Linaro (and haven't for a while) so in anticipation of losing access to my @linaro.org mailbox, let's switch to the ARM one for my Tiancore contributions and maintainerships. Cc: Andrew Fish <afish@apple.com> Cc: Michael D Kinney <michael.d.kinney@intel.com> Cc: Ard Biesheuvel <ard.biesheuvel@arm.com> Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org> Signed-off-by: Ard Biesheuvel <ard.biesheuvel@arm.com> Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Leif Lindholm <leif@nuviainc.com> Reviewed-by: Laszlo Ersek <lersek@redhat.com>
* BaseTools:GuidedSectionTools.txt is not generated correctlyFan, ZhijuX2020-03-312-14/+5
| | | | | | | | | | | | | | | | | | | REF:https://bugzilla.tianocore.org/show_bug.cgi?id=2538 For LzmaCompress or BrotliCompress, the platform may use the different options and add their batch file, such as LzmaCompressPlatform. Then, specify it in platform.dsc [BuildOptions] to override the default one in tools_def.txt. *_*_*_LZMA_PATH = LzmaCompressPlatform This override tool will be used. But, its name is not specified in the generated GuidedSectionTools.txt. Signed-off-by: Zhiju.Fan <zhijux.fan@intel.com> Cc: Liming Gao <liming.gao@intel.com> Cc: Bob Feng <bob.c.feng@intel.com> Reviewed-by: Bob Feng <bob.c.feng@intel.com>
* OvmfPkg/PvScsiDxe: Enable device 64-bit DMA addressesLiran Alon2020-03-301-0/+23
| | | | | | | | | | | Enable PCI dual-address cycle attribute to signal device supports 64-bit DMA addresses. Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=2567 Reviewed-by: Laszlo Ersek <lersek@redhat.com> Signed-off-by: Liran Alon <liran.alon@oracle.com> Message-Id: <20200328200100.60786-18-liran.alon@oracle.com> Reviewed-by: Nikita Leshenko <nikita.leshchenko@oracle.com>
* OvmfPkg/PvScsiDxe: Reset device on ExitBootServices()Liran Alon2020-03-302-1/+43
| | | | | | | | | | | | This causes the device to forget about the request/completion rings. We allocated said rings in EfiBootServicesData type memory, and code executing after ExitBootServices() is permitted to overwrite it. Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=2567 Reviewed-by: Laszlo Ersek <lersek@redhat.com> Signed-off-by: Liran Alon <liran.alon@oracle.com> Message-Id: <20200328200100.60786-17-liran.alon@oracle.com> Reviewed-by: Nikita Leshenko <nikita.leshchenko@oracle.com>
* OvmfPkg/PvScsiDxe: Support sending SCSI request and receive responseLiran Alon2020-03-304-3/+465
| | | | | | | | | | | | | Implement EXT_SCSI_PASS_THRU.PassThru(). Machines should be able to boot after this commit. Tested with Ubuntu 16.04 guest. Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=2567 Signed-off-by: Liran Alon <liran.alon@oracle.com> Message-Id: <20200328200100.60786-16-liran.alon@oracle.com> Reviewed-by: Nikita Leshenko <nikita.leshchenko@oracle.com> Reviewed-by: Laszlo Ersek <lersek@redhat.com>
* OvmfPkg/PvScsiDxe: Introduce DMA communication bufferLiran Alon2020-03-302-2/+58
| | | | | | | | | | | | | | | | | | | In case device is constrained by IOMMU or guest is running under AMD SEV, input/output buffers provided to device (DataBuffer and SenseData) needs to be explicitly mapped to device by PciIo->Map(). To avoid the overhead of mapping/unmapping the DataBuffer and SenseData to the device for every SCSI requst (and to simplify code), introduce a single DMA communication buffer that will be mapped to device on initialization. When a SCSI request needs to be sent to device, the DataBuffer and SenseData will be copied from/to the DMA communication buffer as required. This will be done by the following commits. Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=2567 Signed-off-by: Liran Alon <liran.alon@oracle.com> Message-Id: <20200328200100.60786-15-liran.alon@oracle.com> Reviewed-by: Nikita Leshenko <nikita.leshchenko@oracle.com> Reviewed-by: Laszlo Ersek <lersek@redhat.com>
* OvmfPkg/PvScsiDxe: Setup requests and completions ringsLiran Alon2020-03-303-0/+237
| | | | | | | | | | | | | | | | These rings are shared memory buffers between host and device in which a cyclic buffer is managed to send request descriptors from host to device and receive completion descriptors from device to host. Note that because device may be constrained by IOMMU or guest may be run under AMD SEV, we make sure to map these rings to device by using PciIo->Map(). Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=2567 Signed-off-by: Liran Alon <liran.alon@oracle.com> Message-Id: <20200328200100.60786-14-liran.alon@oracle.com> Reviewed-by: Nikita Leshenko <nikita.leshchenko@oracle.com> Reviewed-by: Laszlo Ersek <lersek@redhat.com>
* OvmfPkg/PvScsiDxe: Reset adapter on initLiran Alon2020-03-301-0/+114
| | | | | | | | | | | The following commits will complete the implementation of device initialization. Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=2567 Reviewed-by: Laszlo Ersek <lersek@redhat.com> Signed-off-by: Liran Alon <liran.alon@oracle.com> Message-Id: <20200328200100.60786-13-liran.alon@oracle.com> Reviewed-by: Nikita Leshenko <nikita.leshchenko@oracle.com>
* OvmfPkg/PvScsiDxe: Define device interface structures and constantsLiran Alon2020-03-301-0/+165
| | | | | | | | | | | These definitions will be used by the following commits to complete the implementation of PVSCSI device driver. Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=2567 Acked-by: Laszlo Ersek <lersek@redhat.com> Signed-off-by: Liran Alon <liran.alon@oracle.com> Message-Id: <20200328200100.60786-12-liran.alon@oracle.com> Reviewed-by: Nikita Leshenko <nikita.leshchenko@oracle.com>
* OvmfPkg/PvScsiDxe: Enable MMIO-Space & Bus-Mastering in PCI attributesLiran Alon2020-03-301-1/+11
| | | | | | | | | | | Enable MMIO-Space & Bus-Mastering PCI attributes when device is started. Note that original PCI attributes are restored when device is stopped. Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=2567 Reviewed-by: Laszlo Ersek <lersek@redhat.com> Signed-off-by: Liran Alon <liran.alon@oracle.com> Message-Id: <20200328200100.60786-11-liran.alon@oracle.com> Reviewed-by: Nikita Leshenko <nikita.leshchenko@oracle.com>
* OvmfPkg/PvScsiDxe: Backup/Restore PCI attributes on Init/UnInitLiran Alon2020-03-302-1/+54
| | | | | | | | | | | | This commit doesn't change semantics. It is done as a preparation for future commits which will modify PCI attributes. Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=2567 Reviewed-by: Laszlo Ersek <lersek@redhat.com> Signed-off-by: Liran Alon <liran.alon@oracle.com> Message-Id: <20200328200100.60786-10-liran.alon@oracle.com> Reviewed-by: Nikita Leshenko <nikita.leshchenko@oracle.com>
* OvmfPkg/PvScsiDxe: Open PciIo protocol for later useLiran Alon2020-03-302-1/+29
| | | | | | | | | | | This will give us an exclusive access to the PciIo of this device after it was started and until it will be stopped. Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=2567 Reviewed-by: Laszlo Ersek <lersek@redhat.com> Signed-off-by: Liran Alon <liran.alon@oracle.com> Message-Id: <20200328200100.60786-9-liran.alon@oracle.com> Reviewed-by: Nikita Leshenko <nikita.leshchenko@oracle.com>
* OvmfPkg/PvScsiDxe: Translate Target & LUN to/from DevicePathLiran Alon2020-03-301-2/+59
| | | | | | | | | | | Implement EXT_SCSI_PASS_THRU.BuildDevicePath() and EXT_SCSI_PASS_THRU.GetTargetLun(). Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=2567 Reviewed-by: Laszlo Ersek <lersek@redhat.com> Signed-off-by: Liran Alon <liran.alon@oracle.com> Message-Id: <20200328200100.60786-8-liran.alon@oracle.com> Reviewed-by: Nikita Leshenko <nikita.leshchenko@oracle.com>
* OvmfPkg/PvScsiDxe: Report the number of targets and LUNsLiran Alon2020-03-304-2/+136
| | | | | | | | | | | | | | | | | | | | | | Implement EXT_SCSI_PASS_THRU.GetNextTarget() and EXT_SCSI_PASS_THRU.GetNextTargetLun(). ScsiBusDxe scans all MaxTarget * MaxLun possible devices. This can take unnecessarily long for large number of targets. To deal with this, VirtioScsiDxe has defined PCDs to limit the MaxTarget & MaxLun to desired values which gives sufficient performance. It is very important in virtio-scsi as it can have very big MaxTarget & MaxLun. Even though a common PVSCSI device has a default MaxTarget=64 and MaxLun=0, we implement similar mechanism as virtio-scsi for completeness. This may be useful in the future when PVSCSI will have bigger values for MaxTarget and MaxLun. Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=2567 Reviewed-by: Laszlo Ersek <lersek@redhat.com> Signed-off-by: Liran Alon <liran.alon@oracle.com> Message-Id: <20200328200100.60786-7-liran.alon@oracle.com> Reviewed-by: Nikita Leshenko <nikita.leshchenko@oracle.com>
* OvmfPkg/PvScsiDxe: Install stubbed EXT_SCSI_PASS_THRULiran Alon2020-03-303-3/+241
| | | | | | | | | | Support dynamic insertion and removal of the protocol. Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=2567 Reviewed-by: Laszlo Ersek <lersek@redhat.com> Signed-off-by: Liran Alon <liran.alon@oracle.com> Message-Id: <20200328200100.60786-6-liran.alon@oracle.com> Reviewed-by: Nikita Leshenko <nikita.leshchenko@oracle.com>
* OvmfPkg/PvScsiDxe: Probe PCI devices and look for PvScsiLiran Alon2020-03-303-1/+74
| | | | | | | | | | | | | PvScsiControllerSupported() is called on handles passed in by the ConnectController() boot service and if the handle is the PVSCSI controller, the function would return success. A success return value will attach our driver to the device. Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=2567 Reviewed-by: Laszlo Ersek <lersek@redhat.com> Signed-off-by: Liran Alon <liran.alon@oracle.com> Message-Id: <20200328200100.60786-5-liran.alon@oracle.com> Reviewed-by: Nikita Leshenko <nikita.leshchenko@oracle.com>
* OvmfPkg/PvScsiDxe: Report name of driverLiran Alon2020-03-301-2/+57
| | | | | | | | | | | Install Component Name protocols to have a nice display name for the driver in places such as UEFI shell. Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=2567 Reviewed-by: Laszlo Ersek <lersek@redhat.com> Signed-off-by: Liran Alon <liran.alon@oracle.com> Message-Id: <20200328200100.60786-4-liran.alon@oracle.com> Reviewed-by: Nikita Leshenko <nikita.leshchenko@oracle.com>
* OvmfPkg/PvScsiDxe: Install DriverBinding protocolLiran Alon2020-03-302-1/+66
| | | | | | | | | | | In order to probe and connect to the PvScsi device we need this protocol. Currently it does nothing. Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=2567 Reviewed-by: Laszlo Ersek <lersek@redhat.com> Signed-off-by: Liran Alon <liran.alon@oracle.com> Message-Id: <20200328200100.60786-3-liran.alon@oracle.com> Reviewed-by: Nikita Leshenko <nikita.leshchenko@oracle.com>
* OvmfPkg/PvScsiDxe: Create empty driverLiran Alon2020-03-308-0/+86
| | | | | | | | | | | In preparation for support booting from PvScsi devices, create a basic scaffolding for a driver. Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=2567 Reviewed-by: Laszlo Ersek <lersek@redhat.com> Signed-off-by: Liran Alon <liran.alon@oracle.com> Message-Id: <20200328200100.60786-2-liran.alon@oracle.com> Reviewed-by: Nikita Leshenko <nikita.leshchenko@oracle.com>
* EmbeddedPkg/AcpiLib: add GICC table init macro for ACPI 6.3Pete Batard2020-03-301-0/+8
| | | | | | | | | | | ACPI 6.3 added a 16-bit SPE overflow Interrupt field, replacing 2 of the 3 reserved bytes that are defined at the end of the GICC structure for 6.0. Add a new macro to initialise the new field. Signed-off-by: Pete Batard <pete@akeo.ie> Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
* NetworkPkg/Ip6Dxe: Improve Neightbor Discovery message validation.Maciej Rabeda2020-03-303-31/+83
| | | | | | | | | | | | | | REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2174 Problem has been identified with Ip6ProcessRouterAdvertise() when Router Advertise packet contains options with malicious/invalid 'Length' field. This can lead to platform entering infinite loop when processing options from that packet. Cc: Jiaxin Wu <jiaxin.wu@intel.com> Cc: Siyuan Fu <siyuan.fu@intel.com> Signed-off-by: Maciej Rabeda <maciej.rabeda@linux.intel.com> Reviewed-by: Siyuan Fu <siyuan.fu@intel.com>
* OvmfPkg/GenericQemuLoadImageLib: Fix VS2019 UINT32 conversion errorArd Biesheuvel2020-03-301-1/+1
| | | | | | | | | | | | | | | | Building OVMF for X64 with secure boot enabled on VS2019 results in the following error: d:\a\1\s\OvmfPkg\Library\GenericQemuLoadImageLib\GenericQemuLoadImageLib.c(154): error C2220: the following warning is treated as an error d:\a\1\s\OvmfPkg\Library\GenericQemuLoadImageLib\GenericQemuLoadImageLib.c(154): warning C4244: '=': conversion from 'UINTN' to 'UINT32', possible loss of data Suppress the error by making the cast explicit. Link: https://bugzilla.tianocore.org/show_bug.cgi?id=2636 Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Laszlo Ersek <lersek@redhat.com>
* MdeModulePkg: Remove gEfiFormBrowserExProtocolGuid Protocol GuidGuoMinJ2020-03-304-4/+0
| | | | | | | | | | REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2145 Replace the gEfiFormBrowserExProtocolGuid with gEdkiiFormBrowserExProtocolGuid, remove the unnecessary declaration. Signed-off-by: GuoMinJ <newexplorerj@gmail.com> Acked-by: Hao A Wu <hao.a.wu@intel.com>
* DynamicTablesPkg: Option for VS2017 static code analysisSami Mujawar2020-03-291-0/+7
| | | | | | | | Add build option STATIC_ANALYSIS to enable VS2017 static code analysis. Signed-off-by: Sami Mujawar <sami.mujawar@arm.com> Reviewed-by: Alexei Fedorov <Alexei.Fedorov@arm.com>
* DynamicTablesPkg: Remove erroneous use of EFIAPISami Mujawar2020-03-291-10/+1
| | | | | | | | | | | | | The Dynamic Tables Factory protocol has an erroneous EFIAPI calling convention macro in the function pointer declaration. Remove the erroneous EFIAPI calling convention macro from the interface declarations. Signed-off-by: Sami Mujawar <sami.mujawar@arm.com> Reviewed-by: Alexei Fedorov <Alexei.Fedorov@arm.com> Reviewed-by: Philippe Mathieu-Daude <philmd@redhat.com>
* DynamicTablesPkg: PPTT: Fix uninitialized memory usageSami Mujawar2020-03-291-30/+29
| | | | | | | | | | | | | On enabling the /analyse option the VS2017 compiler reports: warning C6001: Using uninitialized memory. This warning is reported as some variables that were being logged were uninitialised. To fix this, moved the logging code after the variables being logged are initialised. Signed-off-by: Sami Mujawar <sami.mujawar@arm.com> Reviewed-by: Alexei Fedorov <Alexei.Fedorov@arm.com>
* DynamicTablesPkg: IORT: Fix uninitialized memory usageSami Mujawar2020-03-291-48/+48
| | | | | | | | | | | | | On enabling the /analyse option the VS2017 compiler reports: warning C6001: Using uninitialized memory. This warning is reported as some variables that were being logged were uninitialised. To fix this, moved the logging code after the variables being logged are initialised. Signed-off-by: Sami Mujawar <sami.mujawar@arm.com> Reviewed-by: Alexei Fedorov <Alexei.Fedorov@arm.com>