summaryrefslogtreecommitdiffstats
path: root/OvmfPkg/VirtioPciDeviceDxe
Commit message (Collapse)AuthorAgeFilesLines
* OvmfPkg: Replace BSD License with BSD+Patent LicenseMichael D Kinney2019-04-094-28/+4
| | | | | | | | | | | | | | | | | | | | https://bugzilla.tianocore.org/show_bug.cgi?id=1373 Replace BSD 2-Clause License with BSD+Patent License. This change is based on the following emails: https://lists.01.org/pipermail/edk2-devel/2019-February/036260.html https://lists.01.org/pipermail/edk2-devel/2018-October/030385.html RFCs with detailed process for the license change: V3: https://lists.01.org/pipermail/edk2-devel/2019-March/038116.html V2: https://lists.01.org/pipermail/edk2-devel/2019-March/037669.html V1: https://lists.01.org/pipermail/edk2-devel/2019-March/037500.html Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com> Reviewed-by: Laszlo Ersek <lersek@redhat.com>
* OvmfPkg/VirtioPciDeviceDxe: list "VirtioPciDevice.h" in the INF fileLaszlo Ersek2018-03-131-0/+1
| | | | | | | | | | | | | | | | Among other things, the header file declares the functions that implement the VIRTIO_DEVICE_PROTOCOL members over virtio-pci (v0.9.5). The functions are defined in "VirtioPciFunctions.c", and referenced in the initialization of "mDeviceProtocolTemplate", in "VirtioPciDevice.c". Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org> Cc: Jordan Justen <jordan.l.justen@intel.com> Suggested-by: Michael Kinney <michael.d.kinney@intel.com> Ref: http://mid.mail-archive.com/E92EE9817A31E24EB0585FDF735412F56327F7D3@ORSMSX113.amr.corp.intel.com Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
* OvmfPkg/Virtio: take RingBaseShift in SetQueueAddress()Brijesh Singh2017-08-252-2/+6
| | | | | | | | | | | | | | | | | | | | | | | | | For the case when an IOMMU is used for translating system physical addresses to DMA bus master addresses, the transport-independent virtio device drivers will be required to map their VRING areas to bus addresses with VIRTIO_DEVICE_PROTOCOL.MapSharedBuffer() calls. - MMIO and legacy virtio transport do not support IOMMU to translate the addresses hence RingBaseShift will always be set to zero. - modern virtio transport supports IOMMU to translate the address, in next patch we will update the Virtio10Dxe to use RingBaseShift offset. 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: remove commit msg paragraph with VirtioLib reference] [lersek@redhat.com: fix typo in VIRTIO_SET_QUEUE_ADDRESS comment block] Reviewed-by: Laszlo Ersek <lersek@redhat.com> Regression-tested-by: Laszlo Ersek <lersek@redhat.com>
* OvmfPkg/VirtioPciDeviceDxe: implement IOMMU-like member functionsBrijesh Singh2017-08-253-1/+98
| | | | | | | | | | | | | | | | | | | | | | | | | The patch implements the newly added IOMMU-like member functions by respectively delegating the job to: - VIRTIO_DEVICE_PROTOCOL.AllocateSharedPages () -> MemoryAllocationLib.AllocatePages() - VIRTIO_DEVICE_PROTOCOL.FreeSharedPages () -> MemoryAllocationLib.FreePages () - VIRTIO_DEVICE_PROTOCOL.MapSharedBuffer () -> no-op - VIRTIO_DEVICE_PROTOCOL.UnmapSharedBuffer () -> no-op 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> 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/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>
* OvmfPkg: Fix typos in commentsGiri P Mudusuru2016-07-081-2/+2
| | | | | | | | | | | - accessibla to accessible - exeuction to execution Cc: Jordan Justen <jordan.l.justen@intel.com> Cc: Laszlo Ersek <lersek@redhat.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Giri P Mudusuru <giri.p.mudusuru@intel.com> Reviewed-by: Laszlo Ersek <lersek@redhat.com>
* OvmfPkg: VIRTIO_DEVICE_PROTOCOL: pass VRING object to SetQueueAddress()Laszlo Ersek2016-04-062-5/+5
| | | | | | | | | | | | | | | | In virtio-1.0, it is not enough to pass the base address of the virtio queue to the hypervisor (as a frame number); instead it will want the addresses of the descriptor table, the available ring, and the used ring separately. Pass the VRING object to the SetQueueAddress() member function; this will enable a virtio-1.0 implementation. Convert the current producers and consumers to this prototype. Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org> Cc: Jordan Justen <jordan.l.justen@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Laszlo Ersek <lersek@redhat.com> Tested-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
* OvmfPkg: VIRTIO_DEVICE_PROTOCOL: remove GetQueueAddress() memberLaszlo Ersek2016-04-063-27/+0
| | | | | | | | | | | | | This function was never consumed by drivers, and the current prototype is unsupportable with virtio-1.0. Remove the function from the protocol definition, and drop the current (unused) implementations. Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org> Cc: Jordan Justen <jordan.l.justen@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Laszlo Ersek <lersek@redhat.com> Tested-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
* OvmfPkg: VIRTIO_DEVICE_PROTOCOL: widen the Features bitmap to 64 bitsLaszlo Ersek2016-04-062-6/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The virtio-1.0 spec widens the Features bitmap to 64 bits. Modify the declarations of the GetDeviceFeatures() and SetGuestFeatures() protocol member functions accordingly. Normally, a protocol cannot be changed in incompatible ways if the GUID stays the same; however, we've always been extremely clear that VIRTIO_DEVICE_PROTOCOL is internal to edk2. See for example the top of "OvmfPkg/Include/Protocol/VirtioDevice.h". In this patch, all producers and consumers of the GetDeviceFeatures() and SetGuestFeatures() protocol members are updated. The drivers that currently produce these members are "legacy" drivers (in virtio-1.0 terminology), and they cannot (and will not) handle feature bits above BIT31. Therefore their conversion is only for compatibility with the modified protocol interface. The consumers will be responsible for checking the VIRTIO_DEVICE_PROTOCOL.Revision field, and for not passing feature bits that these backends cannot handle. The VirtioMmioGetDeviceFeatures() implementation stores the result of an MmioRead32() call with normal assignment, so it needs no change beyond adapting its prototype. Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org> Cc: Jordan Justen <jordan.l.justen@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Laszlo Ersek <lersek@redhat.com> Tested-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
* OvmfPkg/VirtioPciDeviceDxe: Implement VIRTIO_DEVICE_PROTOCOL for VirtIo ↵Olivier Martin2013-12-114-0/+1172
Devices over PCI This change implements the VIRTIO_DEVICE_PROTOCOL for the PCI transport layer. The VirtIo device drivers will interact with the PCI-based VirtIo devices through this protocol implementation. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Olivier Martin <olivier.martin@arm.com> v5: - updated comment block on VirtioPciDeviceRead() - return EFI_UNSUPPORTED instead of failed ASSERT() in VirtioPciSetPageSize() - VirtioPciIoRead(): restore the original requirement that FieldSize equal BufferSize exactly (not only divide it). The looping added in v4 did not match the comment block, and the only place that used it in v4 (ie. VirtioNetGetFeatures()) needs an open-coded loop anyway (will be done in a later part of v5). Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Jordan Justen <jordan.l.justen@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@14964 6f19259b-4bc3-4df7-8a09-765794883524