History log of /device/linaro/bootloader/edk2/OvmfPkg/VirtioBlkDxe/VirtioBlk.h
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
fcb636ea4244cb29d3f6a6d938dd9f7692ecfa7c 16-Oct-2015 Laszlo Ersek <lersek@redhat.com> OvmfPkg: VirtioBlkDxe: reset device at ExitBootServices()

(1) VirtioLib allocates the virtio ring in EfiBootServicesData memory.
(This is intentional.) Code that executes after ExitBootServices() is
permitted to reuse such memory.

(2) The hypervisor is allowed to look at, and act upon, a live virtio ring
at any time, even without explicit virtio kicks from the guest.

Should boot loader code or kernel code, running between ExitBootServices()
and the kernel's own virtio drivers resetting the device, overwrite the
pages that used to contain the virtio ring before ExitBootServices(), QEMU
could theoretically interpret that unrelated data as garbage ring
contents, and abort the guest.

Although we have seen no such reports, better be prudent and reset the
device in an ExitBootServices() event handler. Among other things, this
causes QEMU to forget about the device's virtio ring.

Cc: Jordan Justen <jordan.l.justen@intel.com>
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@18624 6f19259b-4bc3-4df7-8a09-765794883524
/device/linaro/bootloader/edk2/OvmfPkg/VirtioBlkDxe/VirtioBlk.h
56f65ed838e8d73e91d54a8ed984d777c936843c 11-Dec-2013 Olivier Martin <olivier.martin@arm.com> OvmfPkg: Make the VirtIo devices use the new VIRTIO_DEVICE_PROTOCOL

This change replaces the accesses to the PCI bus from the Block, Scsi and Net drivers by
the use of the new VIRTIO_DEVICE_PROTOCOL protocol that abstracts the transport layer.
It means these drivers can be used on PCI and MMIO transport layer.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Olivier Martin <olivier.martin@arm.com>

v5:
- VirtioFlush(): update comment block in VirtioLib.[hc]; error code is
propagated from VirtIo->SetQueueNotify().
- VirtioBlkInit(): jump to Failed label if SetPageSize() fails
- VirtioBlkInit(): fixup comment, and add error handling, near
SetQueueNum() call
- VirtioBlkDriverBindingStart(): remove redundant (always false) check for
a subsystem device ID different from VIRTIO_SUBSYSTEM_BLOCK_DEVICE;
VirtioBlkDriverBindingSupported() handles it already
- VirtioNetGetFeatures(): update stale comment block
- VirtioNetGetFeatures(): retrieve MAC address byte for byte (open-coded
loop)
- VirtioNetDriverBindingStart(): remove redundant (always false) check for
a subsystem device ID different from VIRTIO_SUBSYSTEM_NETWORK_CARD;
VirtioNetDriverBindingSupported() handles it already
- VirtioNetInitRing(): call SetQueueNum() and SetQueueAlign() for proper
MMIO operation
- VirtioNetInitialize(): fix destination error label for when
SetPageSize() fails
- VirtioScsi.c: fix comment block of VIRTIO_CFG_WRITE()/VIRTIO_CFG_READ()
- VirtioScsiInit(): fix destination error label for when SetPageSize()
fails
- VirtioScsiInit(): call SetQueueNum() and SetQueueAlign() for proper MMIO
operation

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@14966 6f19259b-4bc3-4df7-8a09-765794883524
/device/linaro/bootloader/edk2/OvmfPkg/VirtioBlkDxe/VirtioBlk.h
045b46e92d2ff47a1fa1d7aece0155b87b412e3d 12-Oct-2012 jljusten <jljusten@6f19259b-4bc3-4df7-8a09-765794883524> OvmfPkg: move VirtioBlkDxe/Virtio.h to Include/IndustryStandard/Virtio.h

This commit consists of:
- a verbatim move ("similarity index 100%" in git parlance),
- an updated #include directive in VirtioBlkDxe/VirtioBlk.h,
- and an OvmfPkg.dec package entry in VirtioBlkDxe/VirtioBlk.inf, so that
the new include directory is searched.

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://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@13836 6f19259b-4bc3-4df7-8a09-765794883524
/device/linaro/bootloader/edk2/OvmfPkg/VirtioBlkDxe/VirtioBlk.h
936e3a5dfdf9b2430f3917a11da92d45f259c3e7 12-Oct-2012 jljusten <jljusten@6f19259b-4bc3-4df7-8a09-765794883524> OvmfPkg: add inclusion guards to VirtioBlkDxe/VirtioBlk.h

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://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@13835 6f19259b-4bc3-4df7-8a09-765794883524
/device/linaro/bootloader/edk2/OvmfPkg/VirtioBlkDxe/VirtioBlk.h
fd51d7599173164be618d26e9d3673c09f60dbb2 08-Oct-2012 jljusten <jljusten@6f19259b-4bc3-4df7-8a09-765794883524> OvmfPkg: introduce virtio-blk driver

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://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@13798 6f19259b-4bc3-4df7-8a09-765794883524
/device/linaro/bootloader/edk2/OvmfPkg/VirtioBlkDxe/VirtioBlk.h